Cicode Programming Reference > Performing Advanced Tasks > How Cicode is Executed

How Cicode is Executed

Your multi-tasking operating system gives CitectSCADA access to the CPU through threads. However, this access time is not continuous, as CitectSCADA needs to share the CPU with other applications and services.

Note: Be careful when running other applications at the same time as CitectSCADA. Some applications place high demands on the CPU and reduce the execution speed of CitectSCADA.

The CitectSCADA process has many operations to perform, including I/O processing, alarm processing, display management, and Cicode execution - operations that are performed continuously. And, because CitectSCADA is a real-time system, it needs to perform the necessary tasks within a minimum time - at the expense of others. For this reason, CitectSCADA is designed to be multitasking, so it can efficiently manage it's own tasks.

CitectSCADA performs its tasks in a specific order in a continuous loop (cycle). CitectSCADA's internal tasks are scheduled at a higher priority than that of Cicode and have access to the CPU before the Cicode. For example, the Alarms, Trends, and I/O Server tasks all get the CPU before any of your Cicode tasks. The reports are scheduled at the same priority as your Cicode. CitectSCADA background spoolers and other idle tasks are lower priority than your Cicode.

For Cicode, which consists of many tasks, CitectSCADA uses round-robin single priority scheduling. With this type of scheduling each task has the same priority. When two or more Cicode tasks exist, they each get a CPU turn in sequence. This is a simple method of CPU scheduling.

Note: If a Cicode task takes longer than its designated CPU time to execute, it is preempted until the next cycle - continuing from where it left off.

See Also

Performing Advanced Tasks