I try to connect my CP0482 to a OPC-UA Server in my network by using the opcua_any module. I can see the server in the UaExpert tool as well as the tags, but I cannot connect with the B&R controller. All IO values (Module OK = False) are 0 but the IP:Port is correct.
I know that there are no channels defined (I also tried with defined channels) but at least any server error has to show up, or am I wrong=
@wolfgang.tengg maybe a silly question but did you enable the OpcUa system under the configuration?
What error messages do you see in the logger? You need to enable the Connectivity log in order to see OpcUa entries.
I see either OPC UA system not activated or OPC UA connection failed with an OpcUa enabled.
EDIT:
The logger information will be helpful. Testing an actual connection I ran into this error
And after adjusting the OpcUa_any configuration it connected successfully and you should see ModuleOK = TRUE and data in the rest of the diagnostic parameters.
Dear Marcel, thank you for your quick reply. OPC-UA System is of course activated, but where can I find the Connectivity log? Is it hidden in the normal logger? (there I cannot find any entry regarding the OPC-UA SYstem)
Try testing it without the channel configuration first.
The error you are seeing is related to that variable.
OPC UA Foundation error codes - Bad_TypeMismatch 0x80740000 - The value provided for the attribute is not of the same type as the attribute’s value.
Of what data type is your MyVariable?
EDIT:
There seems to be something else because mine connects and only enters warnings if the data type doesn’t match or the variable I configure doesn’t exist/can’t be found.
please check the BrowsePath attribute and also consider the escaping of the “default namespace”.
See here
Examples for process variables from the B&R Informationsmodel where x has to be replaced by the namespace index and depends on the model version (PV Model 1 or 2) configured on the server:
Global variable: /x:&:&:/x:Global PV/x:MyVariable
Local variable: /x:&:&:/x:MyTask/x:MyVariable
Thank you very much for your support and for sharing the solution in the previous discussion — it helped me establish the OPC UA connection successfully.
I am currently working with a Python OPC UA server (asyncua) and connecting to a B&R PLC using the OpcUa_any driver.
Following the suggested changes, I am now able to:
Establish a stable connection
Browse and access the node correctly
Read the variable without connection errors
However, I am facing an issue with the value interpretation on the PLC side.
Current setup:
Server: Python (asyncua)
Data type: UInt16
Example value sent: 25
Observations:
In UA Expert:
Data type = UInt16
Value = 25 (correct)
In B&R PLC (configured as UINT):
Value received = 6400
This appears to be a byte-order issue:
25 → 0x0019
Interpreted as 0x1900 → 6400
My question:
How was this issue resolved in your case?
Was any byte-order (endianness) configuration required on the PLC side?
Or did you handle byte swapping on the server side?
Is this expected behavior of the OpcUa_any driver when working with UInt16?
I would really appreciate any clarification or guidance on how to correctly handle this.