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:
image

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

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.

Thanks,

It doesn’t works

image

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!