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 2
(306 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 2
(287 Views)