On propertyChange event ComponentRunning, bound tags are not loading data

I have a template that I have created and on window startup I would like the data to populate.

This is my Script in the propertyChange Event under scripting on the template.

CanFeedUDT is a UDT type that is bound in the main window with the different equipment that I want to track. WasherEndWord is a plc tag that is in the UDT structure.

if (event.propertyName == 'componentRunning'):
print event.source.CanFeedUDT.WasherEndWord

This prints out None for the value of event.source.CanFeedUDT.WasherEndWord, is there a way that I can wait until CanFeedUDT values are loaded before trying to read the data?

Instead of looking at the propertyChange for componentRunning, which occurs before asynchronous bindings respond (tags and queries), look at the change for the property of interest.

I can try that, my problem was I could not figure out how to watch for a property change on one tag in the UDT data structure.

Ah, that's your problem. Don't use UDT properties.

1 Like

You could delay the event with invokeLater

Yet another reason not to use them to add to the list... :sweat_smile:

1 Like