Applies To:
  • CitectSCADA 3.XX 4.XX

IO Devices which take a long time to process requests for data or operate over very slow communications media can be a problem when writing a driver. Since Citect does not display a page until all the data is available this leads to a large delay especially if the driver must read several data items one at a time.

A Typical the solution for the driver writer is to implement a Frontend/Backend driver. However even a driver of this design will be initially slow as the data must be read before it can be serviced out of the driver memory.

What is the best way to handle these requests for data which has not yet been read?


The solution is to set the Driver Error for the request to DRIVER_BAD_DATA and call Reply(dcb) without attempting to wait for a response from the IO Device. The driver should also schedule polling of that data, when the data has been polled, requests for that data from Citect may be serviced out of the driver memory.

Setting a Driver Error for the request will normally cause a hardware alarm but this can be masked out by the following Parameter or Citect.INI setting.


Note that the CT_ERR.H defines GENERIC_INVALID_DATA as 0x019 which is 25 decimal.

This solution is not workable for Citect version previous to 3.00 since in these earlier versions data from requests which failed were evaluated by the alarm system as having a value of 0 which could trigger nuisance alarms.

Care should also be taken if the user is only reading the data at a rate less that the driver purges out its memory image. For example many Frontend/Backend drivers stop polling for a specific data if the Citect has not asked for it within some period of time. For example consider a trend sampling every hour and a driver which gives up polls for data 10 minutes after the last reference to that data. The driver determines that since the data has not been recently used it should not be polled. When the trend system requests the data, gets a 'invalid data' error code and leaves 'n/a' in the trend.