99
SECTION 5
Instruction Set
The C1000H and C2000H PC have large programming instruction sets that allow for easy programming of complicated
control processes. This section explains each instruction individually and provides the ladder diagram symbol, data areas,
and flags used with each.
The many instructions provided by the C1000H and C2000H are described in following subsections by instruction group.
These groups include Ladder Diagram Instructions, Bit Control Instructions, Timer and Counter Instructions, Data Shift-
ing Instructions, Data Movement Instructions, Data Comparison Instructions, Data Conversion Instructions, Binary Cal-
culation Instructions, BCD Calculation Instructions, Logic Instructions, Subroutines, Block Programming Instructions,
Special Instructions, Intellegent I/O Instructions, and SYSMAC NET Link/SYSMAC LINK System Instructions.
Some instructions, such as Timer and Counter instructions, are used to control execution of other instructions, e.g., a TIM
Completion Flag might be used to turn ON a bit when the time period set for the timer has expired. Although these other
instructions are often used to control output bits through the OUTPUT instruction, they can be used to control execution
of other instructions as well. The OUTPUT instructions used in examples in this manual can therefore generally be re-
placed by other instructions to modify the program for specific applications other than controlling output bits directly.
5-1
Notation
102
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-2
Instruction Format
102
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-3
Data Areas, Definer Values, and Flags
102
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-4
Differentiated Instructions
104
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-5
Coding Right-hand Instructions
104
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-6
Ladder Diagram Instructions
107
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-6-1
LOAD, LOAD NOT, AND, AND NOT, OR, and OR NOT
108
. . . . . . . . . . . . . . . . .
5-6-2
AND LOAD and OR LOAD
109
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-7
Bit Control Instructions
109
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-7-1
OUTPUT and OUTPUT NOT – OUT and OUT NOT
109
. . . . . . . . . . . . . . . . . . . . .
5-7-2
DIFFERENTIATE UP and DIFFERENTIATE DOWN –
DIFU(13) and DIFD(14)
110
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-7-3
KEEP – KEEP(11)
112
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-8
INTERLOCK and INTERLOCK CLEAR – IL(02) and ILC(03)
113
. . . . . . . . . . . . . . . . . . . .
5-9
JUMP and JUMP END – JMP(04) and JME(05)
115
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-10 END – END(01)
116
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-11 NO OPERATION – NOP(00)
116
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-12 Timer and Counter Instructions
117
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-12-1
TIMER – TIM
118
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-12-2
HIGH-SPEED TIMER – TIMH(15)
121
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-12-3
COUNTER – CNT
122
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-12-4
REVERSIBLE COUNTER – CNTR(12)
125
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-13 Data Shifting
127
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-13-1
SHIFT REGISTER – SFT(10)
127
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-13-2
REVERSIBLE SHIFT REGISTER – SFTR(84)
129
. . . . . . . . . . . . . . . . . . . . . . . . . .
5-13-3
ARITHMETIC SHIFT LEFT – ASL(25)
131
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-13-4
ARITHMETIC SHIFT RIGHT – ASR(26)
132
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-13-5
ROTATE LEFT – ROL(27)
132
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-13-6
ROTATE RIGHT – ROR(28)
133
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-13-7
ONE DIGIT SHIFT LEFT – SLD(74)
133
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-13-8
ONE DIGIT SHIFT RIGHT – SRD(75)
134
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-13-9
WORD SHIFT – WSFT(16)
134
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-14 Data Movement
135
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-14-1
MOVE – MOV(21)
135
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5-14-2
MOVE NOT – MVN(22)
136
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .