Author Topic: How to force refresh on modbusTCPCom and dataSubscriber2  (Read 908 times)

robkwan

  • Newbie
  • *
  • Posts: 44
    • View Profile
How to force refresh on modbusTCPCom and dataSubscriber2
« on: January 11, 2016, 01:45:30 PM »
Is it possible to force a refresh on modbusTCPCom and dataSubscriber2 to get a set of fresh register values?

The application in some error handlers need to get fresh data to update the state of Windows controls. I could manually read all the registers and update the button/editbox states (code already in dataSubscriber2 change event). Is there a way to get modbusTCPCom/dataSubscriber2 to do it as if the applicable has just started?


Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: How to force refresh on modbusTCPCom and dataSubscriber2
« Reply #1 on: January 11, 2016, 01:47:38 PM »
The DataSubscriber2 has 2 event handlers

- DataChanged
- DataReturned

If you use the DataReturned, it will fire eveytime data comes back from the PLC no matter if it changed or not. In the proopertied Window for the DataSubscriber, click the lightening bolt icon to see all of the available events.