The text of a manual · part 15 of 37
Sharp Programmable Controller New Satellite JW10 User's Manual: Chapter 9 Description of Instructions, pages 106 to 115
Pages 106 to 115 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 106
Convert 2 digits BCD to 8 bits in binary
F-03 →BIN
F-03 →BIN
Symbol
S
〔Example for use〕
D
Function
The contents of the register S (8 bits) are assumed as BCD code, converted into binary, then the result is stored in the register D.
Operation
S→D
Range of S
Range of D
Condition
04006
F-03 09300 09310 →BIN
09300 09310
When the input condition 04006 changes from OFF to ON, the contents of the register 09300 (8 bits) are assumed as BCD code, converted into binary, and its result is transferred to the register 09310. The contents of the register 09300 remain unchanged. If the contents of the register 09300 are not BCD code, the contents of the register 09310 are unchanged, and the error flag (07355) is set to "1". ・Transition of register contents and flags
コ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
09300 1 0 0 0 0 1 0 1
Rising edge of input signal (OFF to ON)
Contents of S
Instruction 04006
STR F-03
8
5
Zero 07357 0
Unchanged
0 1 0 1 0 1 0 1 09310
26 Carry 07356 0
4
+2 +22+20=64+16+4+1=85
Error 07355 0
Non-carry 07354 0
・Result After operation
Contents ・Unchanged when the contents of of D the register S are not BCD code.
Flag
Contents of register S
Zero 07357
Carry 07356
BCD code
0
0
Not BCD code
Error Non-carry 07354 07355
0 1
0
Similarity instructions: F-03w, F-53
9-31
09300 1 1 0 0 0 1 0 1
C (H) Zero 07357 0
5
09310
The contents of 09310 stay the same. Carry 07356 0
Error 07355 1
Non-carry 07354 0
9
Page 107
F-03w →BIN
Convert 4 digits BCD to 16 bits in binary F-03w →BIN
Symbol
S
〔Example for use〕
D
Function
The 2 bytes BCD contents (4 digits data) of the registers S, S+1 are converted into binary, and the result is stored in the 2 bytes area of the registers D, D+1
Operation
S1, S+1→D, D+1
Range of S
Range of D
Condition
Tens
Rising edge of input signal (OFF to ON)
9
6
4
Contents of registers S,S+1
Zero 07357
Carry 07356
BCD code Not BCD code
0
0
19000 0 0 0 0 0 0 0 0
27
20
Thousands Hundreds コ1001 0 1 0 0 0 0 0 0
Unchanged
After operation
Ones
コ1000 1 0 0 1 0 1 1 0
Unchanged when the Result (0 to 255) contents of the After registers S, S+1 Contents of operation Result (256 to 9999) are not BCD code. D+1
Flag
コ1000 19000
F-03w コ1000 19000 →BIN
Before operation
Contents of D
9
04001
When the input condition 04001 changes from OFF to ON, the contents of 4 digits BCD data in registers コ1000 and コ1001 are converted into binary, and its result is transferred and stored in 2 bytes area of registers 19000 and 19001.
コ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
Contents of S,S+1
Instruction 04001
STR F-03w
0 BCD 4096
19001 0 0 0 1 0 0 0 0
215
28 BIN (Binary) 212=4096
Error Non-carry 07354 07355
0 1
0
Note 1: If the F-53 insutruction is used for programming, the F-03w instruction displays the program during monitoring. Similarity instructions: F-03, F-53
9-32
Page 108
F-04 →B C D Symbol
Convert 8 bits binary to 2 digits BCD F-04 →BCD
S
〔Example for use〕
D
Function
The contents of the register S (8 bits) are assumed as a binary code, converted into BCD code, then the result is stored in the register D.
Operation
S→D
Range of S
Range of D
コ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
04006
F-04 09320 →BCD
When the input condition 04006 changes from OFF to ON, the contents of the register 09320 (8 bits) are assumed as a binary code, converted into BCD code, and its result is transferred to the register 09330. The contents of the register 09320 remain unchanged. If the BCD number converted should exceed"100", the digit of hundreds will be disregarded.
5
3
2
2 +2 +2 +2 32 + 8 + 4 + 1
After operation
Contents Unchanged of S Contents Result of D
0 1 0 0 0 1 0 1 09330 0
4
5
=
Rising edge of input signal (OFF to ON)
09320 09330
09330
09320 0 0 1 0 1 1 0 1
Condition
Instruction 04006
STR F-04
45
09320 1 1 0 1 1 0 1 1 7+26+24+23+21+20
2
0 0 0 1 1 0 0 1 09330
1
9
=
Flag
Unchanged
219
9
Similarity instructions: F-04w, F-54
F-04w →BCD Symbol
Convert 16 bits binary to 6 digits BCD F-04w →BCD
S
〔Example for use〕
D
Function
The contents of 2 bytes binary in the registers S, S+1 converted into 6 digits BCD,and the result is stored in 3 bytes of the registers D, D+1, and D+2.
Operation
S, S+1→D, D+1, D+2
Range of S
Range of D
コ0000 to コ1576 b0000 to b0776 09000 to 09776 19000 to 19776 29000 to 29776 39000 to 39776 コ0000 to コ1575 b0000 to b0775 09000 to 09775 19000 to 19775 29000 to 29775 39000 to 39775
04001
Instruction 04001
STR F-04w F-04w コ1000 19000 →BCD
コ1000 19000
When the input condition 04001 changes from OFF to ON, the contents of 2 bytes binary in registers コ1000 and コ1001 are converted into 6 digits BCD and stored in 3 bytes area of registers that begin from 19000.
Tens コ1000 0 0 0 0 0 0 0 0
27
20
Ones
19000 0 1 1 0 1 0 0 0
6
8
Thousands Hundreds
Condition
After operation
Rising edge of input signal (OFF to ON)
コ1001 1 0 0 0 0 0 0 0
Contents Unchanged of S, S+1 Contents Result (ones and tens) of D Contents Result (hundreds and thousands) of D+1 Contents Result (ten thousands) of D+2
Flag
215
28 Binary
19001 0 0 1 0 0 1 1 1
2
7
Ten thousands 19002 0 0 0 0 0 0 1 1
0
3
6 digits BCD 032768
Unchanged
Note 1: If the F-54 instruction is used for programming, the F-04w instruction displays the program during monitoring. Similarity instructions: F-04, F-54
9-33
Page 109
F-07 DCML
Transfer decimal (1 byte) constant (DeCiMaL) F-07 DCML
Symbol n
D
Instruction 04004
STR F-07
Function
A decimal constant "n" is transferred to the register D.
Operation n
04004
F-07 DCML
015
015 09100
09100
When the input condition 04004 changes from OFF to ON, the decimal constant "15" is transferred to the register 09100. The register 09100 is in the following binary code representation.
D
Range of "n"
000 to 255
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
〔Example for use〕
09100 0 0 0 0 1 1 1 1
23+22+21+20=15
Contents n (000 to 255) of D
Flag
Unchanged
Similarity instructions: F-07w
9
F-07w DCML Symbol
Transfer decimal (1 word) constant (DeCiMaL) F-07w DCML n
D
〔Example for use〕
Instruction 04001
STR F-07w 04001
Function
A decimal constant "n" is transferred to the registers D, D+1.
Operation n→D, D+1
Range of "n"
00000 to 65535
Range of D
コ0000 to コ1576 b0000 to b0776 09000 to 09776 19000 to 19776 29000 to 29776 39000 to 39776
Condition
Rising edge of input signal (OFF to ON)
0 1 0 1 1 0 0 0 1 0 0 0 0 0 1 1
Contents n (0000 to 65535) of D,D+1
214+212+211+27+21+20=22659
After operation
Flag
F-07w 22659 19100 DCML
22659 19100
When the input condition 04001 changes from OFF to ON, the decimal constant 22659 is transferred to the registers 19100 and 19101. The following binary code is stored in the registers 19100 and 19101.
19101
Unchanged
Note 1: Be sure to use even addresses for register D. Similarity instructions: F-07w
9-34
19100
Page 110
F-08 OCT
Transfer octal (1 byte) constant (OCTal) F-08 OCT
Symbol n
〔Example for use〕
D
Function
An octal constant "n" is transferred to the register D.
Operation n
Range of "n"
000 to 377 (8)
04004
After operation
F-08 OCT
015
015 09100
09100
When the input condition 04004 changes from OFF to ON, the octal constant 015 is transferred to the register 09100. The register 09100 is in the following code representation.
D
コ0000 to コ1577 b0000 to b0777 to 09777 Range of D 09000 19000 to 19777 29000 to 29777 39000 to 39777
Condition
Instruction 04004
STR F-08
09100 0 0 0 0 1 1 0 1
Rising edge of input signal (OFF to ON)
1
0
5
Contents n (000 to 377) of D
Flag
Unchanged
Similarity instructions: F-08w, F-71, F-71w
F-07 DCML
Reference Though F-07 (transfer decimal constant) handles a decimal number and F-08 (transfer octal constant) an octal number, the contents of the register after the transfer are represented in the binary code for both instructions.
013
F-08 OCT
=
09100
Symbol
09100
In the decimal 0 0 0 0 1 1 0 1 013 notation 7 6 5 4 3 2 1 0 0 0 0 0 1 1 0 1
2 2 2 2 2 2 2 2 to transfer R
2 3+ 2 2+ 2 0= 8 + 4 + 1 = 1 3 In the octal notation
0 0 0 0 1 1 0 1 0
F-08w OCT
015
1
5
Transfer decimal (1 word) constant (OCTal) F-08w OCT n
〔Example for use〕
D
Instruction 04001 STR F-08w
Function
An octal constant "n" is transferred to the registers D, D+1.
Operation n→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
04001
123456 19100
When the input condition 04001 changes from OFF to ON, the decimal constant 123456 is transferred to the registers 19100 and 19101. The following code is stored in the registers 19100 and 19101.
19101
Rising edge of input signal (OFF to ON)
Unchanged
Note 1: Be sure to use even addresses for register D. Similarity instructions: F-08, F-71, F-71w
9-35
19100
1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1
Contents of D, D+1 n (000000 to 177777)
Flag
F-08w 123456 19100 OCT
2
3
4
5
6
015
9
Page 111
F-09 INV
Complement 8 bits data (INVerter) F-09 INV
Symbol
S
〔Example for use〕
D
Function
The contents of the register S are complemented and stored in the register D.
Operation
S
Range of S
Range of D
コ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
After operation
Symbol
F-09w INV
S
S, S+1→D, D+1
After operation
〔Example for use〕
D
Operation
Condition
1 0 1 0 1 1 0 0 09003
Complement 16 bits data (INVerter)
The contents of the registers S, S+1 (16 bits) are complemented and stored in the registers D, D+1.
Range of D
09000 09003
09003
Unchanged
Function
Range of S
09000
09000 0 1 0 1 0 0 1 1
Rising edge of input signal (OFF to ON)
Flag
F-09 INV
When the input condition 04002 changes from OFF to ON, the 8 bits contents of the register 09000 are complemented and its result is stored in the register 09003. The contents of the register 09000 remain unchanged.
Contents Unchanged of S Contents Complement of register S contents of D
F-09w INV
04002
D
Condition
9
Instruction 04002
STR F-09
Instruction 04000
STR F-09w 04000
F-09w 09000 コ0040 INV
09000 コ0040
When the input condition 04000 changes from OFF to ON, the contents of the registers 09000 and 09001 (16 bits) are complemented and its result is stored in the registers コ0040 and コ0041. The contents of the registers 09000 and 09001 remain unchanged.
コ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
0110101010101100
Rising edge of input signal (OFF to ON) Contents of S, S+1 Unchanged Contents Complement of register of D S contents Contents Complement of register S+1 of D+1
Flag
コ0041
コ0040
1001010101010011
Unchanged
Note 1: Be sure to use even addresses for registers S and D.
9-36
Page 112
Add register and register (BCD 2 digits) (ADD)
F-10 ADD
F-10 ADD
Symbol
S1
S2
〔Example for use〕
D
Function
The contents of the register S1 are added with the contents of the register S2 in BCD 2 digits and its result is stored in the register D.
Operation
S1+S2→D
Range of S1
Range of S2
Range of D
Condition
After operation
Unchanged
101 and above S1 and S2 are not BCD code.
Zero 07357
Carry 07356
23 23
23 23
23 23
23 23
5E 5E
(09010)
35 35
58 58
81 81
77 77
70 70
(09020)
17 58 (23+35)
58 81 (23+58)
81 04 (23+81)
04 00 (23+77)
Non-carry flag 07354 Error flag 07355 Carry flag 07356 Zero flag 07357
1 0 1 0 0
0 0 1 1 0
0 0 0 0 1
9
1 scan time, max.
Tens Ones
Tens Ones
09000 0 0 1 0 0 0 1 1
In case 3 BCD digits or more have to be added, the F-10 instruction must be provided successively. When the F-10 instruction is programmed repeatedly, the contents of the carry flag (07356) are also added after the second instruction. For the F-10 instruction that appears first in succession to the STR instruction, the contents of the carry flag (07356) are not added.
F-10 09001 09011 09021 ADD
Valid until a flag affecting instruction is met in the program.
1 1 0 0 0
Reference
F-10 09000 09010 09020 ADD
70 70 No addition (09000 not BCD).
Error Non-carry 07354 07355
Similarity instructions: F-10w, Fc10, Fc10w
04000 register (09000)
・Lower 2 digits of the result. ・Unchanged when the contents of registers S1 and S2 are not BCD code.
0 1 to 99 100
09000 09010 09020
Input (04000)
Unchanged
Result
Flag
F-10 09000 09010 09020 ADD
・Transition of result and flags
Rising edge of input signal (OFF to ON)
Contents of D
04000
When the input condition 04000 changes from OFF to ON, the contents of the register 09000 are added with the contents of the register 09010 and its result is stored in the register 09020. The contents of registers 09000 and 09010 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 コ0000 to コ1577 b0000 to b0777 09000 to 09777 19000 to 19777 29000 to 29777 39000 to 39777
Contents of S1 Contents of S2
Instruction 04000
STR F-10
Instruction STR 04000 F-10 09000 09010 09020 F-10 09001 09011 09021
9-37
2 3 Thousands Hundreds 09001 0 0 0 1 0 1 0 1 1
5
1 0 0 0 0 0 0 1 09010 +
8 1 Thousands Hundreds 0 1 1 0 0 1 1 1 09011 6 7 Tens Ones 0 0 0 0 0 1 0 0 09020 0 4 Thousands Hundreds 1 0 0 0 0 0 1 1 09021 8
3
・The above example shows the case of 1523+6781=8304. ・If programmed from lower digit, the carry information will be carried on to upper digit.
Page 113
Add register and register (BCD 4 digits) (ADD)
F-10w ADD
F-10w ADD
Symbol
S2
S1
〔Example for use〕
D
Function
The contents of the registers S1, S1+1 are added with the contents of the registers S2, S2+1 in BCD 4 digits and its result is stored in the registers D, D+1.
Operation
(S1, S1+1) + (S2, S2+1) →D, D+1
Range of S1
Range of S2
Range of D
Condition
9
04000
Instruction 04000
STR F-10w
19000 19002 19004
F-10w 19000 19002 19004 ADD
When the input condition 04000 changes from OFF to ON, the 4 digits BCD contents of the registers 19000 and 19001 are added with the contents of the registers 19002 and 19003 and its result is stored in the registers 19004 and 19005.
コ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 コ1576 b0000 to b0776 09000 to 09776 19000 to 19776 29000 to 29776 39000 to 39776
19001
19000
0110011110001001
6
7
8
9
+ 19003
19002
0001001000110100
1
2
3
19005
Rising edge of input signal (OFF to ON)
4 19004
1000000000100011 Contents of S1,S1+1 Contents of S2,S1+2
Unchanged
Contents of D
Lower 2 digits of the result Upper 2 digits of the result
After Contents operation of D+1
8
0
2
3
Unchanged
Result
Unchanged when the contents of registers S1, S1+1, S2 and S2+1 are not BCD code.
Zero 07357
Carry 07356
Error Non-carry 07354 07355
1 0 0 1 0 0 0 1 1 1 0 0 10001 and above 0 1 0 0 Not BCD code 0 0 1 0 Note 1: Be sure to use even addresses for registers S and D. Similarity instructions: F-10, Fc10, Fc10w
Flag
0 1 to 9999 10000
Reference 19003
As double length operation is possible for the F-10w instruction, same as the F-10 instruction, write F-10w instruction in succession to add 5 digits or more BCD.
19002
19001
19000
10000111011001010100001100100001
8
7
6
5
4
3
2
1
+
00001
F-10w 19000 19004 19010 ADD
F-10w 19002 19006 19012 ADD
19007
Instruction STR 00001 F-10w 19000 19004 19010 F-10w 19002 19006 19012
19006
19005
19004
10011001100110011001100110011001
9
9
9
19013
9
9
19012
9
9
19011
9
19010
10000111011001010100001100100000
8
9-38
7
6
5
4
3
2
0
Page 114
Add register (BCD 2 digits) and constant (BCD 2 digits) (ADD)
Fc10 ADD
Fc10 ADD
Symbol
S1 n
Instruction 04001
〔Example for use〕
D
Function
The contents of the register S1 are added with the 2 digits BCD constant "n" and its result is stored in the register D.
Operation
S1+n→D
Range of S1
コ0000 to コ1577 b0000 to b0777 09000 to 09777 19000 to 19777 29000 to 29777 39000 to 39777
STR Fc10 04001
Fc10 09000 ADD
85
09000 85 09002
09002
When the input condition 04001 changes from OFF to ON, the contents of the register 09000 are added with the BCD constant 85 and its result is stored in the register 09002. It operates in the same timing as the F-10 instruction.
Range of "n" 00 to 99 コ0000 to コ1577 b0000 to b0777 09000 to 09777 Range of D 19000 to 19777 29000 to 29777 39000 to 39777
Condition
After operation
09000
00010011 1
3
+ BDC constant 85
9
10000101 8
Rising edge of input signal (OFF to ON)
10011000
Flag
0 1 to 99 100 101 and above S1 is not BCD code
Zero 07357
Carry 07356
1 0 1 0 0
0 0 1 1 0
9
Error Non-carry 07354 07355
0 0 0 0 1
1 1 0 0 0
Similarity instructions: F-10, F-10w, Fc10w Reference Similar to the F-10 instruction, it is possible to add 3 digits or more of BCD value.
00100
Fc10 09000 ADD
Fc10 09001 ADD
25
48
09020
09021
Instruction 00100 STR Fc10 09000 25 09020 Fc10 09001 48 09021
09001
09000
0010011101000110
2
7
4
6
+ 0100100000100101
4
8
2
09021
5 09020
0111010101110001
7
9-39
8
5
Contents Unchanged of S1 Contents ・Lower 2 digits of the result ・Unchanged when the contents of the of D register S1 are not BCD code. Result
09002
5
7
1
Page 115
Add register (BCD 4 digits) and constant (BCD 4 digits)
Fc10w ADD
Fc10w ADD
Symbol
S1 n
〔Example for use〕
D
Function
The BCD 4 digits contents of the registers S1, S1+1 are added with the 4 digits BCD constant "n" and its result is stored in the registers D, D+1.
Operation
(S1, S1+1) +n→D, D+1
Range of S1
コ0000 to コ1576 b0000 to b0776 09000 to 09776 19000 to 19776 29000 to 29776 39000 to 39776
02001
Fc10w 19500 2345 ADD
Condition
9
19501
コ0000 to コ1576 b0000 to b0776 09000 to 09776 19000 to 19776 29000 to 29776 39000 to 39776
Unchanged
Contents of D
Lower 2 digits of the result Upper 2 digits of the result
Flag
4
3
2
1
BDC constant 2345 0010001101000101
2
3
4
19601
Unchanged when the contents of registers S1 and S1+1 are not BCD code.
Zero 07357
Carry 07356
0 1 to 9999 10000
1 0 1 0 0
0 0 1 1 0
0 0 0 0 1
6
As double length operation is possible for the Fc10w instruction, same as the Fc10 instruction, write Fc10w instruction in succession to add 5 digits or more of BCD.
19010
6
6
Instruction STR 00001 Fc10w 19000 6789 19006 Fc10w 19002 2345 19010
19002
19001
19000
10000111011001010100001100100001
7
6
5
4
3
2
1
+ 00100011010001010110011110001001
2
Fc10w 19002 2345 ADD
6
19003
8
19006
19600
0110011001100110
1 1 0 0 0
Reference
Fc10w 19000 6789 ADD
5
Error Non-carry 07354 07355
Note 1: Be sure to use even addresses for registers S1 and D. Similarity instructions: F-10, F-10w, Fc10
00001
19500
+
Result
10000 and above Not BCD code
19500 2345 19600
0100001100100001
Rising edge of input signal (OFF to ON)
Contents of S1,S1+1
Contents of D+1 After operation
19600
When the input condition 02001 changes from OFF to ON, the 4 digits BCD contents of the registers 19500 and 19501 are added with the BCD constant 2345 and its result is stored in the registers 19600 and 19601.
Range of "n" 0000 to 9999
Range of D
Instruction 02001
STR Fc10w
3
4
19011
5
6
19010
7
8
19007
9
19006
00010001000100010001000100010000
1
9-40
1
1
1
1
1
1
0