The text of a manual · part 17 of 37
Sharp Programmable Controller New Satellite JW10 User's Manual: Chapter 9 Description of Instructions, pages 126 to 135
Pages 126 to 135 of 307, from Sharp Programmable Controller New Satellite JW10 User's Manual
The original document is the PDF (5.0 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.
Filed in the catalog under the Sharp jW-10CM
Page 126
F-14 OR Symbol
OR register with register (1 byte) (OR) F-14 OR
S
STR F-14
Function
The contents of the register S (8 bits) are ORed with the contents of the register D (8 bits) and its result is stored in the register D.
Operation
S∪D→D
Range of S
Range of D
04002
F-14 OR
09000
09000 09002
09002
When the input condition 04002 changes from OFF to ON, the 8 bits contents of the register 09000 are ORed with the 8 bits contents of the register 09002 and its result is stored in the register 09002. The contents of the register 09000 remain unchanged.
コ0000 to コ1577 b0000 to b0777 09000 to 09777 19000 to 19777 29000 to 29777 39000 to 39777 コ0000 to コ1577 b0000 to b0777 09000 to 09777 19000 to 19777 29000 to 29777 39000 to 39777
Before operation
After operation -ditto-
09000 0 1 0 1 0 0 1 1
09000
OR 09002 1 0 1 1 1 0 0 1
Condition
Rising edge of input signal (OFF to ON)
After operation
Contents Unchanged of S Contents Result of D
Flag
Instruction 04002
〔Example for use〕
D
1 1 1 1 1 0 1 1 09002
OR truth table Symbol A C B
Unchanged
A 0 1 0 1
B 0 0 1 1
C 0 1 1 1
9
Similarity instructions: F-14w, Fc14, Fc14w
F-14w OR Symbol
OR register with register (1 word) (OR) F-14w OR
S
〔Example for use〕
D
Function
The 16 bits contents of the registers S, S+1 are ORed with the 16 bits contents of the registers D, D+1 and its result is stored in the registers D, D+1.
Operation
S, S+1∪D, D+1→D, D+1
Range of S
Range of D
04000
Instruction 04000
STR F-14w F-14w 09000 09002 OR
09000 09002
When the input condition 04000 changes from OFF to ON, the 16 bits contents of the registers 09000 and 09001 are ORed with the 16 bits contents of the registers 09002 and 09003 and its result is stored in the registers 09002 and 09003. The contents of the registers 09000 and 09001 remain unchaged.
コ0000 to コ1576 b0000 to b0776 09000 to 09776 19000 to 19776 29000 to 29776 39000 to 39776 コ0000 to コ1576 b0000 to b0776 09000 to 09776 19000 to 19776 29000 to 29776 39000 to 39776
09001
09000
0101100101011101 OR
Before operation
Condition
After operation
09003
Rising edge of input signal (OFF to ON)
1101010010100110
Contents of S, S+1
Unchanged
Contents of D, D+1
Result
Flag
09002
09003 After operation
Unchanged
Note 1: Be sure to use even addresses for registers S and D. Similarity instructions: F-14, Fc14, Fc14w
9-51
09002
1101110111111111
Page 127
Fc14 OR Symbol
OR register with constant (1 byte) (OR) Fc14 OR n
D
Function
An octal constant "n" is ORed with the contents of the register D and its result is stored in the register D.
Operation n∪D→D
Range of "n"
000 to 377(8)
Range of D
コ0000 to コ1577 b0000 to b0777 09000 to 09777 19000 to 19777 29000 to 29777 39000 to 39777
Condition After operation
04001
Fc14 OR
123
STR Fc14
123 09002
09002
When the input condition 04001 changes from OFF to ON, the octal constant 123 is ORed with the contents of the register 09002 and its result is stored in the register 09002. Before operation 09002 1 0 1 0 1 0 1 0
After operation
OR
1 1 1 1 1 0 1 1 09002
1 2 3 Octal constant 0 1 0 1 0 0 1 1 (123)
Rising edge of input signal (OFF to ON)
OR truth table Symbol
Contents Result of D
Flag
Instruction 04001
〔Example for use〕
A 0 1 0 1
A C B
Unchanged
B 0 0 1 1
C 0 1 1 1
Similarity instructions: F-14, F-14w, Fc14w
9
Fc14w OR Symbol
OR register with constant (1 word) (OR) Fc14w OR n
D
Function
An octal constant "n" is ORed with the 16 bits contents of the registers D and D+1 and its result is stored in the registers D and D+1.
Operation n∪D, D+1→D, D+1
Range of "n"
000000 to 177777(8)
Range of D
コ0000 to コ1576 b0000 to b0776 09000 to 09776 19000 to 19776 29000 to 29776 39000 to 39776
Condition After operation
Rising edge of input signal (OFF to ON) Contents of D, D+1
Flag
04001
STR Fc14w Fc14w 026562 コ0040 OR
026562 コ0040
When the input condition 04001 changes from OFF to ON, the octal constant 026562 is ORed with the16 bits contents of the registers コ0040 and コ0041 and its result is stored in the registers コ0040 and コ0041. Octal constant 026562 0010110101110010
0
2
6
コ0041
5
6
2
コ0040
Before operation
1001100011001000
After operation
1011110111111010
Result Unchanged
Instruction 04001
〔Example for use〕
コ0041
Note 1: Be sure to use even addresses for registers D. Similarity instructions: F-14, F-14w, Fc14
9-52
コ0040
OR
Page 128
F-15 MUL Symbol
Multiply register by register (BCD 4 digits) (MULtiply) F-15 MUL
S1
S2
Function
The contents of the registers S1 and S1+1 (BCD 4 digits) are multiplied by the contents of the registers S2 and S2+1 (BCD 4 digits) and its result is stored in the 4 bytes area starting from the register D.
Operation
(S1, S1+1) × (S2, S2+1) →D, D+1, D+2, D+3
Range of S1
Range of S2
Range of D
Condition
STR F-15 04001
Before operation
09000
Tens
Ones
0
0
After operation
0
0
09020
3
4
09001
1
2
09022
0
0
09023
Thousands Hundresds
09001
0
1
× 09010
Rising edge of input signal (OFF to ON)
Tens
Ones
3
4
9
Thousands Hundresds
09011
Contents of Unchanged S1, S1+1 Contents of Unchanged S2, S1+2
1
2
The above example shows the operation of 100×1234=123400.
Contents of Result (in ones and tens) D
Contents of Result (in millions and ten millions) D+3 Zero S1, S1+1, S2, S2+1 07357 Flag BCD code 0 Not BCD code
09000 09010 09020
F-15 09000 09010 09020 MUL
When the input condition 04001 changes from OFF to ON, the BCD 4 digits in registers 09000 and 09001 are multiplied by the BCD 4 digits of registers 09010 and 09011 and its result is stored in the 4 bytes area starting from the registers 09020.
コ0000 to コ1576 b0000 to b0776 09000 to 09776 19000 to 19776 29000 to 29776 39000 to 39776 コ0000 to コ1576 b0000 to b0776 09000 to 09776 19000 to 19776 29000 to 29776 39000 to 39776 コ0000 to コ1574 b0000 to b0774 09000 to 09774 19000 to 19774 29000 to 29774 39000 to 39774
Contents of Result (in hundreds After and thousands) D+1 operation Contents of Result (in ten thousands and hundred thousands) D+2
Instruction 04001
〔Example for use〕
D
Unchanged if the contents of registers S1, S1+1, S2, and S2+1 are not BCD code.
Carry 07356
0
Error Non-carry 07354 07355
0 1
0
Similarity instructions: Fc15
9-53
Page 129
Fc15 MUL Symbol
Multiply register (BCD 4 digits) by constant (BCD 3 digits) (MULtiply) Fc15 MUL
S1 n
〔Example for use〕
D
Function
The contents of the registers S1 and S1+1 (BCD 4 digits) are multiplied by a 3 digits BCD constant "n" and its result is stored in the 4 bytes area starting from the register D.
Operation
(S1, S1+1) × n→D, D+1, D+2, D+3
Range of S1
コ0000 to コ1576 b0000 to b0776 09000 to 09776 19000 to 19776 29000 to 29776 39000 to 39776
Range of D
Condition
Rising edge of input signal (OFF to ON)
09000
100
00010010
1 09001
2
00110100
3
09000 100 09020
09020
4
00000000
0
00010010
1
09020
0 09021
2
×
Contents of Unchanged S1, S1+1
BCD constant 100
Contents of Result (in ones and tens) D
Contents of Result (in millions and ten millions) D+3 Zero S1, S1+1 07357 Flag BCD code 0 Not BCD code
Fc15 09000 MUL
3412×100=341200
コ0000 to コ1574 b0000 to b0774 09000 to 09774 19000 to 19776 29000 to 29774 39000 to 39774
Contents of Result (in hundreds and thousands) D+1 After Contents of Result (in ten thousands operation and hundred thousands) D+2
04001
When the input condition 04001 changes from OFF to ON, the BCD 4 digits in registers 09000 and 09001 are multiplied by the 3 digits BCD constant 100 and its result is stored in the 4 bytes area starting from the registers 09020.
Range of "n" 000 to 999
9
Instruction 04001
STR Fc15
Unchanged when the contents of registers S1 and S1+1 are not BCD code.
Carry 07356
0
Error Non-carry 07354 07355
0 1
0
Similarity instructions: F-15
9-54
00110100
3
09022
4
000100000000 00000000
0
0
09023
Page 130
Divide register (BCD 4 digits) by register (BCD 2 digits) (DIVide)
F-16 DIV
F-16 DIV
Symbol
S1
S2
〔Example for use〕
D
Function
The contents of the registers S1 and S1+1 (BCD 4 digits) are divied by the contents of the register S2 (BCD 2 digits) and the quotient is stored in the 2 bytes area starting from the register D and the remainder in the third byte area.
Operation
(S1, S1+1) ÷S2→D, D+1, D+2
Range of S2
Range of D
Condition
04001
09000 09010 09020
F-16 09000 09010 09020 DIV
When the input condition 04001 changes from OFF to ON, the BCD 4 digits in registers 09000 and 09001 are divided by the BCD 2 digits in registers 09010 and the quotient is stored in the 2 bytes area starting from the registers 09020 with the remainder in the 3 bytes area.
コ0000 to コ1576 b0000 to b0776 09000 to 09776 19000 to 19776 29000 to 29776 39000 to 39776 コ0000 to コ1577 b0000 to b0777 09000 to 09777 19000 to 19777 29000 to 29777 39000 to 39777 コ0000 to コ1575 b0000 to b0775 09000 to 09775 19000 to 19775 29000 to 29775 39000 to 39775
Range of S1
Instruction 04001
STR F-16
Before operation
09000
Tens
Ones
Tens
Ones
3
4
5
8
Thousands Hundresds
09001
1
09020
Quotient
Thousands Hundresds
2
0
0
Tens
Ones
Tens
Ones
2
1
1
6
09021
÷ 09010
09022 Remainder
Rising edge of input signal (OFF to ON)
Contents of Unchanged S1, S1+1 Contents of Unchanged S2
The above example shows the operation of 1234 divided by 21 equals 58 with the remainder of 16.
Contents of Quotient (in ones and tens) D After Contents of Quotient (in hundreds operation D+1 and thousands) Contents of Remainder D+2
Flag
Unchanged when the contents of registers, S1, S1+1, and S2 are not BCD code or the contents of S2 is 00.
S1, S1+1, S2
Zero 07357
Carry 07356
BCD code Not BCD code If S2 is 00
0
0
Error Non-carry 07355 07354
0 1
• If denominator is not greater than numerator (S1<S2, S1+1=0), the quotient (contents of D, D+1) is 0 and remainder (contents of D+2) is numerator (contents of S1). For instance, 20/30 will produce the result of 0 with a remainder of 20.
0
Similarity insturctions: Fc16 Reference To obtain a result of 2 places under the decimal point, the following programming is suggested. Example:1983/58=34.18 … remainder 0.56 04001
09000 09001
F-16 09000 09010 09020 DIV
①
F-01 BCD
09023
②
F-02 09022 09023 XCH
③
F-16 09022 09010 09015 DIV
④
83 19 ÷
09010
09022 09023
09000 09021 09022
34 00 11
09023
00
②
09022 09023
00 11
③
09015 09016 09017
18 00 56
Quotient
①
Remainder
58
00 11 ÷
09010
00
Quotient
Instruction 04001 STR F-16 09000 09010 09020 F-01 00 09023 F-02 09022 09023 F-16 09022 09010 09015
④
Remainder
58
9-55
① When the input condition 04001 changes from OFF to ON, the contents of registers 09000 and 09001 are divided by the contents of the register 09010 and the quotient is stored in 09020 and 09021 and remainder is stored in 09022. ② Enter data 00 in 09023. ③ The contents of 09022 are exchanged with 09023 and a remainder is converted into thousands and hundreds. ④ The data in ③ is divided by the contents of 09010 again, and a quotient is stored in 09015 and 09016 with a remainder stored in 09017. The result under 2 digits of decimal place is then stored in 09015.
9
Page 131
Fc16 DIV Symbol
Divide register (BCD 4 digits) by constant (BCD 2 digits) (DIVide) Fc16 DIV
S1 n
〔Example for use〕
D
Function
The contents of the registers S1 and S1+1 (BCD 4 digits) are divided by a 2 digits BCD contents "n" and the quotient is stored in the 2 bytes area starting from the register D and the remainder in the 3 bytes area.
Operation
(S1, S1+1) ÷ n→D, D+1, D+2
Range of S1
コ0000 to コ1576 b0000 to b0776 09000 to 09776 19000 to 19776 29000 to 29776 39000 to 39774
04001
Condition
Fc16 09000 DIV
コ0000 to コ1575 b0000 to b0775 09000 to 09775 19000 to 19775 29000 to 29775 39000 to 39775
09000 0 1 1 0 0 1 0 1
6
5
09001 1 0 0 0 0 1 1 1
8
Rising edge of input signal (OFF to ON)
09000 21 09020
7
0 0 0 1 0 1 1 1 09020
1
7
Quotient
0 0 0 0 0 1 0 0 09021
0
4
÷
Contents of Quotient (in ones and tens) D
Unchanged when the contents of registers Contents of Quotient (in hundreds S1 and S1+1 are not and thousands) D+1 After BCD code or the operation Contents of contents of "n" is 00. Remainder D+2
Flag
09020
8765÷21=417……8
Contents of Unchanged S1, S1+1
9
21
When the input condition 04001 changes from OFF to ON, the BCD 4 digits in registers 09000 and 09001 are divided by the BCD constant 21 and the quotient is stored in the 2 bytes area starting from the register 09020 with the remainder in the 3 bytes area.
Range of "n" 00 to 99
Range of D
Instruction 04001
ST R Fc16
S1, S1+1, "n"
Zero 07357
Carry 07356
BCD code Not BCD code If "n" is 00
0
0 1
BCD constant 00100001 21
Error Non-carry 07354 07355
0
0
Similarity instructions: F-16
9-56
2
●
1
0 0 0 0 1 0 0 0 09022
0
Remainder
8
If denominator is not greater than numerator (S1<n, S1+1=0), the quotient (contents of D, D+1) is 0 and remainder (contents of D+2) is numerator (contents of S1). For instance, 20/30 will produce the result of 0 with a remainder of 20.
Page 132
F-18 XOR Symbol
Exclusive OR register with register (1 byte) (eXclusive OR) F-18 XOR
S
D
Function
The contents of the register S are XORed with the contents of the register D and its result is stored in the register D.
Operation
S D→D
Range of S
Range of D
Condition
After operation
STR F-18 04001
F-18 09000 09001 XOR
09000 09001
When the input condition 04001 changes from OFF to ON, the contents of the register 09000 are XORed with the contents of the register 09001 and its result is stored in the register 09001. The contents of the register 09000 remain unchanged.
コ0000 to コ1577 b0000 to b0777 09000 to 09777 19000 to 19777 29000 to 29777 39000 to 39777 コ0000 to コ1577 b0000 to b0777 09000 to 09777 19000 to 19777 29000 to 29777 39000 to 39777
Before operation
After operation -ditto-
09000 0 0 0 0 1 1 1 1
09000
XOR 09001 1 0 0 0 1 1 1 0
1 0 0 0 0 0 0 1 09001
Bit matched in 09000 and 09001 (0 for 0, 1 for 1) is turned to 0 and unmatched bit (0 and 1) is turned to 1.
Rising edge of input signal (OFF to ON)
Exclusive OR truth table
Contents of S
Unchanged
Contents of D
Result
Flag
Instruction 04001
〔Example for use〕
Symbol
A 0 1 0 1
A C B
Unchanged
B 0 0 1 1
C 0 1 1 0
Similarity instructions: F-18w, Fc18, Fc18w
F-18w XOR Symbol
Exclusive OR register with register (1 word) (eXclusive OR) F-18w XOR
S
Function
The 16 bits contents of the registers S, S+1 are XORed with the 16 bits contents of the registers D, D+1 and its result is stored in the registers D, D+1.
Operation
S, S+1 D, D+1→D, D+1
After operation
STR F-18w 04000
F-18w 09000 09002 XOR
09001
Unchanged
Contents of D, D+1
Result
Flag
09000
0101100101011101 XOR 09003
Rising edge of input signal (OFF to ON) Contents of S, S+1
09000 09002
When the input condition 04000 changes from OFF to ON, the 16 bits contents of the registers 09000 and 09001 are XORed with the 16 bits contents of the registers 09002 and 09003 and its result is stored in the registers 09002 and 09003. The contents of the registers 09000 and 09001 remain unchanged.
コ0000 to コ1576 b0000 to b0776 Range of S 09000 to 09776 19000 to 19776 29000 to 29776 39000 to 39776 コ0000 to コ1576 b0000 to b0776 to 09776 Range of D 09000 19000 to 19776 29000 to 29776 39000 to 39776
Condition
Instruction 04000
〔Example for use〕
D
Before operation
1101010010100110
After operation
1000110111111011
09003
Unchanged
Note 1: Be sure to use even addresses for registers S and D. Similarity instructions: F-18, Fc18, Fc18w
9-57
09002
09002
9
Page 133
Fc18 XOR
Exclusive OR register with constant (1 byte) (eXclusive OR) Fc18 XOR
Symbol n
D
Function
An octal constant "n" is XORed with the contents of the register D and its result is stored in the register D.
Operation n D→D
04001
Fc18 XOR
017
STR Fc18
017 09001
09001
When the input condition 04001 changes from OFF to ON, the octal constant 017 is XORed with the contents of the register 09001 and its result is stored in the register 09001.
Range of "n" 000 to 377(8)
Range of D
コ0000 to コ1577 b0000 to b0777 09000 to 09777 19000 to 19777 29000 to 29777 39000 to 39777
Condition
Rising edge of input signal (OFF to ON)
After operation
Instruction 04001
〔Example for use〕
Before operation 09001 1 0 1 0 1 0 1 0
After operation
XOR
1 0 1 0 0 1 0 1 09001
0 1 7 Octal constant 0 0 0 0 1 1 1 1 (017)
Exclusive OR truth table Symbol
Contents Result of D
A 0 1 0 1
A C B
Flag
Unchanged
B 0 0 1 1
C 0 1 1 0
Similarity instructions: F-18, F-18w, Fc18w
9
Fc18w XOR
Exclusive OR register with constant (1 word) (eXclusive OR) Fc18w XOR
Symbol n
〔Example for use〕
D
Function
An octal constant "n" is XORed with the 16 bits contents of the registers D and D+1 and its result is stored in the registers D and D+1.
Operation n
Range of "n"
000000 to 177777(8)
Range of D
コ0000 to コ1576 b0000 to b0776 09000 to 09776 19000 to 19776 29000 to 29776 39000 to 39776
Condition After operation
D, D+1→D, D+1
Rising edge of input signal (OFF to ON) Contents of D, D+1
Flag
Fc18w 04001
Fc18w 026562 コ0040 XOR
026562 コ0040
When the input condition 04001 changes from OFF to ON, the octal constant 026562 is XORed with the16 bits contents of the registers コ0040 and コ0041 and its result is stored in the registers コ0040 and コ0041. Octal constant 026562 0010110101110010
0
2
6
コ0041
5
6
2
コ0040
Before operation
1001100011001000
After operation
1011010110111010
Result Unchanged
Instruction 04001 STR
コ0041
Note 1: Be sure to use even addresses for registers D. Similarity instructions: F-18, F-18w, Fc18
9-58
コ0040
XOR
Page 134
F-30 MCS F-31 MCR
Set master control (Master Control Set) Reset master control (Master Control Reset)
MCS and MCR can be used when the circuit is branched to a multiple number of outputs after common operational condition. 00000
00001
00400
00000
00001
00400
00002
00401
00000
00002
00401
(1) In case of a relay board 00000
(2) In case of MCS and MCR not in use
F-30 MCS
STR F-30 STR OUT STR OUT F-31
MCS
00001
00400
00002
00401
MCR
00000 00001 00400 00002 00401
F-31 MCR (3) In case of MCS and MCR in use When the F-30 (MCS) instruction is programmed, the contents of the accumulator are stored in the CPU internal register, and succeeding instructions are ANDed with the contents of the CPU internal register until the F-31 (MCR) instruction is met. The F-31 (MCR) instruction indicates the end of AND operation. It will help to simplify the program when the operational condition indicated in a block is complicated or many branches are set after the common operational condition.
Note 1: Do not directly connect the F-30 (MCS) derived bus line with OUT, TMR, and CNT instructions or application instruction. (1) In case of the relay board 00400
00000
00001
(2) MCS, MCR prohibited program 00000
F-30 MCS
00401 00400
00002
00402 00001
00401
00002
00102
F-31 MCR
Must be programmed in the following manner. 00000
00001
00400
00002
00401
TMR 010
00000
1000
F-30 MCS 00001
00400
00002
00401
F-31 MCR 00000
9-59
TMR 010
1000
Instruction 00000 STR F-30 OUT 00400 00001 STR 00401 OUT 00002 STR 00402 OUT F-31
9
Page 135
Note 2: The F-31 (MCR) instruction is an unconditional instruction. 00010
F-31 MCR
It prohibits the program like shown above. Another MCS may be used in between MCS and MCR. 00000
00001
00400
00002
00003 00401
The relay board ladder chart shown at left can be programmed in the following manner using MCS and MCR. However, there may be a need of changing the program sequence in the example(※).
00004 00402
Instruction 00000 STR F-30 STR 00001 00400 OUT 00006 STR 00404 OUT 00002 STR F-30 00003 STR 00401 OUT STR NOT 00004 00402 OUT 00005 STR 00403 OUT F-31
00005 00403
00404
00006
00000
F-30 ① MCS
00001
00400
00006
00404
00002
9
F-30 MCS
②
00003
00401
00004
00402
00005
00403
②
※
①
• The F-31 (MCR) instruction indicates the termination of the preceding F-30 (MCS) instruction ; ① and ② in the example.
F-31 MCR
Note 3: The desired circuit would not be established if programmed in the following way.
MCS
MCS
MCR MCR
Instruction 00000 STR F-30 STR 00001 00400 OUT 00002 STR F-30 00003 STR 00401 OUT STR NOT 00004 00402 OUT 00005 STR 00403 OUT F-31 00006 STR 00404 OUT F-31
00000
F-30 ① MCS
00001
00400
00002
F-30 ② MCR
00003
00401
00004
00402
00005
00403
F-31 MCR
※ 00006
This MCR is insignificant MCS of ① and ② has been terminated with this MCR.
00404
F-31 MCR
• Although it is possible to insert MCS as many times as required between MCS and MCR (※), the range of MCS terminates with MCR marked with an asterisk (※).
9-60