
4-37
4 Using Protocol Macros
CJ-series Serial Communications Units Operation Manual for NJ-series CPU Unit(W494)
4-2 De
vic
e
V
ariab
les
fo
r CJ
-series Un
it and
Sys
tem-defined
V
ariables
(Pr
o
toco
l Macr
o Mo
de)
4
4-2-6 Protoco
l Status
Sequence
Wait Flag
*_P1_PmrSeqWaitSt
a
*_P2_PmrSeqWaitSt
a
This flag is changed to TRUE when a
sequence is waiting due to the Wait command.
Waiting is released when the Wait Release
Switch is changed from FALSE to TRUE in the
user program, and the sequence will move to
the next step.
Note
Make sure to set the Wait Release
Switch from FALSE to TRUE from the
user program.
Controller
reset (*)
When
Wait com-
mand is
executing
When
Wait
Release
Switch is
ON, and
when
sequence
starts
Serial Gate-
way Prohib-
ited Flag
(Protocol
Macros)
*_P1_PmrSgwProhS
ta
*_P2_PmrSgwProhS
ta
This flag is changed to TRUE when the Serial
Gateway (Mode) is prohibited due to the status
of the Serial Gateway Prohibit Switch in the
user program. This flag is changed to FALSE
when the Serial Gateway is not prohibited.
When
instruc-
tion is
executing
When
instruc-
tion exe-
cution is
completed
Protocol
Macro Error
Code
Bits 00 to 03 of
*_P1_PmrSta and
*_P2 _PmrSta
The contents of the error codes are shown in
the following table.
No codes other than the above are used.
When an error occurs, the error code is held
until the next sequence starts.
The error code is cleared when the Unit is
restarted, or when the next sequence execu-
tion starts.
At error
When
sequence
starts
Communi-
cations
Sequence
No.
*_P1_PmrCommSeq
NoSta
*_P2_PmrCommSeq
NoSta
The current communications sequence num-
ber is set when the sequence execution starts.
The number is set even when a sequence
number error (Error Code: 2) occurs.
When
sequence
starts
None
Executed
Step No.
(Code)
*_P1_PmrStepNoCo
deSta
*_P2_PmrStepNoCo
deSta
Step numbers 0 to 15 (0 to F hex) for which
execution is complete are stored.
When
step is
executed
When
sequence
starts
Name
Device variable for
CJ-series Unit
Meaning
Timing
Initialize
Set
Reset
Code
Error contents
Protocol
macro
execution
0
No error
Executed
2
Sequence No. Error
The sequence number specified
by the ExecPMCR instruction
does not exist in the Unit.
Not exe-
cuted
3
Data Read/Write Area Exceeded
Error
When data is written or read to
the CPU Unit, the specified area
range was exceeded.
Execution
stops after
the error
occurs
4
Protocol Data Syntax Error
A code that cannot be executed
occurs while the protocol macro
was executed. (Example: A
header comes after a terminator.)