Applies To:
  • CitectSCADA

Summary:
[Code]WriteLocal and write values appearing to toggle between old and new values 

Solution:
The citect.ini option

[Code]WriteLocal

is documented as “Controls whether CitectSCADA writes to a local run table in Cicode. Cicode writes its local memory image of the I/O device whenever you write to the I/O device. (Cicode assumes that most writes to the I/O device will be done immediately). This local image might produce problems, …”

Users may see is what is sometimes called ‘flickering values’, but that is a misnomer. This specific behaviour here is that the value changes 3 times, not 1 time as expected. The user is expecting the display value to change from old value to new value – one change. What the user sees in this specific case is 3 changes: The new value, the previous value, and finally, the new value

What typically happens with the default value (allow local write) is that the new value for a tag on a display is updated in the I/O device so quickly that the change appears to be atomic and there is no ‘flicker’. In situations where the I/O device is a master/slave arrangement and Citect is in communication with the master device, there is a possibility of the customer seeing 3 changes.

With WriteLocal=1, the local run table is updated and a Write request is sent to the driver for the I/O device. Drivers typically take some action to invalidate the driver cache after a write but regardless of the specifics of the driver, the next read to the master may be before the master has been able to update the slave. This is particularly noticeable on very slow networks such as GPRS or extremely slow serial links over modems. Citect is unaware of the status of the master/slave communication. If the next read is quicker than the update of the slave, depending on the operation of the master, the master may return the last known value, not the value the master is currently attempting to write to the slave. In that situation, the value displayed on the screen appears to revert back to the previous value.

Eventually, the master/slave communication completes and a later read cycle by the Citect driver will read the expected value and the value on the screen will be the value the user is expecting.

If the user finds the new/old/new sequence not to their liking, they can use WriteLocal=0 so that the write value is not used for display purposes. The value on the display will only be that read from the device. This way, the value will not change 3 times, but only once. For slow networks, the value will not change immediately, but some time after the master and slave have successfully communicated the new value.

 

Keywords:
 

Attachments