Read tag value with a perspective component change script

Hi everyone;

I am working with a Label and I have created a text change script as seen below:

And I would like to read the value of a tag that is bound to a PLC. is that posible with the or there is another way to read a tag value?

Best regards

It is possible, but I doubt that you actually want readAsync in this case. I assume that you are wanting to read the value to be used later on in the script?

tagValue = system.tag.readBlocking(['[YourProvider]YourTagPath'])[0].value

tagValue = system.tag.readBlocking(['[YourProvider]YourTagPath'])[0].value

Though I kinda feel we have an xy situation here.

1 Like

Yeah, very possible. I rarely use a one line tag read like that so I seem to always for get to add the member reference.


It doesn’t works


i want that every time that I press this button, read the tag value (wich is an integer data type) and assigne to the label

There is no error in the script that I can see that would make it write the value of the tag to the text property. Are you getting an error reported?

If this is on a button, then the script should be in the actionPerformed event, not in a value changed script.

Youe are right, I was doing it wrong. thaks a lot!