The text of a manual · part 16 of 18
SYSMAC Programmable Controllers C200H (CPU01-E/03-E/11-E) Installation Guide, pages 144 to 153
Pages 144 to 153 of 173
The original document is the PDF (1.3 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Omron C200H-CPU01-E
Page 144
Appendix E
Programming Instructions Name Mnemonic
Symbol
LOGICAL OR (@)ORW(35)
Function
ORW(35) I1 I2 R
EXCLUSIVE OR (@)XORW(36)
XORW(36) I1 I2 R
EXCLUSIVE NOR (@)XNRW(37)
XNRW(37) I1 I2 R
INCREMENT (@)INC(38)
Operand Data Areas
Logically ORs two 16-bit input words (I1 and I2) and sets the bits in the result word (R) when one or both of the corresponding bits in the input words is/are ON.
I1/I2: IR SR HR AR LR TC DM #
R: IR HR AR LR DM
Exclusively ORs two 16-bit input words (I1 and I2) and sets the bits in the result word (R) when the corresponding bits in input words differ in status.
I1/I2: IR SR HR AR LR TC DM #
R: IR HR AR LR DM
Exclusively NORs two 16-bit input words (I1 and I2) and sets the bits in the result word (R) when the corresponding bits in both input words have the same status.
I1/I2: IR SR HR AR LR TC DM #
R: IR HR AR LR DM
Increments the value of a 4-digit BCD word Wd: (Wd) by one, without affecting carry (CY). IR HR AR LR DM
INC(38) Wd
DECREMENT (@)DEC(39)
Decrements the value of a 4-digit BCD Wd: IR word by 1, without affecting carry (CY). HR AR LR DM
DEC(39) Wd
SET CARRY (@)STC(40)
Sets the Carry Flag (i.e., turns CY ON).
None
STC(40)
CLEAR CARRY (@)CLC(41)
Clears the Carry Flag (i.e, turns CY OFF). None
CLC(41)
Data Areas These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers. IR 00000 to 23515
130
SR
HR
TR
AR
LR
TC
DM
#
23600 to 25507
HR 0000 to 9915
TR 0 to 7
AR 0000 to 2715
LR 0000 to 6315
TC 000 to 511
Read/Wr: DM 0000 to DM 0999 Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
Page 145
Appendix E
Programming Instructions Name Mnemonic
Symbol
Function
DISPLAY MESSAGE (@)MSG(46)
Operand Data Areas
Displays eight words of ASCII code, starting from FM, on the Programming Console or GPC. All eight words must be in the same data area.
MSG(46) FM
FM
FM+ 7
A
B
C
D
D
P
FM: IR HR AR LR TC DM #
ABCD........DP
LONG MESSAGE (@)LMSG(47) (CPU11)
LMSG(47) S D –––
TERMINAL MODE (@)TERM(48) (CPU11)
TERM(48) ––– ––– –––
SET SYSTEM (@)SYS(49) (CPU11)
SYS(49) P ––– –––
Outputs a 32-character message to either a Programming Console, or a device connected via the RS-232C interface. The output message must be in ASCII beginning at address S. The destination of the message is designated in D: 000 specifies that the message is to be output to the GPC; 001 specifies the RS-232C interface, starting with the leftmost byte; and 002 specifies the RS-232C interface, starting from the rightmost byte. When the execution condition is ON, the Programming Console operation mode is changed to TERMINAL mode. There is no program command available to change the mode back to CONSOLE mode. Pressing the CHNG key on the Programming Console manually toggles between the two modes.
S: IR HR AR LR TC DM
Used to either control certain operating parameters, or to execute the system commands that can be executed from the AR area. The contents of the leftmost 8 bits (i.e., bits 08 to 15) of P determine which function SYS(49) will have. If they contain A3, then bit 00 specifies whether the battery will be checked, and bit 07 specifies whether I/O status will be maintained on start up. Bit 06 specifies whether the Force Status Hold Bit is set. To be effective SYS(49) must be programmed at address 00001 with LD AR 1001 at address 00000.
P: #
D: –––: #000 Not #001 used. #002
None
–––: Not used.
Data Areas These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers. IR 00000 to 23515
SR
HR
TR
AR
LR
TC
DM
#
23600 to 25507
HR 0000 to 9915
TR 0 to 7
AR 0000 to 2715
LR 0000 to 6315
TC 000 to 511
Read/Wr: DM 0000 to DM 0999 Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
131
Page 146
Appendix E
Programming Instructions Name Mnemonic
Symbol
Function
BINARY ADD (@)ADB(50)
Operand Data Areas
Adds the 4-digit augend (Au), 4-digit ad- Au/Ad: R: IR dend (Ad), and content of CY and outputs IR HR the result to the specified result word (R). SR HR AR AR LR Au LR DM TC + Ad DM #
ADB(50) Au Ad R
+
CY
R CY
BINARY SUBTRACT (@)SBB(51)
Subtracts the 4-digit hexadecimal subtrahend (Su) and content of carry, from the 4-digit hexadecimal minuend (Mi), and outputs the result to the specified result word (R).
SBB(51) Mi Su R
Mi
–
Su
–
CY
Mi/Su: IR SR HR AR LR TC DM #
R: IR HR AR LR DM
Md/Mr: IR SR HR AR LR TC DM #
R: IR HR AR LR DM
Dd/Dr: IR SR HR AR LR TC DM #
R: IR HR AR LR
R CY
BINARY MULTIPLY (@)MLB(52)
Multiplies the 4-digit hexadecimal multiplicand (Md) and 4-digit multiplier (Mr), and outputs the 8-digit hexadecimal result to the specified result words (R and R+1). R and R+1 must be in the same data area.
MLB(52) Md Mr R
Md
X
Mr
Quotient
R
Remainder R+1
BINARY DIVIDE (@)DVB(53)
Divides the 4-digit hexadecimal dividend (Dd) by the 4-digit divisor (Dr), and outputs result to the designated result words ( R and R + 1). R and R + 1 must be in the same data area.
DVB(53) Dd Dr R
÷
Dd Dr
Quotient
R
Remainder
R+1
Data Areas These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers. IR 00000 to 23515
132
SR
HR
TR
AR
LR
TC
DM
#
23600 to 25507
HR 0000 to 9915
TR 0 to 7
AR 0000 to 2715
LR 0000 to 6315
TC 000 to 511
Read/Wr: DM 0000 to DM 0999 Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
Page 147
Appendix E
Programming Instructions Name Mnemonic
Symbol
DOUBLE BCD ADD (@)ADDL(54)
Function Adds two 8-digit values (2 words each) and the content of CY, and outputs the result to the specified result words. All words for any one operand must be in the same data area.
ADDL(54) Au Ad R
+
Au + 1
Au
Ad + 1
Ad
CY
R+1
–
Mi + 1
Mi
Su + 1
Su
CY
R+1
X R+3
R: IR HR AR LR DM
Md/Mr: IR SR HR AR LR TC DM
R: IR HR AR LR DM
R
Multiplies the 8-digit BCD multiplicand and 8-digit BCD multiplier, and outputs the result to the specified result words. All words for any one operand must be in the same data area.
MULL(56) Md Mr R
Mi/Su: IR SR HR AR LR TC DM
CY
–
DOUBLE BCD MULTIPLY (@)MULL(56)
R: IR HR AR LR DM
R
Subtracts both the 8-digit BCD subtrahend and the content of CY from an 8-digit BCD minuend, and outputs the result to the specified result words. All words for any one operand must be in the same data area.
SUBL(55) Mi Su R
Au/Ad: IR SR HR AR LR TC DM
CY
+
DOUBLE BCD SUBTRACT (@)SUBL(55)
Operand Data Areas
Md + 1
Md
Mr + 1
Md
R+2
R+1
R
Data Areas These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers. IR 00000 to 23515
SR
HR
TR
AR
LR
TC
DM
#
23600 to 25507
HR 0000 to 9915
TR 0 to 7
AR 0000 to 2715
LR 0000 to 6315
TC 000 to 511
Read/Wr: DM 0000 to DM 0999 Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
133
Page 148
Appendix E
Programming Instructions Name Mnemonic
Symbol
DOUBLE BCD DIVIDE (@)DIVL(57)
Function Divides the 8-digit BCD dividend by an 8-digit BCD divisor, and outputs the result to the specified result words. All words for any one operand must be in the same data area.
DIVL(57) Dd Dr R
DOUBLE BCD-TO-DOUBLE BINARY (@)BINL(58)
Dd
÷
Dr + 1
Dr
Quotient
R+1
R
Remainder
R+3
R+2
S
R
S+1
R+1
Converts the binary value of the two source words (S: starting word) into eight digits of BCD data, and outputs the converted data to the two result words (R: starting result word). Both words for any one operand must be in the same data area.
BCDL(59) S R
DOUBLE COMPARE CMPL(60) (CPU11)
Dd + 1
Converts the BCD value of the two source words (S: starting word) into binary and outputs the converted data to the two result words (R: starting word). All words for any one operand must be in the same data area.
BINL(58) S R
DOUBLE BINARY-TO-DOUBLE BCD (@)BCDL(59)
Operand Data Areas
S
R
S+1
R+1
Compares the 8-digit hexadecimal values in words S1+1 and S1 with the values in S2+1 and S2, and indicates the result using the Greater Than, Less Than, and Equal Flags in the AR area. S1+1 and S2+1 are regarded as the most significant data in each pair of words.
CMPL(60) S1 S2
Dd/Dr: IR SR HR AR LR TC DM
R: IR HR AR LR DM
S: IR SR HR AR LR TC DM
R: IR HR AR LR DM
S: IR SR HR AR LR DM
R: IR HR AR LR DM
S1,S2: IR SR HR AR LR TC DM
Data Areas These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers. IR 00000 to 23515
134
SR
HR
TR
AR
LR
TC
DM
#
23600 to 25507
HR 0000 to 9915
TR 0 to 7
AR 0000 to 2715
LR 0000 to 6315
TC 000 to 511
Read/Wr: DM 0000 to DM 0999 Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
Page 149
Appendix E
Programming Instructions Name Mnemonic
Symbol
COLUMN-TO-WORD (@)CTW(63) (CPU11)
Function Fetches data from the same numbered bit (C) in 16 consecutive words (where S is the address of the first source word), and creates a 4-digit word by consecutively placing the data in the bits of the destination word, D. The bit from word S is placed into bit 00 of D, the bit from word S+1 is placed into bit 01, etc.
CTW(63) S C D
WORD-TO-COLUMN (@)WTC(64) (CPU11)
SECONDS-TO-HOURS (@)STH(66) (CPU11)
Bit C
D
S
0
0
00
S+1
1
1
01
S+15
0
0
15
Places bit data from the source word (S), consecutively into the same numbered bits of the 16 consecutive destination words (where D is the address of the first destination word). Bit 00 from word S is placed into bit C of word D, bit 01 from word S is placed into bit C of word D+1, etc.
WTC(64) S D C
HOURS-TO-SECONDS (@)HTS(65) (CPU11)
Operand Data Areas
S
Bit C
00
1
1
D
01
1
1
D+1
15
0
0
D+15
HTS(65) S R –––
Converts a time given in hours/minutes/ seconds (S and S+1) to an equivalent time in seconds only (R and R+1). S and S+1 must be BCD and within one data area. R and R+1 must also be within one data area.
STH(66) S R –––
Converts a time given in seconds (S and S+1) to an equivalent time in hours/minutes/seconds (R and R+1). S and S+1 must be BCD between 0 and 35,999,999, and within the same data area. R and R+1 must also be within one data area.
S: IR SR HR AR LR TC DM
C: IR SR HR AR LR TC DM #
D: IR SR HR AR LR TC DM
S: IR SR HR AR LR TC DM
D: IR SR HR AR LR TC DM
C: IR SR HR AR LR TC DM #
S: IR SR HR AR LR TC DM S: IR SR HR AR LR TC DM
R: IR SR HR AR LR TC DM R: IR SR HR AR LR TC DM
–––: Not used.
–––: Not used.
Data Areas These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers. IR 00000 to 23515
SR
HR
TR
AR
LR
TC
DM
#
23600 to 25507
HR 0000 to 9915
TR 0 to 7
AR 0000 to 2715
LR 0000 to 6315
TC 000 to 511
Read/Wr: DM 0000 to DM 0999 Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
135
Page 150
Appendix E
Programming Instructions Name Mnemonic
Symbol
BIT COUNTER (@)BCNT(67)
Function
Operand Data Areas
Counts the number of ON bits in one or more words (SB is the beginning source word) and outputs the result to the specified result word (R). N gives the number of words to be counted. All words in which bit are to be counted must be in the same data area.
BCNT(67) N SB R
BLOCK COMPARE (@)BCMP(68)
Compares a 1-word binary value (S) with the 16 ranges given in the comparison table (CB is the starting word of the comparison block). If the value falls within any of the ranges, the corresponding bits in the result word (R) will be set. The comparison block must be within one data area.
BCMP(68) S CB R
Lower limit Upper limit CB CB+1 1 CB+2 CB+3 0 1 CB+4 CB+5 S CB+30 CB+31
N: IR SR HR AR LR TC DM S: IR SR HR AR LR TC DM #
R: IR HR AR LR TC DM
SB: IR SR HR AR LR TC DM R: IR HR AR LR TC DM
CB: IR SR HR LR TC DM
Result
0
Lower limit ≤ S ≤ Upper limit
1
Data Areas These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers. IR 00000 to 23515
136
SR
HR
TR
AR
LR
TC
DM
#
23600 to 25507
HR 0000 to 9915
TR 0 to 7
AR 0000 to 2715
LR 0000 to 6315
TC 000 to 511
Read/Wr: DM 0000 to DM 0999 Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
Page 151
Appendix E
Programming Instructions Name Mnemonic
Symbol
VALUE CALCULATE (@)VCAL(69) (CPU11)
Function
Operand Data Areas
Calculates the cosine, or sine of the given degree value, or determines the y-coordinate of the given x value in a previously established line graph. For the sine and cosine conversions, S is entered in BCD as an angle (in the range 0.0 to 90.0 degrees). When calculating the y-coordinate in a graph, S gives the address of the value of the x-coordinate. The calculated data is transferred to the destination word (D). Sine and cosine results are given in BCD. Line graph coordinate calculations (interpolation) can be in BCD or BIN. The data in the control word (C) determines which operation is performed. If C is entered as a constant with a value of 0000 or 0001, the sine or cosine, respectively, of the source data value is calculated. If C is entered as a word designation, it gives the address of the first word of the data table for the line graph. The value of the first two digits gives m–1, where m is the number of data points for which coordinates are given on the line graph. Bits 14 and 15, respectively, specify the output and input data formats (0 indicates BCD, 1 indicates binary).
VCAL(69) C S D
C: IR SR HR AR LR TC DM #
S: IR SR HR AR LR TC DM
D: IR SR HR AR LR TC DM
Y Ym Y4 Y3 Y1 Y2 Y0 X1
Input data format
15
Xm
X2 X3 X4
Output data format
X m–1, where m is the number of data points whose coordinates are specified in the table
14
08 07
00
000000
C C+1
Xm (max. x-coordinate for this table)
C+2
Y0
C+3
X1
C+4
Y1
C+5
X2
C+6
Y2
C+(2m+1)
Xm
C+(2m+2)
Ym
Data Areas These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers. IR 00000 to 23515
SR
HR
TR
AR
LR
TC
DM
#
23600 to 25507
HR 0000 to 9915
TR 0 to 7
AR 0000 to 2715
LR 0000 to 6315
TC 000 to 511
Read/Wr: DM 0000 to DM 0999 Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
137
Page 152
Appendix E
Programming Instructions Name Mnemonic
Symbol
BLOCK TRANSFER (@)XFER(70)
Function Moves the content of several consecutive source words (S gives the address of the starting source word) to consecutive destination words (D is the starting destination word). All source words must be in the same data area, as must all destination words. Transfers can be within one data area or between two data areas, but the source and destination words must not overlap.
XFER(70) N S D
BLOCK SET (@)BSET(71)
Operand Data Areas
S
D
S+1
D+1
S+N–1
D+N–1
St
S
S: IR HR AR LR TC DM
St/E: IR HR AR LR TC DM
S: IR SR HR AR LR TC DM #
Sq: IR SR HR AR LR TC DM
R: IR HR AR LR DM
D: IR SR HR AR LR TC DM #
No. of Words
Copies the content of one word or constant (S) to several consecutive words (from the starting word, St, through to the ending word, E). St and E must be in the same data area.
BSET(71) S St E
N: IR SR HR AR LR TC DM #
E
SQUARE ROOT (@)ROOT(72)
Computes the square root of an 8-digit BCD value (Sq and Sq + 1) and outputs the truncated 4-digit, integer result to the specified result word (R). Sq and Sq + 1 must be in the same data area.
ROOT(72) Sq R
Sq+1
Sq
R
DATA EXCHANGE (@)XCHG(73)
Exchanges the contents of two words (E1 E1/E2: IR and E2). HR AR E1 E2 LR TC DM
XCHG(73) E1 E2
Data Areas These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers. IR 00000 to 23515
138
SR
HR
TR
AR
LR
TC
DM
#
23600 to 25507
HR 0000 to 9915
TR 0 to 7
AR 0000 to 2715
LR 0000 to 6315
TC 000 to 511
Read/Wr: DM 0000 to DM 0999 Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
Page 153
Appendix E
Programming Instructions Name Mnemonic
Symbol
Function
ONE DIGIT SHIFT LEFT (@)SLD(74)
Operand Data Areas
Shifts all data, between the starting word (St) and ending word (E), one digit (four bits) to the left, writing zero into the rightmost digit of the starting word. St and E must be in the same data area.
SLD(74) St E
St
St/E: IR HR AR LR DM
0
St + 1
E
ONE DIGIT SHIFT RIGHT (@)SRD(75)
Shifts all data, between starting word (St) and ending word (E), one digit (four bits) to the right, writing zero into the leftmost digit of the ending word. St and E must be in the same data area.
SRD(75) E St
St/E: IR HR AR LR DM
E E–1 0
4-TO-16 DECODER (@)MLPX(76)
St
Converts up to four hexadecimal digits in the source word (S), into decimal values from 0 to 15, and turns ON the corresponding bit(s) in the result word(s) (R). There is one result word for each converted digit. Digits to be converted are designated by Di. (The rightmost digit specifies the first digit. The next digit to the left gives the number of digits to be converted minus 1. The two leftmost digits are not used.)
MLPX(76) S Di R
S
S: IR SR HR AR LR TC DM
Di: IR HR AR LR TC DM #
R: IR HR AR LR DM
S: IR SR HR AR LR TC DM
R: IR HR AR LR DM
Di: IR HR AR LR TC DM #
0 to F
R 15
16-TO-4 ENCODER (@)DMPX(77)
00
Determines the position of the leftmost ON bit in the source word(s) (starting word: S) and turns ON the corresponding bit(s) in the specified digit of the result word (R). One digit is used for each source word. Digits to receive the converted values are designated by Di. (The rightmost digit specifies the first digit. The next digit to left gives the number of words to be converted minus 1. The two leftmost digits are not used.)
DMPX(77) S R Di
15
00
S
R
0 to F
Data Areas These footnote tables show the actual ranges of all data areas. Bit numbers are provided (except for DM and TC areas); remove the rightmost two digits for word numbers. IR 00000 to 23515
SR
HR
TR
AR
LR
TC
DM
#
23600 to 25507
HR 0000 to 9915
TR 0 to 7
AR 0000 to 2715
LR 0000 to 6315
TC 000 to 511
Read/Wr: DM 0000 to DM 0999 Rd only: DM 1000 to DM 1999
0000 to 9999 or 0000 to FFFF
139