The text of a manual · part 19 of 37
Sharp Programmable Controller New Satellite JW10 User's Manual: Chapter 9 Description of Instructions, pages 146 to 155
Pages 146 to 155 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 146
Differentiate at OFF
F-45 ↑
The F-45 instruction sends 1 scan time pulse when the immediate state of the accumulator changes from OFF to ON.
00000 00001 F-45
Instruction 00000 STR 00001 AND F-45 04001 OUT
04001
00000
00001 Output 04001 1scan time
1scan time
(Note 4) Note 1: Use of the F-45 instruction may sometimes generate 1 scan time pulse at the operation 00010 00011 immediately following program writing, that is, when the address of F-45 instruction is changed because of 00012 program insertion or deletion. 00000
F-45
F-45
04002
00400
Accumulator ACC
STR 00011
Output 04002
F-45
1scan time
OR
1scan time
00010 00011 00012 STR 00400
Stack register S1
00010
STR 00010 00000
STR STR F-45 OR AND OUT
00011
00011
F-45
00011
F-45
00012
00010
00010
00010
00012 00010 00011 F-45
AND STR
Output (04002) turns ON if input (00000) is OFF at the start of operation immediately after write of program.
00012 00010 00011 F-45
OUT 00100 Note 2: The F-45 instruction scans only once even if inserted between an F-47 instruction (level operation condition set) and an F-48 instruction (level operation condition reset). (See page F-47 and F-48.)
00012
The accumulator turns ON for only a scan cycle that 00011 changed from OFF to ON. 00010
Note 3: This instruction does not perform an 00011 operation during the 1 scan time when the power is turned ON or immediately after the start of the 00012 operation mode.
△t
00400 △t 1 scan time
Differentiate signal not issued
In the above example, a differential signal is not issued even if 00010 has changed from ON to OFF when 00011 is ON, because 00010 is ANDed by the AND/STR instruction.
9・ 71
9
Page 147
ON level set (ON Level Set) ON level reset (ON Level Reset)
F-47 ONLS F-48 ONLR
Set to execute operation conditions of the instruction, which shall be executed at rising edge (from OFF to ON) of the input signal, when the input signal is ON.
Instruction
F-47 ONLS 04001
F-47 STR F-63
F-63 09000 INC
04001 09000
F-48 F-48 ONLR
1 scan time
Scan cycle
9
04001
09000
000
001
002
003
Note 1: Another F-47 may not be nested between already existing F-47 (ONLS) and F-48 (ONLR). Note 2: Only 1 scan will take place at a rising edge of the operation condition, if it contains a differentiate instruction (F-44, F-45). (Example for F-44)
F-47 ONLS 04001 F-44
F-63 09000 INC
F-48 ONLR
1 scan time
Scan cycle
04001
09000
000
001
9・ 72
004
005
006
Page 148
F-50 4→16 Symbol
Decode 4 to 16 F-50 4→16
S
D
Function
The lower 4 bits data in the register S are decoded and stored in the 2 bytes area of the registers D and D+1.
Operation
S→D, D+1
Range of S
Range of D
Condition
After operation
〔Example for use〕
04006
F-50 コ0000 09350 4→16
コ0000 09350
When the input condition 04006 changes from OFF to ON, the lower 4 bits data of コ0000 are decoded and stored as 16 bits data in the 2 bytes area consisting of registers 09350 and 09351.
コ0000 to コ1577 b0000 to b0777 09000 to 09777 19000 to 19777 29000 to 29777 39000 to 39777 コ0000 to コ1576 b0000 to b0776 09000 to 09776 19000 to 19776 29000 to 29776 39000 to 39776
76543210 コ0000
0101 5
Contents Unchanged of S Contents Result (0 to 7) of D Contents Result (8 to 15) of D+1
0 0 1 0 0 0 0 0 09350 15 14 13 12 11 10 9 8 0 0 0 0 0 0 0 0 09351
Rising edge of input signal (OFF to ON)
Flag
Instruction STR 04006 F-50
Only the bit position that corresponds to the low order 4 bits representing 0 to 15 is turned ON, and other bits are turned OFF.
9
Unchanged
Note 1: Upper 4 bits of S are disregarded.
F-51 16→4 Symbol
Encode 16 to 4 F-51 16→4
S
D
Function
The 2 bytes data in registers S and S+1 are encoded and stored in the register D.
Operation
S, S+1→D
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 コ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
Contents Unchanged of S, S+1 Contents Result of D
Flag
〔Example for use〕 04001
Instruction 04001 STR F-51
F-51 コ0000 09000 16→4
コ0000 09000
When the input condition 04001 changes from OFF to ON, the 2 bytes data consisting of registers コ0000 and コ0001 are encoded and stored in the register 09000.
Input
After operation
76543210 コ0000 0 0 0 0 0 0 0 0
0 0 0 0 1 1 1 0 09000 14
151413121110 9 8 コ0001 0 1 0 0 0 0 0 0 MSB
Unchanged
Note 1: After the operation, the upper 4 bits of D (09000 in the example) become 0 at all times. Note 2: The MSB of the encoder input takes the highest priority. 9・ 73
76543210 コ0000 1 0 0 0 1 1 0 0 151413121110 9 8 コ0001 0 0 0 1 0 1 1 0 MSB
After operation 0 0 0 0 1 1 0 0 09000 12
Page 149
F-52 →7SEG Symbol
F-52 →7SEG
S
The lower 4 bits data in register S is decoded into 7 segments display data.
Operation
S→D
Range of D
〔Example for use〕
D
Function
Range of S
9
Decode to 7 segments data
04001
F-52 09000 コ0040 →7SEG
Before operation
After operation -ditto-
0111
09000
D7 コ0000 × × × × × × × ×
D0
00100111 g f e d c b a
LED display a
Condition
Rising edge of input signal (OFF to ON)
After operation
Contents Unchanged of S Contents Result (Refer to "7 segments decoder chart") of D f
Unchanged
09000 コ0040
When the input condition 04001 changes from OFF to ON, the lower 4 bits data of the register 09000 are decoded into the 7 segments display data. See "7 segments decoder chart" relation between input data and display output.
コ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
Flag
Instruction 04001 STR F-52 g e b c d
Output module
Output data D0 to D6 correspond to a to g of the 7 segments display, respectively. The output of D7 is always 0. a f
7 segments decoder chart Input data
9・ 74
Output data g f ed c ba
00000000
00111111
00000001
00000110
00000010
01011011
00000011
01001111
00000100
01100110
00000101
01101101
00000110
01111101
00000111
00100111
00001000
01111111
00001001
01101111
00001010
01110111
00001011
01111100
00001100
00111001
00001101
01011110
00001110
01111001
00001111
01110001 g e b c d
Display output
Page 150
Convert 4 digits BCD to 16 bits binary
F-53 →BIN
F-53 →BIN
Symbol
Range of S
Range of D
Condition
S, S+1→D, D+1 コ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 D After operation Contents
Flag
04001
F-53 コ0000 09000 →BIN
Tens
9
6
Result (256 to 9999) Zero Contents of registers S,S+1 07357 BCD code 0 Not BCD code
4 Unchanged when the contents of the registers S and S+1 are not BCD code. Carry 07356
0
09000 0 0 0 0 0 0 0 0
27 12 20 2 =4096
Thousands Hundreds コ0001 0 1 0 0 0 0 0 0
Result (0 to 255)
After operation
Ones
コ0000 1 0 0 1 0 1 1 0
Unchanged
Instruction 04001 STR F-53 コ0000 09000
When the input condition 04001 changes from OFF to ON, the contents of the 4 digits BCD data in registers コ0000 and コ0001 are converted into binary, and its result is transferred and stored in 2 bytes area of registers 09000 and 09001.
Before operation
Rising edge of input signal (OFF to ON)
Contents of S, S+1 of D+1
〔Example for use〕
D
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.
Function Operation
S
0 BCD 4096
09001 0 0 0 1 0 0 0 0
215
28
BIN(Binary)
Error Non-carry 07354 07355
0 1
0
Note 1: If the F-53 instruction is used for programming, the F-03w instruction displays the program during monitoring. Similarity instructions: F-03, F-03w
9・ 75
9
Page 151
F-54 →BCD Symbol
Convert 16 bits binary to 6 digits BCD F-54 →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
F-54 →BCD
Instruction 04001 STR F-54 コ0000 09000
コ0000 09000
When the input condition 04001 changes from OFF to ON, the contents of 2 bytes binary in registers コ0000 and コ0001 are converted into 6 digits BCD and stored in 3 bytes area of registers that begin from 09000. Before operation
After operation Tens
コ0000 0 0 0 0 0 0 0 0
2
7
2
Ones
09000 0 1 1 0 1 0 0 0 0
6
8
Thousands Hundreds
Condition
Rising edge of input signal (OFF to ON) コ0001 1 0 0 0 0 0 0 0
9
After operation
Contents of S, S+1
Unchanged
Contents of D
Result (ones and tens)
Contents of D+1 Contents of D+2
Result (hundreds and thousands)
Flag
215
Binary
28
09001 0 0 1 0 0 1 1 1
2
7 Ten thousands
09002 0 0 0 0 0 0 1 1
0
3
BCD 6 digits 032768
Result (ten thousands)
Unchanged
Note 1: If the F-54 instruction is used for programming, the F-04w instruction displays the program during monitoring. Similariry instructions: F-04, F-04w
9・ 76
Page 152
F-55 SWAP Symbol
Swap upper 4 bits with lower 4 bits F-55 SWAP
S
〔Example for use〕
D
Function
Upper 4 bits are swapped with lower 4 bits of the register S and stored in the register D.
Operation
S→D
Range of S
Range of D
Rising edge of input signal (OFF to ON)
After operation
Contents Unchanged of S Contents Result of D
F-58 ΣBIT Symbol
09001 × × × × × × × ×
09001 1 1 1 1 0 0 0 0
Total ON bits F-58 ΣBIT n
S
〔Example for use〕
D
ON bits→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
4
コ0006 09000
コ0007 0 1 1 0 1 1 1 0
00001101
09000
13 (D)
コ0010 0 0 0 0 1 0 0 0 コ0011 1 0 0 1 0 0 1 1
Among 32 bits in コ0006 to コ0011, 13 bits are ON.
Unchanged
Contents Result of D
Flag
F-58 ΣBIT
コ0006 1 1 0 0 1 0 0 0
Rising edge of input signal (OFF to ON) Contents of S, S+1,… S+n-1
04002
Instruction 04002 STR F-58 4 コ0006 09000
When the input condition 04002 changed from OFF to ON, the total number of active bits in a 4 bytes register headed by the register コ0006 is stored in the register 09000.
Range of "n" 0 to 7 (8 bytes for 0)
After operation
09000 0 0 0 0 1 1 1 1
9
Operation
Condition
09000 0 0 0 0 1 1 1 1
F-55 becomes valid in the following case. With the F-52 (7 SEG decode) instruction, the lower 4 bits are decoded into the 7 segments display data. To display a multiple number of digits on the display, the upper 4 bits need to be swapped with the lower 4 bits, then F-52 should be executed.
All active bits in the "n" byte register having the register S at its top are stored in the register D.
Range of D
After operation
Unchanged
Function
Range of S
09000 09001
Before operation
Condition
Reference
F-55 09000 09001 SWAP
When the input condition 04001 changes from OFF to ON, upper 4 bits are swapped with lower 4 bits of the register 09000 and its result is stored in the register 09001. The contents of the register 09000, however, remains 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
Flag
04001
Instruction 04001 STR F-55
Unchanged
9・ 77
Page 153
F-60 SFR
Shift register bidirectional (1 byte) (forward/backward ShiFt Register)
Symbol
① ② ③ ④
Function
① ② ③ ④
F-60 D SFR
Shift direction input Data input Shift input Reset input
The 8 bits data in the register S is shifted to upper or lower bit positions according to the direction input of ①. • When the shift direction input is ON :
Operation
Range of Register D Condition
• When the shift direction input is OFF :
Carry 07356
MSB
Register D
LSB
Data input
Data input
MSB
Register D
LSB
Carry 7356
コ0000 to コ1577 b0000 to b0777 09000 to 09777 19000 to 19777 29000 to 29777 39000 to 39777 When the reset input ④ is OFF, bits are shifted at a rising edge (OFF to ON) of the shift input ③. Contents of D
After operation
• Result is produced when the reset input ④ is OFF. • All bits are turned OFF when the reset input ④ is ON. Reset input ④
Zero 07357
Carry 07356
OFF
0 or 1
0 or 1
Flag
Error 07355
Non-carry 07354 1 or 0
0 ON
0
0
0
9 〔Example for use〕 Shift direction 04012 Data input 00100 Shift input 00000
F-60 09000 SFR
Reset input 04013
When the shift input 00000 changes from OFF to ON, shift takes place in the following way according to the state of the shift direction input 04012.
Instruction 04012 STR 00100 STR 00000 STR 04013 STR F-60 09000
• When 04012 is ON 07356
09000 MSB
00100 LSB
Carry • When 04012 is OFF 00100
07356 MSB
LSB Carry
Input condition
09000 (before operation) 7
6
5
4
3
2
1
0
09000 (after operation) 7
6
5
4
3
2
1
0
Zero 07357
Carry 07356
Non-carry 07354
04012 00100 00000 04013 04012 00100 00000 04013 04012 00100 00000 04013 04012 00100 00000 04013
4013 •
Error flag (07355) is OFF at all times.
OFF
ON
Note 1: By setting the reset condition in the system memory for reset input ④ (#202), it permits to "reset with OFF." Similarity instructions: F-60w
9・ 78
Page 154
Reference When コ×××× is assigned for D, it allows to constitute an "n" bit (n<8) shift register. 00200
00100
F-60 コ0400
00000
SFR 00110
00450
04003
(When 00200 is ON)
07356 (Not used)
04007 04006 04005 04004 04003 04002 04001 04000
00100
04003 turns ON at the same time with 00450 00450.
9
00200
00100 00000 OFF 00110
04000 04001 04002 04003 00450
• Data are shifted in 04004 to 04007. • When all of 04000 to 04007 are 0, the zero flag turns to 1. The following program must be used to check that 04000 to 04002 are 0. 00000
Fc13 AND
007
コ0400
Fc12 コ0400 CMP
000 00600
07357
(Zero flag) 0
0
7
0 0 0 0 01 1 1
By ANDing this way, 04003 to 04007 are masked (all 0).
9・ 79
Page 155
F-60w SFR
Shift register bidirectional (1 word) (forward/backward ShiFt Register) ① ② ③ ④
Symbol
Function
F-60w SFR
D
① ② ③ ④
Shift direction input Data input Shift input Reset input
The 16 bits contents of the registers D, D+1 are shifted to upper or lower bit positions according to the direction input of ①. • When the shift direction input ① is ON: Carry 07356
Operation
Register D
LSB
Data input
LSB
Carry 07356
• When the shift direction input ① is OFF: Register D+1
MSB
Data input
Register D
Range of D
コ0000 to コ1576 b0000 to b0776 09000 to 09776 19000 to 19776 29000 to 29776 39000 to 39776
Condition
When the reset input ④ is OFF, bits are shifted at a rising edge (OFF to ON) of the shift input ③. Contents of D, D+1
9
Register D+1
MSB
After operation
• Result is produced when the reset input ④ is OFF. • All bits are turned OFF when the reset input ④ is ON. Reset input ④
Zero 07357
Carry 07356
OFF
0 or 1
0 or 1
Flag
Error 07355
Non-carry 07354 1 or 0
0 ON
0
0
0
Note 1: Be sure to use even address for register D. Note 2: By setting the reset input ④ in the system memory (#202), it permits to "reset with OFF."
〔Example for use〕 00000
Instruction 00000 STR 00001 STR 00002 STR 00003 STR F-60w 09000
00001
Similarity instructions: F-60
F-60w 00002
SFR
09000
00003
00000 ① ON 00001 ② ON 00002 ③ OFF→ON 00003 ④ OFF
Shifts towards MSB Data input ON Shift direction No reset function
The following result will be produced for the above input condition. 09001
09000
Before operation 1 0 0 1 0 1 1 0 1 0 1 0 0 1 0 0
09001 After operation
Zero 07357 0
9・ 80
09000
0 0 1 0 1 1 01 0 1 0 0 1 0 0 1
Carry 07356 1
Error 07355 0
Non-carry 07354 0