Read last good valid value with issuing new query by IOServer on MODNET protocol

Dear All,

I have a devices which communicate on MODNET protocol. I am generating report with lots of tags using default report-device feature. So i do not want to read (do not want to query all tags as all devices are on serial) all tags when i generate report. Means i want data which is available last.

Is there any option for this ?

I tried TagName.V , Tagname.Valid, Tagname.Valid.V etc but in every case IOServer is polling to serial device.

  • Have you enabled the Persist option for these I/O devices?
    I think that enables the caching of these last known values, correct me if I'm wrong.
  • Hi Bhadresh,
    The IODevice cache time is what controls how and when a request is sent to your serial device. It defaults to 300ms. The behaviour is such that the I/O Device cache will service requests for the duration of the cache time, however, if a request is made for data that has been in the cache for more than half the cache time, then it will also refresh the cache by requesting the data from the I/O Device.
    I don't think this will help your use case, as you are executing a report, and just want the last known value to be returned.
    The only option I think you should consider looking into, is enabling background polling, and set the poll period to a large value. I believe when background polling is enabled, it changes the behaviour to return the last known value instantly (which ignores the cache time). Please do a test on this and let me know if it helps.
    The tag extensions won't help in this case either, since they will still touch the device cache, and trigger a poll being sent to the IODevice.
    Kind regards
    Olivier
  • Hi Bhadresh,
    Using the subscription mechanism will help you with the report generation.
    You will list all the tags that you need and you subscribe 5 mins before you run the report and you unsubscribe 5 mins later.
    You may use 2 other reports to achieve this to make sure that the subscription is with the Report server.
    Regards
    Antonio
  • Hi Antonio,
    I think this subscription method should be tried out.
    What do you mean 2 other reports ?
  • If you have your function myTagSub() that will perform the subscription and the myTagUnSub() for the unsubscription you will need to define two reports
    1) RepSub (5 mins before the call of your reports ). In the report template you will define:
    {cicode}
    myTagSub()
    {end}
    2) RepUNSub (5 mins after the call of your report). In the report template you will define:
    {cicode}
    myTagUnSub()
    {end}

    The calls and the timing maybe adjusted accordingly to your main report.
    You didn't define it so not sure if this is a periodical report or you trigger it differently.
    It maybe good to open the IOserver.syslog to check if you have any bad communication/any error with the Modbus device to analyze the possibility to schedule the IOdevice and make sure that the communication is more stable considering the serial limitation.