IgnitionModuleDevelopmentCommunity / IgnitionNode-RED

Adds support for Node-RED
Apache License 2.0
31 stars 7 forks source link

question about tag change event #38

Closed JoeZeng133 closed 1 month ago

JoeZeng133 commented 7 months ago

I noticed you can subscribe to a tag folder or a UDT using the websocket node. How does the tag change event work in this case? Does it trigger a tag change if any memeber of the folder/UDT changes values? websocketservlet

iatraviscox commented 7 months ago

Yes, essentially you get the entire UDT as a JSON structure.

JoeZeng133 commented 7 months ago

Thanks for answering. A follow-up question: If two members of the folder/UDT are OPC tags that use the same tag group, do they emit a single tag change event or two separate events?

In my experiments, I have a bunch of OPC tags using the same tag group under a single UDT and noticed that the frequency of change event for the whole UDT instance is similar to the tag group rate. So, it seems to me all of them are emitting a single event at the group rate.

iatraviscox commented 7 months ago

If the two tags change values at different times, you will get two separate events. The tag group just controls the OPC subscription rate. It is likely that if the values change in the PLC we will get them at the same time since the rate is the same.