I am trying to test the OPC scripting function to read a tag. I enabled “Anonymous Access” in the OPC UA server settings, all my project tags are visible in the OPC UA tag browser. I copied the tag path of one of the tags and tried to read its value with the following code copied from the scripting examples, which is called in gateway startup script.
def opctest(): server = "Ignition OPC-UA Server" path = "ns=2;s=[default]/Tag 0" qualifiedValue = system.opc.readValue(server, path) print "Value: " + str(qualifiedValue.getValue()) print "Quality: " + qualifiedValue.getQuality().toString() print "Timestamp: " + qualifiedValue.getTimestamp().toString()
I get error-
INFO | jvm 1 | 2020/05/20 22:13:27 | Value: None INFO | jvm 1 | 2020/05/20 22:13:27 | Quality: Error_Configuration INFO | jvm 1 | 2020/05/20 22:13:27 | Timestamp: Sat May 16 21:53:21 IST 2020
What could be going wrong? I have the gateway server running, not in freeze.