LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

OPC UA Read and Write at once

Solved!
Go to solution

Hello everybody

 

I want to read and write variables via OPC UA to my Codesys PLC in one file. Reading is working perfectly as you see in the image below. But everytime i want to write somethin the error message: Bad_TypeMismatch is coming. I tried the MultipleRead with Variant and with String (my node is a String right when the nodeID is s=) but none of the are working.

This is my Labview block diagram:

1.png

 

What is wrong with my block diagram? 

 

PS Here is the UAExpert POV from that node:

2.png

 

Thanks for helping

 

mgele

0 Kudos
Message 1 of 3
(9,429 Views)
Solution
Accepted by topic author mgele

If your data type is Int16:

 

Screenshot 2024-04-25 11.57.05.png

why you trying to put String here? Of course, you will get Type Mismatch, it is expected.

Try to write Int16, the types should match:

Screenshot 2024-04-25 11.58.55.png

Variant after proper cast will also work, but I would to recommend to use dedicated type as configured in PLC. Read and write in one command is not possible with NI OPC UA Toolkit (and not sure if this possible with OPC UA at all by design, but this needs to be checked).

0 Kudos
Message 2 of 3
(9,410 Views)

@Andrey_Dmitriev wrote:

 

Variant after proper cast will also work, but I would to recommend to use dedicated type as configured in PLC. Read and write in one command is not possible with NI OPC UA Toolkit (and not sure if this possible with OPC UA at all by design, but this needs to be checked).


As far as I see it is not a feature of the OPC UA specification. Except the method call of course but that is a different service interface.

Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 3
(131 Views)