Omron NJ-series User Manual page 305

Machine automation controller cpu unit software
Hide thumbs Also See for NJ-series:
Table of Contents

Advertisement

6 Programming
Syntax
Control con-
structs
Instruction Error Flag
When an instruction error occurs in a ladder algorithm or when a syntax/function error occurs in an ST
algorithm, the P_PRGER (Instruction Error Flag) system-defined variable changes to TRUE. The
P_PRGER flag is a local variable for the program. This flag changes to TRUE when an instruction error
occurs in the program, and remains TRUE during the next task period.
Variable
name
P_PRGER
Instruction Error Flag
The user can write the P_PRGER Flag. You can temporarily set the value of this flag to FALSE through
a user operation to determine if the error occurs within a specific range, for example. After this flag
changes to TRUE, it remains TRUE until the operating mode is changed or the flag is overwritten by a
program.
Example:
User Program
Initial process
Normal process #1
Normal process #2
The P_PRGER Flag also changes to TRUE when an instruction error occurs inside a user-defined
function block that is used by the program.
Example:
Program
P_PRGER : OFF
User-defined
function block
P_PRGER : ON
6-118
Error location
IF condition
No statements between IF and END_IF are executed.
expression
CASE condition
No statements between CASE and END_CASE are executed.
expression
FOR condition
No statements between FOR and END_FOR are executed.
expression
WHILE condition
No statements between WHILE and END_WHILE are executed.
expression
REPEAT condi-
No statements between REPEAT and END_REPEAT are executed.
tion expression
Meaning
Function
This flag changes to and
remains TRUE when an
instruction error occurs. After
this flag changes to TRUE, it
stays TRUE until the program
changes it back to FALSE.
Algorithm (instructions)
P_PRGER
Inside function block definition
P_PRGER : OFF
Instruction error
P_PRGER : ON
Operation
Data
Range of values
type
BOOL
TRUE or FALSE
P_PRGER
R
If the flag is ON, you
know that the
instruction error has
to be inside this
range.
Error processing
for normal
Example: Initial values
process #1
set for variables
NJ-series CPU Unit Software User's Manual (W501)
Read
Initial value
/writ
e
FALSE
Read
/write

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents