Jump to content

Cicode

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Cander0000 (talk | contribs) at 02:13, 28 September 2007 (refined category). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Cicode is the programming language used by CitectSCADA software which contains a set of GUI which generate Cicode programs and has an intepreter for running the Cicode program.

The structure and syntax of Cicode is very similar to that of the Pascal programming language, the main difference being that it does not include pointers and associated concepts. Citect provides a rich programming API that includes sophisticated programming constructs such as concurrent tasks and semaphores.

Samples

The function is used to log information to a file.

FUNCTION I0_Trace(STRING sPrompt)

   INT    hDev;
   INT    hTime;
   STRING sText;

   IF hTraceOn THEN
      IF (StrLeft(sPrompt, StrLength(sMask)) = sMask) THEN
         TraceMsg(sPrompt);

         hTime = TimeCurrent();
         sText = TimeToStr(hTime, 2)+" "+TimeToStr(hTime, 1)+" "+sPrompt;

         SemWait(hDebugSem, 10);
         FileWriteLn(hDebugFile, sText);
         SemSignal(hDebugSem);
      END
   END
END