LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

OPC PLC Connection

I have setup an OPC server using Kepware to communicate through to a PLC. I am using datasocket.

There is no problem with reading and writing to the OPC server.

 

Is there a way to check if the connection between the OPC server and the PLC is valid eg. using Datasocket Read? Or is there an other way to check about the data is valid

0 Kudos
Message 1 of 6
(2,968 Views)

Hi Kim,

 

The value you can get using control value tag to value tag, and the status of tag you can get using state message tag.

Thanks and Regards
Himanshu Goyal | LabVIEW Engineer- Power System Automation
Values that steer us ahead: Passion | Innovation | Ambition | Diligence | Teamwork
It Only gets BETTER!!!
0 Kudos
Message 2 of 6
(2,964 Views)

I am sorry but I didn't understand what you were trying to tell me. Can you please attach a screendump or try to be more specific

0 Kudos
Message 3 of 6
(2,950 Views)

Read an item as a variant, then use Get Variant Attribute with attribute name "Quality".

Convert the attribute value to an integer: this is the OPC quality code of the item, a bitmask from which you can extract information about the connection status and other info.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 6
(2,941 Views)

Thanks Pincpanter

 

Can you tell me which bit is the connection to the PLC?

0 Kudos
Message 5 of 6
(2,921 Views)

Kepware documentation should give you the answer. Searching the web, I found this document.

 

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 6 of 6
(2,918 Views)