
User Manual
Chapter 12
GFK-1742F
Jan 2020
Local Logic Language Syntax
288
12.1.3
Local Logic Statements
The Local Logic language supports two kinds of statements: Assignment and Conditional. A
Local Logic program supports 150 statements. The Local Logic check block will generate an
error message when the 150 line limit is exceeded. Warnings are issued when the Local Logic
program exceeds 100 lines. The warning message can be turned off with the #pragma
directive. Reference the #pragma sections for additional details. Semicolons separate
program statements.
Local Logic Assignment Statements
Assignment statements permit simple arithmetic and bitwise operations to be performed
with the result being assigned to a variable. An assignment statement has the following
format.
<destination> := <expression>;
The <destination> operator may consist of any read-write or write-only variable. The
<expression> may be a simple constant or variable, a mathematical or bitwise logical
operation on two operands, an ABS function, or a bitwise NOT operation. Write-only
variables can not be the expression for an assignment operation.
Examples:
P032 := Strobe1_Posi 5000;
This construct is okay.
P001 := ABS(Analog_Input1_1);
This construct is okay.
Reset_Strobe1_1 := BWNOT Strobe1_Flag_1;
This construct is okay.
P040 := 2#11111010_1011000;
This construct is okay.
P011 := 3 * Strobe1_Posi 20;
This construct is ILLEGAL
–
too
many operations.
If complex operations are required, perform the operation using a series of steps that use
parameter registers to store intermediate results.
Examples:
To set Velocity_Loop_Gain_2 equal to (1+75000/Actual_Velocity_2), the programmer uses
a series of statements similar to the following...
P012 := 75000 / Actual_Velocity_2;
Velocity_Loop_Gain_2 := 1 + P012;
The build process will issue a warning if a Boolean variable is used as the destination for an
expression containing non-Boolean variables or a constant whose value is not zero or one. A
warning is generated because the DSM will assign the Boolean variable the value of the least
significant bit of the expression.