Applies To:
  • CitectSCADA 3.xx, 4.xx, 5.xx

Summary:
There are several reports writing into the same file. Some are scheduled and/or triggered reports. Some reports are run from a button using the Report() Cicode function. Occasionally the report file is found to be corrupt. What is the cause of this? 

Solution:
A probable cause is that the scheduled reports are being pre-empted by reports run from a button and the output is being mixed. The solution to this is to use a Cicode critical section to prevent more than one report writing to the file at the same time. To do this, place the report text within the critical section as follows:

{CICODE}
EnterCriticalSection("a_name");
{END}

report text

{CICODE}
LeaveCriticalSection("a_name");
{END}

Recompile the Citect project after making these changes. The string "a_name" is the name of the critical section and can be any name.

 

Keywords:
 

Attachments