5 Understanding Programming
Precautions
Instruction Usage Restrictions
Instructions That Must Be in the Same Task
The following instructions must be placed in the same task.
Mnemonic
JMP/JME
CJP/JME
CJPN/JME
JMP0/JME0
FOR/NEXT
IL/ILC
SBS/SBN/RET
MCRO/SBN/RET
BPRG/BEND
STEP/STEP
Instructions That Are Not Allowed in Interrupt Tasks
The following instructions cannot be placed in interrupt tasks. Any attempt to execute one of these
instructions in an interrupt task will cause the Error Flag (P_ER) to turn ON and the instruction will
not be executed. The following instructions can be used if an interrupt task is being used as an extra
cyclic task.
Mnemonic
TKON
TKOF
STEP
SNXT
STUP
DI
EI
SFCON, SFCOFF, SFCPR,
SFCPRN
• The operation of the following instructions is unpredictable in an interrupt task: HUNDRED-MS
TIMER: TIM and TIMX(550), TEN-MS TIMER: TIMH(015) and TIMHX(551), ONE-MS TIMER:
TMHH(540) and TMHHX(552), TENTH-MS TIMER: TIMU(541) and TIMUX(556), HUNDREDTH-
MS TIMER TIMUH(544) and TIMUHX(557), ACCUMULATIVE TIMER: TTIM(087) and
TTIMX(555), MULTIPLE OUTPUT TIMER: MTIM(543) and MTIMX(554), LONG TIMER:
TIML(542) and TIMLX(553), TIMER WAIT: TIMW(813) and TIMWX(816), HIGH-SPEED TIMER
WAIT: TMHW(815) and TMHWX(817), PID CONTROL: PID(190), and FAILURE POINT DETEC-
TION: FPD(269).
• In addition to the above, the following instruction cannot be used in the power OFF interrupt task.
The Error Flag (P_ER) will not turn ON if these instructions are used in the power OFF interrupt
task. The instruction will not be executed.
READ
DATA
FILE(TWRIT(704)), NETWORK SEND: SEND(090), NETWORK RECEIVE: RECV(098),
5-36
JUMP/JUMP END
CONDITIONAL JUMP/JUMP END
CONDITIONAL JUMP NOT/CONDITIONAL JUMP END
MULTIPLE JUMP/JUMP END
FOR/NEXT
INTERLOCK/INTERLOCK CLEAR
SUBROUTINE CALL/SUBROUTINE ENTRY/SUBROUTINE RETURN
(If the global subroutine instructions (GSBS(750), GSBN(751), and GRET(752))
are used, the subroutine can also be called from another task.)
MACRO/SUBROUTINE ENTRY/SUBROUTINE RETURN
BLOCK PROGRAM BEGIN/BLOCK PROGRAM END
STEP DEFINE
TASK ON
TASK OFF
STEP DEFINE
STEP NEXT
CHANGE SERIAL PORT SETUP
DISABLE INTERRUPT
ENABLE INTERRUPT
SFC Task Control Instructions
FILE:
FREAD(700),
WRITE
Instruction
Instruction
DATA
FILE:
FWRIT(701),
CJ2 CPU Unit Software User's Manual
WRITE
TEXT
Need help?
Do you have a question about the CJ2 CPU UNIT SOFTWARE and is the answer not in the manual?
Questions and answers
How do I retrieve fault codes from plc: CJ2M-CPU35