Applies To:
  • CitectSCADA V6.xx, V7.00, V7.10

Summary:
I have upgraded a project to CitectSCADA version 7 and noticed that the Task cicode functions were not working as I expected.
I have a Task where a tag is incremented, however, the previous value is always used.  TaskNew() is being used with just mode 8 so that only one instance is run at a time.

Solution:
In earlier versions TaskNew() with Mode 4 (to first request all I/O data) or a ReRead() should have been used to ensure the latest values are used.
Without Mode 4 there is always a chance that a value existed in cache and therefore you may not have had the very latest data.

In versions 7.00 and 7.10 you should ensure that you use TaskNew() with mode 4 unless you have a reason to deliberately not use the latest updated values.

In v7.10, You could set new [Code]HaltOnInvalidTagData=1 parameter to halt any cicode that manages to access invalid, uninitialised values (and get a hardware alarm). 
This will help identify places where you need to add mode 4 to Tasks.

Keywords:
 

Attachments