How to write a String Data Type Bosch Rexroth PLC OPC UA Server

The data type in the PLC is a string. Does ignition treat as an array of shorts?

How might I go about writing to this OPC item? I made a string OPC tag to that path and it returns [0,0,0,0,…] and won’t write to it


server = "IndraControl OPC UA Server"
path = "ns=2;s=Application.GVL.EXT_OPC.OperatorInfo"
qualifiedValue = system.opc.readValue(server, path)
print "Value: " + str(qualifiedValue.getValue())
print "Quality: " + qualifiedValue.getQuality().toString()
print "Timestamp: " + qualifiedValue.getTimestamp().toString()

Value: array(java.lang.Short, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
Quality: Good
Timestamp: Wed Jan 20 14:55:38 CST 2021 

Can you connect UaExpert to the server and view that tag as well as its member tags and tell me what the reported DataTypes are?

I can’t see the DataType or ArrayDimension attributes for the OperatorInfo tag to confirm, but it does indeed look like the value of that tag is just an array of unsigned bytes.

If OperatorInfo should be a String then it seems like whoever built this server doesn’t understand how to model data in OPC UA.

It is…

image

You would think Bosch would build a proper server. :expressionless:

I guess I have to write a script to ship the ordinals to the members.

Yeah, that sucks. Seems like they have just mirrored the internal data structures to OPC UA without any additional thought.