5 Understanding Programming
5-36
CJ2 CPU Unit Software User’s Manual
z Instruction Usage Restrictions
Instructions That Must Be in the Same Task
The following instructions must be placed in the same task.
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.
• 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: FREAD(700), WRITE DATA FILE: FWRIT(701), WRITE TEXT
FILE(TWRIT(704)), NETWORK SEND: SEND(090), NETWORK RECEIVE: RECV(098),
Precautions
Mnemonic Instruction
JMP/JME JUMP/JUMP END
CJP/JME CONDITIONAL JUMP/JUMP END
CJPN/JME CONDITIONAL JUMP NOT/CONDITIONAL JUMP END
JMP0/JME0 MULTIPLE JUMP/JUMP END
FOR/NEXT FOR/NEXT
IL/ILC INTERLOCK/INTERLOCK CLEAR
SBS/SBN/RET 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.)
MCRO/SBN/RET MACRO/SUBROUTINE ENTRY/SUBROUTINE RETURN
BPRG/BEND BLOCK PROGRAM BEGIN/BLOCK PROGRAM END
STEP/STEP STEP DEFINE
Mnemonic Instruction
TKON TASK ON
TKOF TASK OFF
STEP STEP DEFINE
SNXT STEP NEXT
STUP CHANGE SERIAL PORT SETUP
DI DISABLE INTERRUPT
EI ENABLE INTERRUPT
SFCON, SFCOFF, SFCPR,
SFCPRN
SFC Task Control Instructions