Micromod Micro-DCI: 53MC5000 Multi-Loop Process Controller CUSTOMIZATION GUIDE User Manual

Page 22

Advertising
background image

The stack memory will operate as follows:

“C02”

1) Places the value of C02 in stack memory (level 1).

“Z”

2) Removes the value on the top of the stack and compares it
with zero (00.00). If the data value (C02) is exactly zero the
statement is true. This results in a data transform to a logical
“1” which is returned to the stack (level 1). Conversely, if the
statement is false (data value not exactly zero), then the
“Zero Check” will transform to a logical “0” which is placed in
stack memory (level 1).
“Zero Check” will result in a transform to a logical “0” which
is placed in stack memory (level 1).

“?”

3) The interrogation comment is ignored by the computer and
can be omitted when writing program statements in F-TRAN.

“S03”

4) Removes the logic bit on the top of the stack and if it is a
“logical 1” (true), skips 3 statements. If the statement is logical
“0” (false), it proceeds to the next statement.

2.4.5.3 Conditional Statements

The flow of the program can be made to follow one of two paths by employing a decision state-
ment. As shown in Figure 5, the decision block is indicated by using a diamond in the flowchart.
Logically, a skip instruction is useful when comparing two floating point expressions (i.e., two
totals; a byte and a literal; etc.).

Logical expressions can also be used to: set a discrete logic bit to a particular state; to cause “n”
program statements to be skipped when a particular condition occurs; etc.

Conditional statements are instructions to the computer which, depending on the condition of one
or more numerical expressions of logic states, cause the more proper one of two actions to be se-
lected. Therefore, the statement commands a conditional transfer (skip) of program sequence as
dictated by the status of a switch contact or the result of some mathematical operation. The result-
ing logic state determines whether or not the conditional statement will cause a skip to another in-
struction. For example:

Logical Decision , < L expression> Sxx

L24 ? S02

If L24 is logic level “1”, skip the next two program statements. If the status of L24 is logical “0”, exe-
cute the next instruction.

Comparisons , <expression> <expression> Sxx

“B”, “C”, or “H” type expressions can be used in conditional statements, e.g.,
(expression) > (expression). The implied comparison will result in a data transform to a logic bit. If
the resulting logical is a level “1” (true statement), the skip instruction will be executed.

C00>C01 ? S06

MODULAR CONTROLLER CUSTOMIZATION GUIDE

2-15

Advertising