Applies To:
  • CitectSCADA 1.00, 1.01, 1.10, 1.11, 2.00

If a PLC variable is out of range under some conditions, Citect may not be able to write to it. Whenever Citect tries to write to a PLC variable, it checks that the write is in the correct range (as specified in the Variables database). However a bug in the Cicode engine would mean that any range error before a write would stop the PLC write. For example:

Temp = PLC_VAR;
PLC_VAR = 50; ! valid PLC write

If the PLC_VAR is currently out of range, when Cicode moves it into the Temp variable it will be scaled. As the variable is out of range it will generate a hardware error 'Value is out of range'. When the Cicode tries to write 50 to the PLC_VAR, it will see that there is a range error pending and will not write to the variable. 

This problem has been fixed in Version 1.2 and 2.01. You may also work around the problem by using the function CodeSetMode(). If you call the function CodeSetMode(1, 0) Citect will write to the PLC variables and ignore any range errors. You only need call this function once as it effect is global to the system.