Hi there,
for ControlLogix PLC String tag, I am only able to capture LEN and DATA. where DATA is in SINT. In my case, I am trying to get String value scanned from barcode reader. However the only format I can get it is in SINT. I am guessing then I would need to convert each SINT to Chr( ) in Ignition and concatinate to get true string value.
Is this the only way?
Please Help!
Thanks
Where's this tag / tag(s) coming from?
Ignition's Logix drivers expose tags as a single String tag, not as its individual structure members.
coming from ControlLogix 1756 - (CMT-G01 - MQTT Gateway) - Broker - Ignition.
While loading on CMT-G01 , Its only able to read INT and SINT.
Okay, well unless this thing can do a better job of modelling Strings, you have to live with the manual conversion of some sort.
I see! so its the Gateway's capability then!
any tips for manual conversion?
Consider configuring the CMT gateway to access the tag as a string, then publish that over MQTT. (Sadly, Maple Systems doesn't want people looking at their protocol documentation.)
This is what I get. I cannot select String, it divides further into LEN and DATA. where DATA in SINT has individual characters and ignition also takes it same way. since thats how gateway is sending data.
Here's a starter script:
def readString(lenTagPath, baseDataTagPath):
length = system.tag.readBlocking([lenTagPath])[0].value
dataTagPaths = [baseDataTagPath + "/" + str(i) for i in range(length)]
dataTagValues = [qv.value for qv in system.tag.readBlocking(dataTagPaths)]
value = ''.join([chr(v) for v in dataTagValues])
print value
Given these tags:
![image](https://global.discourse-cdn.com/inductiveautomation/original/3X/e/d/ed19c0aea612aa21c0eb5d7d75560bedb32e8920.png)
StringUtil.readString("Length", "Data")
hello
>>>