6 Programming
6-116
NJ-series CPU Unit Software User’s Manual (W501)
*1 If an instruction error occurs before execution of an instruction, the instruction will not be executed. There-
fore, the value of each output parameter before instruction execution will be retained.
*2 If an instruction error occurs after execution of an instruction, the instruction itself will be regarded as nor-
mally ended. Therefore, the values of output variables of the instruction will be assigned to the output
parameters. Values of the output parameter to which an error occurred are retained as the one before the
instruction execution.
System-defined variable P_PRGER
The system-defined variable P_PRGER is a flag that indicates the occurrence of an instruction error.
If an instruction error occurs, the value will change to TRUE regardless of when the error occurred.
When the instruction ends normally, the value will be retained.
For the details on P_PRGER, refer to Instruction Error Flag on page 6-118.
Events
When an instruction error occurs, an event is created for it. For details on events, refer to Events for
Instruction Errors on page 6-119.
A CPU Unit with unit version 1.02 is required to create events for instruction errors.
The following table shows the values of output parameters when an instruction, user-defined function,
or user-defined function block that is created in a ladder diagram ends normally or has an instruction
error.
ErrorID WORD Error code on Error end, and
WORD#16#0 on Normal end
WORD#16#0 Error code WORD#16#0
Output Parameters in Ladder Diagrams
Condition Type of output parameter Value of output parameter
Normal end Power flow output Values are updated according to the
internal algorithm.
BOOL parameter output
Parameter output other than BOOL
Instruction error Power flow output Set to FALSE.
BOOL parameter output The previous values are retained.
Parameter output other than BOOL
Output
variable
Data
type
Meaning
Value when an instruction error occurs
Before
instruction
execution
*1
During
instruction
execution
After
instruction
execution
*2