Author Topic: How to address existing tags within datasubscriber datachanged event  (Read 546 times)

scott.clark

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
I created a data subscriber monitoring a tag in a plc.  When the tag changes states, within the datachanged event code, I  would like to make decisions based on other plc tags that are being used elsewhere in the application. 

Do I have to execute a plc read within the datachanged event?  Seems redundant if the plc tag is already being used in for instance a BasicIndicator, I should be able to get its latest value.

thanks

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: How to address existing tags within datasubscriber datachanged event
« Reply #1 on: February 07, 2020, 07:03:10 PM »
You should be able to collect all the values from current controls and make a decision.

Something of a similar logic you can see here:

https://www.advancedhmi.com/forum/index.php?topic=2129.msg12338#msg12338

the part that says: "Every 10 seconds the timer is collecting values currently displayed in the labels and writing them to the database."
« Last Edit: February 07, 2020, 07:08:46 PM by Godra »