User`s manual
12-2 Motion Mate™ DSM314 for Series 90™-30 PLCs User's Manual
–
January 2001 GFK-1742A
12
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.
Examples:
2#1010 Binary constant
2#11111110_11101101_10111110_11101111 Binary constant with embedded underscores
A local logic program may have a maximum of 50
unique
constants whose value is greater than
2047 or less than –2048. If a local logic program declares more than 50 unique constants, the build
process generates an error. Most programs use much less than 50 constants, so this is generally not
a constraint.
Local Logic Variables
The local logic language supports a number of predefined variables that allow access to the DSM
I/O data, CTL bits, and other status and control information. A detailed description of the local
logic variable set is contained in chapter 13 Each variable has two attributes, size and direction.
Local Logic variables range in size from 1 Bit (Bit Operands) to 64 bits.
All Local Logic parameter registers are one of the following types.
•
Double integer
variables hold signed 32 bit values (–2147483648 to 2147483647). There are
256 Parameter registers (P000-P255).
•
Long integer
variables hold signed 64 bit values (+/-9.22 x 10
18
). The long integer variables
are unique in that they may only be used for the result of a multiply or as the numerator in a
divide or modulus operation. There are 8 long integer registers (D00-D07).
All Local Logic variables have one of the following directional attributes.
•
Read-only
variables may not be used as the destination of an assignment operation.
•
Write-only
variable may
only
be used as the destination of an assignment statement.
•
Read-write
variables may be used as a source or destination.
Refer to Chapter 13 for a list of all the Local Logic variable size and direction attributes.
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>;