User`s manual
13-2 Motion Mate™ DSM314 for Series 90™-30 PLCs User's Manual
–
January 2001 GFK-1742A
13
as the destination variable in a non-Boolean Math operation (only the least significant bit of the
result would be stored).
Note
: The AQ command variables (Torque Limit, Velocity Loop Gain, Follower Ratio, Position
Increment and Position Loop Time Constant) may have an allowed range that is smaller than the
Local Logic variable size. The module reports a warning error code and rejects any invalid values if
the program attempts to write a value outside the valid range of an AQ command. Refer to Chapter
4 for a description of the allowed %AQ command ranges.
Variable Sign
Local Logic variables that are less than 32 bits long are either
Signed
or
Unsigned
(except Bit
Operands, which are always Unsigned). All Math/Logic operations in the Logic Engine are signed
32 bit operations (except the 64 bit signed Divide and Modulus operations). Signed variables that
are less than 32 bits long are automatically sign extended to 32 bits when they are loaded by the
Logic Engine. Unsigned variables are not sign extended. Thus the Logic Engine handles all data
conversion and limit checking automatically.
Local Logic System Variables
The
First_Local_Logic_Sweep
,
Overflow
and
System_Halt
variables are used exclusively in the
Logic engine and are described below.
First_Local_Logic_Sweep variable
The
First_Local_Logic_Sweep
variable is a
Read-Only
Bit Operand (refer to Table 13-5). It is set
by the Logic Engine during the first execution sweep when Local Logic is enabled and the PLC is
in RUN mode. It is reset to zero for subsequent sweeps. Thus it can be used in the Local Logic
program to initialize some variables. For example, the code below initializes some parameter
registers and Control variables in the first sweep using the
First_Local_Logic_Sweep
variable.
IF
First_Local_Logic_Sweep
THEN (* If it’s the First execution sweep then *)
P001 := 0; (* Initialize P001 to 0 *)
P015 := 1000; (* Initialize P015 to 1000 *)
Velocity_Loop_Gain_1 := 20; (* Set the Velocity Loop Gain for Axis 1 to 20 *)
END_IF;
Overflow variable
The
Overflow
variable is a
Read-Write
Bit Operand (refer to Table 13-5). It is set by the Logic
Engine when an Addition, Subtraction or Absolute value (ABS) overflow occurs. A warning error
code is also reported in the Module Status Code if the Overflow flag is set and an overflow error
occurs (refer to Chapter 12). Note that the user can prevent Add/Subtract/ABS overflow warnings
from being reported by setting the
Overflow
variable to zero at the end of the Local Logic program.
Similarly the user can test for Overflow errors within the Local Logic program by reading the
Overflow
variable and performing some appropriate action. The
Overflow
variable is cleared under
the following circumstances:
1) It’s automatically cleared when Local Logic starts running, before the first execution sweep.
2) It can be cleared by the user in the Local Logic program (by setting
Overflow := 0;
).