The text of a manual · part 21 of 37
Sharp Programmable Controller New Satellite JW10 User's Manual: Chapter 9 Description of Instructions, pages 166 to 175
Pages 166 to 175 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 166
F-80 IORF Symbol
I/O refresh (1 byte) (I/O ReFresh) F-80 IORF
〔Example for use〕
D
Function
Refreshes input/output port byte data assigned by D.
Operation
Input port D Output port D
Range of D
コ0000 to コ0077
Condition
When the input signal is ON (not limited to an OFF to ON change)
After operation
Input port Output port
Flag
04000
F-80 IORF
コ0000
Instruction 04000 STR F-80 コ0000
When input condition 04000 is ON, the JW10 refreshes one byte data of コ0000.
Update of data memory Update of output state Unchanged
Note 1: This instruction can be used any number of times during program operation. Note 2: The I/O port which is data refreshed with this instruction performs the data refresh operation also during an ordinary I/O processing of scan cycle.
9
F-81 IORF Symbol
I/O refresh (1 bit) (I/O ReFresh) F-81 IORF n
〔Example for use〕
D
Function
Refreshes input/output port nth bit data assigned by D.
Operation
Input port nth bit of D Output port nth bit of D
Range of n
0 to 7
Range of D
コ0000 to コ0077
Condition
When the input signal is ON (not limited to an OFF to ON change)
After operation
Input port Output port
Flag
04000
F-81 IORF
1
コ0001
Instruction 04000 STR F-81 1 コ0001
When input condition 04000 is ON, the JW10 refreshes first bit (00011) data of コ0001.
Update of data memory Update of output state Unchanged
Note 1: This instruction can be used any number of times during program operation. Note 2: The I/O port which is data refreshed with this instruction performs the data refresh operation also during an ordinary I/O processing of scan cycle.
9・ 91
Page 167
Remark (REMark)
F-90 REM
〔Description〕 • Symbols and comments for F-90 are registrered with "symbol/comment setting" by multipurpose programmer or ladder software. When printing ladder chart and instruction (Symbol: 16 half characters, Comments: 28 half words, executed printing line comment on characters) • When printing ladder chart, the multipurpose Function the multipurpose programmer (JW-50PG etc.) and ladder software (JW-50SP/52SP/ programmer or ladder chart prints symbol and 92SP). comment contents. It does not print F-90 instruction in this case. NOP (This instruction does not cause the If @ is registered at first character of the symbol, Operation PC to perform an operation) it is paged and symbol comment contents are not printed. Range of "n" 0000 to 3777 (8) • When printing instructions, the multipurpose programmer or ladder chart prints each of F-90 instruction and symbol/comment contents. After Data memory of flag etc. is unchanged. Even if @ is registered at first character of the operation symbol contents, paging is not executed and the registered contents are printed. F-90 REM
Symbol n
〔Example for use〕 (1) Ladder chart programming 00000
(2) Symbol/comment setting 00400
( )
9
F-90 F-90
F-90 0010 REM 00100 00102
Address Symbol Comment 0010 No.10 Error processing 0011 @ Paging when printing ladder chart
00401
( ) 00101
(3) Ladder chart printing 00000
(4) Instruction printing 00400
( ) No.10:Error processing 00100 00102
00401
( )
STR OUT F-90[REM] STR OR AND OUT
00101
9・ 92
00000 00400 0010 No.10:Error processing 00100 00101 00102 00401
Page 168
F-140 LABL
Set label (LABeL)
Symbol
F-140 LBn LABL
Use to set Jump destination for the F-141 (JMP) instruction. Branch destination for the F-142 (CALL) instruction. Branch destination for timer interrupt. Branch destination for high-speed counter interrupt.
Function
Range of LBn LB 000 to LB167 (8) LB170 LB171 LB172 LB173 to LB176 LB177 〔Example for use〕 04000
00000 00001
F-140 LB002 LABL 04000
F-00 09000 09001 XFER
00002 04000
F-140 LB005 LABL
04001
Adrs 00000 00001 00002 00003 00004 00005 00006 00007 00010 00011 00012 00013 00014 00015
: For F-141, F-142 : For high-speed counter (mode 1) : For high-speed counter (mode 1-2) : For high-speed counter (mode 2) : Reserved : 10 ms timer interruption Instruction STR 00000 F-140 is a jump or subroutine label which is not to 00001 execute the program. Therefore, the data memory OR OUT 04000 is retained after execution of an F-140 instruction. F-140 LB002 STR 04000 F-00 09000 09001 STR 00002 AND 04000 OUT 04001 F-140 LB005
Note 1: The same label number should not be used again within the program.
9・ 93
9
Page 169
F-141 JMP
Jump to label (JuMP)
Symbol
F-141 LBn JMP
Function
The control jumps to the label address LBn (F-140).
Range of LBn LB000 to LB167 (8) When the input signal is ON (not to limited to OFF to ON change)
F-141 LB100 JMP
00001
F-141 LB005 JMP
00777 STR 01000 F-141 ※ 01001
……
00000
9
F-140 LB100 LABL
……
F-140 LB005 LABL
Adrs Instruction 00005 F-140 00006 LB005
00000 When the input condition 00000 is ON, the control jumps to the program address 02005 of the label LB100 LB100 and instructions after the address 02007 are executed.
……
〔Example for use〕
……
Condition
02002 STR 00001 When the input condition 00001 is ON, the control 02003 F-141 jumps to the program address 00005 of the label 02004 LB0005 LB0005 and instructions after the address 00007 are executed. 02005 F-140 02006 LB100
Note 1: The contents of the data memory are not affected after execution of an F-141 instruction. Note 2: Execution may be done with F-41 (JCS) and F-42 (JCR) for the location indicated with an ※ mark, the execution time may be saved if an F-141 (JMP) is used as it does not execute instruction down to F-140 (LABL). Note 3: Same number may be used for the label of an F-141 instruction at any time. Note 4: Because the control does not execute down to the jump address with an F-141 instruction, an F-40 (END) will be disregarded even if there is an F-40 before the jump address. Note 5: The jump address label (F-140) should be written in the program, in order to avoid malfunction that may occur if there is not a jump address.
9・ 94
Page 170
Note 6: Though the same operation takes place for the program examples 1 and 2 that had been programmed using an F-140 (LABL) or F-141 (JMP), the F-00 (XFER) instruction may not be valid for the example 1. Operation wise, the F-141 is executed Programming example 1
00000
04000 A and the control jumps to the destination specified by the F-141 instruction, when the contact 04000 (A contact) turns ON for both examples. And, the F-00 is executed when a next contact 04000 (B contact) is ON.
×
Programming example 2
04000
F-44 ↑
00000
F-141 LB100 JMP
04000 A
○
04000
F-44 ↑
F-141 LB100 JMP
F-40 END F-40 END
F-140 LB100 LABL 04000 B
F-00 09100 09130 XFER
F-140 LB100 LABL
F-40 END
F-47 ONLS
9 04000 B
F-00 09100 09130 XFER F-48 ONLR
F-40 END
• Regarding the programming example 1, the F-141 is executed in the first cycle the contact 04000 (A contact) had turned ON and the control jumps to the destination specified by the F-141. For the next contact 04000 (B contact) has been ON after the jump was made, the F-00 is executed. However, the F-00 is not executed in the second cycle after the contact 04000 (A contact) has turned ON even if it is ON. Because the F-00 does not recognize the rising edge of the signal, as both contents of the accumulator before one scan cycle and the current contents of the accumulator is ON.
• Regarding the programming example 2, the F-00 after the jump is executed in the second cycle after the contact 04000 (A contact) has turned ON. This is because the level operation condition (F-47, F48) is provided so as to execute the instruction after the jump at the time of ON. Reference The F-00 instruction compares the contents of the previous contents of the accumulator with the current contents and executes the program when a rising edge is recognized. Therefore, it has to be programmed like the example 2 in order to execute the program at every operational cycle after a jump.
9・ 95
Page 171
F-142 CALL F-143 RET Symbol Function
Call subroutine label (CALL) Return from subroutine (Return) F-142 LBn CALL
F-143 RET
The control jumps to the subroutine of LBn (F-140) and returns with an F-143 instruction.
Range of LBn LB000 to LB167 (8) Condition
Rising edge of input signal (OFF to ON)
〔Example for use〕
00001
F-142 LB000 CALL
Adrs Instruction 00010 STR 00000 00011 F-142 00012 LB000 00100 STR 00101 F-142 00102
Main program 00002
····
F-142 LB000 CALL
····
00000
9
00200 STR 00201 F-142 00202
F-40 END
Subroutine program
LB000
LB000 ····
····
F-143 RET
00002
····
····
00300 F-40 00301 F-140 00302
F-140 LB000 LABL
LB000 ····
····
F-142 LB000 CALL
00001
00315 F-143
Use of an F-142 (CALL) and F-143 (RET) in the program not only eliminates need of writing the same program repeatedly within the program and saves the program size, but it will also help structuring program.
In the above example, when the input condition 00000 changes from OFF to ON, the control jumps from the main program to the subroutine to execute the addresses 00303 through 00314, and returns to resume executing the main program at the address 00013 when an F-143 instruction is met.
Note 1: The F-143 (RET) instruction is also used to program a subroutine for high speed counter interrupt (set with #203) or timer interrupts (set with #244). Note 2: When a subroutine is called, instructions within the subroutine are set to level operation with an ON state of signal. Note 3: The following instructions may not be used within a subroutine. TMR, CNT, F-30 (MCS), F-31 (MCR), F-40 (END), F-41 (JCS), F-42 (JCR), F-44 ( ↑ ), F-45 ( ↓ ), F47 (ONLS), F-48 (ONLR) Note 4: Main program must be created first before subroutine is created and it must be affixed with an F-40 (END instruction) at the end address. Note 5: Nesting is not allowed for a subroutine.
Note 6: Execution conditions of F-142 (CALL) cannot be used commonly with instructions after this F-142 (CALL).
9・ 96
00070
F-142 LB000 CALL F-63 09300 INC
00070
F-142 LB000 CALL
00070
F-63 09300 INC
×
○
Page 172
F-144 FOR F-145 NEXT Symbol Function
Set loop count (FOR) End of loop (NEXT) F-144 FOR
F-145 NEXT n
Repeats to execute the program "n" times between F-144 (FOR) and F-145 (NEXT).
Range of "n" 000 to 377 (8) (256 times if 000) Condition
Rising edge of input signal (OFF to ON)
〔Example for use〕 00001
00001
F-144 FOR
Instruction 00001 STR F-144 004 00001 STR F-63 19000 F-145
004
F-63 19000 INC F-145 NEXT
When the input condition 00001 changes from OFF to ON, the F-63 (INC) instruction is repeated for four times.
00001
19000
Note 1: The F-144 (FOR) must be used in conjunction with the F-145 (NEXT). Note 2: When the F-144 (FOR) is executed, instructions between the F-144 (FOR) and F-145 (NEXT) are set ON level active. Note 3: When the instruction is not execution, the contents of the data memory between the F-144 (FOR) and F-145 (NEXT) do not change. Note 4: Execution conditions of F-144 (FOR) cannot be commonly used with execution conditions of instruction after F-144 (FOR).
00040
F-144 FOR
000 (8)
00040
9
014
006
F-63 09350 INC
F-144 FOR
010
Note 5: The follwing instructions cannot be inserted between F-144 (FOR) and F-145 (NEXT). TMR, CNT, F-30 (MCS), F-31 (MCR), F-40 (END), F-41 (JCS), F-42 (JCR), F-44 ( ↑ ), F-45 ( ↓ ), F-47 (ONLS), F-48 (ONLR), F-141 (JMP), F-144 (FOR), F-145 (NEXT) Note 6: Number of instruction between F-144 (FOR) and F-145 (NEXT) should be small as possible and consider operation time. Note 7: Double-length operation is possible for the F-10 instruction, but the operation flag of the instruction of B as following program will not affect the instruction of A.
04000
00040
004
×
04000
006
F-63 09350 INC
F-144 FOR
F-10 09000 09002 09004 ADD
A
F-10 09001 09003 09005 ADD
B
F-145 NEXT
○ 9・ 97
010
Page 173
F-210 ADD Symbol
Add register and register in binary (8 bits + 8 bits) (ADD) F-210 ADD
S1
S2
〔Example for use〕
D
Instruction 04001 STR F-210 09000 09010 09020
The contents of the register S1 are added in binary with the contents of the register S2 and its result is stored in the register D.
04001
Function Operation
S1+S2→D
When the input condition 04001 changes from OFF to ON, the contents of the register 09000 and the register 09010 are added in binary and stored in the register 09020.
Range of S1
Range of S2
Range of D
Condition
9
After operation
コ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
Before operation
+
Above 401 (8)
1 0 1 0 1 0 0 0 09020
09010 0 1 0 0 1 1 0 1 1011011 + 1001101 10101000
09000 1 0 1 1 0 0 1 1
Contents Unchanged of S1 Contents Unchanged of S2 Contents Result of D
Flag
After operation
09000 0 1 0 1 1 0 1 1
Rising edge of input signal (OFF to ON)
Result 0 001 to 377 (8) 400 (8)
F-210 09000 09010 09020 ADD
+
0 1 0 0 1 1 0 0 09020
09010 1 0 0 1 1 0 0 1
Zero 07357
Carry 07356
1 0 1 0
0 0 1 1
Error Non-carry 07354 07355
0 0 0 0
1 1 0 0
(Similarity instructions) F-210w, Fc210, Fc210w
9・ 98
Carry 1 (07356)
10110011 +10011001 101001100
Page 174
F-210w ADD
Add register and register in binary (16 bits + 16 bits) (ADD) F-210w ADD
Symbol
S1
S2
〔Example for use〕
D
Function
The contents of the registers S1 and S1+1 are added in binary with the contents of the registers S2 and S2+1 and its results are stored in the registers D and D+1.
Operation
(S1, S1+1) + (S2, S1+1)→D, D+1
Range of S1
Range of S2
Range of D
Condition
04001
F-210w 09000 09010 09020 ADD
Instruction 04001 STR F-210w 09000 09010 09020
When the input condition 04001 changes from OFF to ON, the contents of the registers 09000 and 09001 are added in binary with the registers 09010 and 09011 and its results are stored in the registers 09020 and 09021.
コ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
09001
09000
1000010010101100
+ 09011
09010
0010110010110010
Rising edge of input signal (OFF to ON)
Contents of S1, S1+1 Contents of S2, S2+1
09021
Unchanged Unchanged
Contents Lower digits of result of D Contents After Upper digits of result operation of D+1 Zero Carry Result 07357 07356 0 1 0 Flag 000001 to 177777 0 0 1 1 200000 Above 200001 0 1
09020
1011000101011110
Error Non-carry 07354 07355
0 0 0 0
1 1 0 0
Note 1: Be sure to use even addresses for registers S1, S2, and D. Similarity instructions: F-210, Fc210, Fc210w
9・ 99
9
Page 175
Fc210 ADD Symbol
Add register and constant in binary (8 bits + 8 bits) (ADD) Fc210 ADD
S1 n
〔Example for use〕
D
Contents of the register S1 are added in binary with the contents of an octal constant "n" and its result is stored in the register D.
04000
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
When the input condition 04000 changes from OFF to ON, the contents of the register 09000 are added in binary with the octal constant 377 and its result is stored in the register 09020.
Function
Range of "n" 000 to 377 (8)
Range of D
Condition
コ0000 to コ1577 b0000 to b0777 09000 to 09777 19000 to 19777 29000 to 29777 39000 to 39777
Flag
+ Octal constant 1 1 1 1 1 1 1 1 377
Rising edge of input signal (OFF to ON)
Result
Zero 07357
Carry 07356
0 001 to 377 (8) 400 (8)
1 0 1 0
0 0 1 1
Above 401 (8)
377
09020
After operation
09000 1 0 1 0 1 0 1 0
Contents Result of D After operation
Fc210 09000 ADD
Before operation
Contents Unchanged of S1
9
Instruction 04000 STR Fc210 09000 377 09020
Error Non-carry 07354 07355
0 0 0 0
1 1 0 0
Similarity instructions: F-210, F-210w, Fc210w
9・ 100
1 0 1 0 1 0 0 1 09020