AdvancedHMI Software

General Category => Support Questions => Topic started by: robkwan on January 11, 2016, 01:45:30 PM

Title: How to force refresh on modbusTCPCom and dataSubscriber2
Post by: robkwan 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?

Title: Re: How to force refresh on modbusTCPCom and dataSubscriber2
Post by: Archie 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.