I would spend some time on how read blocking works. For now, run your script in the script console for testing purposes. Pay attention in how the results are a list of qualified values.
https://docs.inductiveautomation.com/display/DOC81/system.tag.readBlocking
You mentioned being new. I highly recommend you spend time going through inductive university.
2 issues:
- As @jlandwerlen alluded to, you have a misunderstanding in what readBlocking returns. This returns a list of QualifiedValue objects, even if you only supply a single tagpath.
Also, consider using the format
function for your string substitutions/concats.
E.g.
OPC_Hopper_Tag = "[default]Modbus_Master_PLC/GVL_OPC_Hopper_{}_Match'.format(self.view.getChild('root').custom.HopperID) # no need to convert the arg to str
OPC_Hopper_Tag_Value = system.tag.readBlocking(OPC_Hopper_Tag)[0].value # get the first item and get the QualifiedValue's `value` property, which is the value of the tag.
- Don't use scripting for something that can be natively handled by bidirectional indirect tag bindings, such as this.
You don't need the scripting at all in this instance. Just bi-directionally bind your dropdown props.value
properties
nmichin
Thank you that worked nicely,
I hope you mean No. 2 worked nicely!
Hi Mate
I did the Script first to see if that worked and it did, but changed it to the Bidirectional Binding and it works as well,
This is the first project i was doing with Ignition as the previous company that was looking after my customer when broke so i got stuck with the task lol, we all had to start some where i just happen to start on an existing system and get a customer out of a pickle.
Thanks again for the assistance much appreciated.
2 Likes