LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

OPC UA Toolkit client cannot Read "Bool" from SIEMENS S7-1500 PLC

Hello Community,

 

I'm trying to read variables from a SIEMENS S7-1500 PLC with the OPC-UA Toolkit. If I use a Bool-Array it works. See here:

ReadArray.PNGviArray.PNGUA_Expert_Array.PNG

If I use just a Bool variable, I always get the error: "Bad_IndexRangeInvalid". Why is there a problem with the index range if I don't use an array?

I also tried to read Int.. also no success. It seems that it just works with arrays. Is there a problem with my syntax at the identifier?

 

Screens:

fpBool.PNGvi_Bool.PNGUA_Expert_Bool.PNG

 

I hope anyone has a solution for this issue..

 

Best regards,

Christian Hartung

0 Kudos
Message 1 of 27
(8,428 Views)

Hi Christian,

 

did you took a look into the function help for the Read VI?

 

Read VI - LabVIEW 2017 OPC UA Toolkit Help - National Instruments
http://zone.ni.com/reference/en-XX/help/376230A-01/opcuavis/opcua_read_svr/#instance1

Please also read the hint about the array and scalar values:

The format of the node ID can also be ns=<namespace index>;<identifier type>=<identifier>@<index>:<index>. For example, ns=2;s=Folder.Array@1:2. This format only applies to the array data type and allows you to read a single element or a range of elements of an array. You cannot use @ in a node name.

 

Best,

Melanie

 

Best regards,
Melanie Eisfeld
Senior Applications Engineer, National Instruments Germany
Certified LabVIEW Developer
Certified TestStand Architect
0 Kudos
Message 2 of 27
(8,379 Views)

Hello Melanie,

 

yes, I always work with the LabView help.

 

I tried different syntax possibilities.. but I don't get the scalar datatypes working. 

 

Regards

Christian Hartung

0 Kudos
Message 3 of 27
(8,374 Views)

Hello,

I attached the .vi

Regards

Christian

0 Kudos
Message 4 of 27
(8,367 Views)

Hello,

 

meanwhile I found a OPC-UA Client from Siemens programmed in C#.

Reading the bool-variable works here.

 

SiemensClient.png

 

Same node-ID with the LabView-toolkit:

 

LabViewClient.png

 

Meanwhile I think it's a problem of the OPC-UA Toolkit.. because other clients are working perfect.

 

I still hope that anyone has a solution for this problem..

 

Best regards

Christian Hartung

0 Kudos
Message 5 of 27
(8,308 Views)

One thing that I noticed is that the browse result is listing the node ID as ns=3;s="xTestBool" but the input you are using for the read is ns=3;s=Inputs."xTestBool". I would try to change the node ID so that it matches what the browse is returning.

 

Another thing that you can try is just using the node path which for that input should be PLC_1.Inputs.xTestBool

Matt J | National Instruments | CLA
0 Kudos
Message 6 of 27
(8,299 Views)

Hello,

 

tried all these paths.. Errors: "NodeId not found" or "IndexRangeInvalid".

Siemens Testclient works also with this NodeID.. you can see it in my last post (first screenshot).

 

So it seems that LabView Support can't help here, still stuck with my problem..

 

Best regards

Christian

0 Kudos
Message 7 of 27
(8,277 Views)

I am experiencing the same problem and went through the same motions. I can only add that it's not limited only to boolean, but also other data types (double) and not only reads but also writes. (LabVIEW 2017, OPC UA toolkit)

 

I have no problem with the same operation in LabVIEW 2014 SP1 (DSC). 

 

0 Kudos
Message 8 of 27
(7,983 Views)

Do you need to use OPC UA? If you are not limited in the choice of access methods to the controller, then there is a simpler library through TCP/IP in open codes. The only nuance in it is that the DB in the controller must be set to compatible with the older version controllers (S7-300, S7-400)

Labview 4.0, 5.0, 6.1, 8.6, 2009, 2011, 2012, 2014
If you do not know something, ask me.
0 Kudos
Message 9 of 27
(7,973 Views)

This issue is also becoming a big problem on a number of our projects (this worked with the DSC module functions). The only thing that works now is a read function of an array element (if @x(:y) is used at the end of the node name)

 

Is this already a known bug or is still being classified?

0 Kudos
Message 10 of 27
(7,944 Views)