
User Manual
Chapter 12
GFK-1742F
Jan 2020
Local Logic Language Syntax
286
Chapter 12:
Local Logic Language Syntax
This chapter describes the Local Logic programming language syntax, rules, and language
elements. The language uses free-format text-based constructs derived from the IEC 1131
structured text standard. The sections that follow describe the available commands and the
command syntax.
12.1
Syntactic Elements
The local logic language syntax is described in the following sections. The syntax is easy to
learn and provides a rich feature set that allows the user to accomplish the programming
task. Chapter 11 contains many examples that will further aid the reader in understanding
the syntax and its application. The first-time user may also wish to consult the section on
“Building Your First Local Logic Program” program contained in chapter 10
and the sample
programs in the Chapter 11 tutorial as additional aids.
12.1.1
Numeric Constants
The local logic programming language supports decimal, hexadecimal, and binary
constants. The DSM treats all constants as 32-bit signed twos-complement integer values.
Single underline characters (i.e. 16#7fff_ffff) may be inserted between digits to improve the
readability of large numbers.
Decimal constants must be in the range of
–
2147483648 to 2147483647. Only integer
values are supported, therefore constants do not have a decimal point. Thus, as in all
integer-based systems the decimal points are implied and the programmer must keep track
of them if fractional math is needed.
Examples:
523
Positive decimal constant
-1048
Negative decimal constant
1_745_245
Positive decimal constant with embedded underscores
Hexadecimal (base 16) constants are identified by a 16# prefix and must have a value that
can be represented in 32-bits (8 hexadecimal digits). Hexadecimal constants cannot have a
sign (+/-) prefix. Hexadecimal digits A-F are not case sensitive, upper or lower case may be
used.
Examples:
16#FFFF
Hexadecimal constant
16#7fff_ffff
Hexadecimal constant with embedded underscores
Binary (base 2) constants are identified by a 2# prefix and must have a value that can be
represented in 32-bits (32 binary digits). Binary constants cannot have a sign (+/-) prefix.