User`s manual

Local Logic Variables
GFK-1742A Chapter 13 Local Logic Variables 13-3
13
3) Its cleared when the user toggles the error clear Q bit.
System_Halt variable
The
System_Halt
variable is a
Write-Only
Bit Operand (refer to Table 13-5). If the Local Logic
program writes a 1 to the
System_Halt
variable servo motion and Local Logic execution is halted.
An error code is also reported in the Module Status Code ( refer to Chapter 12). Thus the
System_Halt
variable can be used to trap for fatal error conditions and perform error recovery. The
sample code below shows a possible scenario in which the
System_Halt
variable might be used:
IF Overflow THEN (* Trap for an overflow *)
System_Halt
:= TRUE; (* Halt Local Logic Execution and Servo Motion *)
END_IF;
Double Precision 64 Bit Registers
Local Logic provides 8 64-bit registers (D00-D07) in addition to the 255 32-bit registers (refer to
Table 13-5). This is to allow the user to store the result of multiplying two 32-bit numbers in a Dxx
register and then perform a Divide/Modulus operation on the result. Thus the 64 bit registers may
be used under the following circumstances:
1) As the Destination register for a multiply operation.
2) As the Dividend (numerator) in a Divide/Modulus operation.
The Parser will flag an error if it is used in other operations. Example code for the use of the Dxx
registers is shown below:
D01 := P001 * 2147483647; (* Perform a Multiply operation and store in a 64 bit register *)
P010 := D01 / 12500; (* Divide the result and store in a 32 bit register *)
Note that the above scenario may result in a
Divide Overflow,
if the result does not fit in a 32-bit
register. A Divide Overflow will halt Local Logic execution and servo motion, since the result of
the operation is undefined (refer to Chapter 12). An error code will also be reported in the Module
Status Code.
Note
The contents of the 64-bit data registers (D00-D07) and 32-bit writeable data registers (P000-P255)
are not automatically initialized by Local Logic when it starts running. The user should initialize
any required variables using a separate Local Logic program or the
First_Local_Logic_Sweep
variable or PLC ladder.