You are here: Core Reference > Coding > Logic > How Logic Programs Work

How Logic Programs Work

Each Logic program is configured to represent a calculation or a procedure. The Logic program uses values from the database (inputs) as part of the calculation or procedure. The result of the calculation or procedure is either written to the ClearSCADA database as a value or is used to execute a method such as a control.

Logic programs can be set to execute:

When a Logic program begins, it reads its input values (Tag Read). These values can be the values of items in the database or can be values specified in a query.

After reading its input values, the Logic program executes. The calculation or procedure that is defined in the configuration of the Logic program is executed. The input values are used as part of the calculation or procedure.

When the Logic program has executed, it has an output. The output is either:

or:

Logic programs are designed to have a similar architecture to PLC programs. The procedure for executing a Logic program is:

  1. Logic program reads its inputs
  2. Logic program executes
  3. Logic program writes its outputs

This sequence of events cannot be altered. The inputs are read first, and then the program executes, and then the outputs are written. Logic programs cannot use any other type of structure.

NOTE: Methods are sometimes referred to as 'actions'.


ClearSCADA 2015 R2