Last modified by Stone Wu on 2022/08/01 07:34

Hide last authors
Leo Wei 1.1 1 = **STL/RET step ladder diagram instruction** =
2
3 STL: step ladder diagram starts
4
5 RET: step ladder diagram ends
6
7 (% style="text-align:center" %)
8 [[image:13_html_1ebc646f4789caba.png||class="img-thumbnail"]]
9
10 **Content, range and data type**
11
12 (% class="table-bordered" %)
13 |**Parameter**|**Content**|**Range**|**Data type**|**Data type(Label)**
14 |(d)|State assigns the number of destination step relay|0 to 4,095|bit|ANY_BOOL
15
16 **Device used**
17
18 (% class="table-bordered" %)
19 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="1" %)**Device**|(((
20 **Offset modification**
21 )))|(((
22 **Pulse expansion**
23 )))
24 |**S**|**[D]**|**XXP**
25 |STL|Parameter 1|●| |
26
27 **Features**
28
29 ① Programs that use step ladder diagram are based on the mechanical actions, and assign step relay S according to each process. It acts as a loop connected in the state contact (STL contact), and carries on the sequential control programming of input condition and output control.
30
31 ② In step ladder diagram, consider step relay S as a control process and carries on the sequential control programming of input condition and output control. As the process operates, the previous process would be not executed. Therefore, the mechanical control could be performed by the simple sequential control of each process.
32
33 ③ For a series of step ladder diagram, start with the initialization state, and program in the order of the states to be transferred.
34
35 (% style="text-align:center" %)
36 [[image:13_html_36482a910ef0eac5.gif||class="img-thumbnail"]]
37
38 Step ladder diagram exhibits relay ladder program, you could use state to program according to the flow of mechanical control. It could be thought of that state and relay are the same, which consist of drive coil and contact(STL contact).
39
40 Coil drives use SET instruction and OUT instruction, and contacts use STL instruction.
41
42 The internal loop actions connect to the status are as follows.
43
44 (% class="table-bordered" %)
45 |(% colspan="2" %)**Internal loop action**
46 |ON execution|If the status is ON, the loop that connected to this outputs actions by STL.
47 |(((
48 OFF execution
49
50 (one operation cycle)
51 )))|(((
52 If the condition set in the transition of the state (transition condition) is satisfied, the next state is set to ON, and the state previous ON is turned OFF(reset). (Transition action) During state transition, only one operation cycle will both states be ON at the same time.
53
54 After the transition, the state before the transition is turned OFF(reset) in the next operation cycle. Regardless of the state of the contact before the drive command, the drive instruction connected to the bus in the OFF state is only executed when it is OFF for one operation cycle (the same action as when the contact is OFF).
55
56 However, when the transition state is used by the contact instruction, the contact image is turned OFF and executed after the transition condition is satisfied.
57 )))
58 |No execution|After the next operation cycle that after OFF is executed, the action of OFF execution of the instruction is not performed. (jump state)
59
60 The sequence chart of the state (internal loop)execution state is as below.
61
62 (% style="text-align:center" %)
63 [[image:13_html_d996d472c1ce5d44.gif||class="img-thumbnail"]]
64
65 Each state has three functions of drive processing on the load, specifying the transition target, and specifying its transition conditions. As shown below, execute the drive processing on the load first, and then execute the sequential execution of the transfer processing. In the state without load, no drive processing is required
66
67 (% style="text-align:center" %)
68 [[image:13_html_2e008aa6a244ae7e.gif||class="img-thumbnail"]]
69
70 Step ladder programs execute the following actions
71
72 (% style="text-align:center" %)
73 [[image:13_html_65cbca9b51b2217c.gif||class="img-thumbnail"]]
74
75 1. It is recommended that contacts be programmed in the output drive.
76 1. The output coil could be programmed repeatedly in different states.
77 1. The OUT and SET instructions of stepping relay automatically reset the state before the transfer.
78 1. It is not recommended to use the same stepping relay (S) number repeatedly
79 1. Pointers(P) cannot be configured immediately after STL instruction. If configured, a program error occurs.
80
81 **Key points**
82
83 The action state of stepping relay set to be saved after power-off is backed up by the non-volatile memory. These stepping relays are used when a power failure occurs in the middle of the mechanical operation, and when the power is turned on again and you want to continue the operation from there. Besides, since these stepping relays keep operating even from RUN to STOP, when RUN is executed again, the operation will be restarted from the state before STOP.
84
85 1. STL instruction can not be used in Interrupt routine, event routine and subroutine.
86 1. When using STK instruction in interrupt routine, please do not use SET instruction or the driving state S of the OUT instruction.
87 1. It is not that the use of jump instructions (CJ/CJP) in the state is prohibited. It is recommended to not use it as much as possible because it will cause complex actions.
88
89 (% style="text-align:center" %)
90 [[image:13_html_dba26d70ca6d6ddf.gif||class="img-thumbnail"]]
91
92 **✎Note: **The pointer P could be set to the first instruction in STL without contacts, so the first instruction is regarded as irrelevant to the STL action below.
93
94 **Device used**
95
96 (% class="table-bordered" %)
97 |**Device**|**Name**|**Content**
98 |SM240|Transfer prohibited|If SM240 is set ON, all the transfers between the states are prohibited.
99 |SM246|STL operation|If SM247 and stepping relay ( device S ) are both ON, SM246 will be ON automatically.
100 |SM247|STL valid monitoring|If SM247 is set to ON, the number of stepping relay in operating in stepping relay would be stored in SD240 to SD247 from least to most.
101 |SD240 to SD247|ON stepping relay number|The number of the stepping relay to be ON is stored in SD240 to SD247 (up to 8)from least to most.
102
103 **✎Note:**
104
105 Stepping relay(S) without setting lock is cleared by turning the power ON to OFF and RUN to STOP. If the power is turned ON to OFF and RUN to STOP while the status is valid, the process cannot be restarted from the middle.
106
107 **Error code**
108
109 No errors.
110
111 **Program**
112
113 (((
114 Open M2, state relay S1is set to ON,the programs in STL S1 are executed normally.
115
116 Open M4, if S1 is ON, the state S11/S12 can be selected for transition according to the OFF/ON of M7, and the state S1 can be reset.
117
118 When M7 is OFF, transfer to S11
119
120 When M7 is ON, transfer to S12
121
122 (% style="text-align:center" %)
123 [[image:13_html_e18dd8e05b5bbb36.png||class="img-thumbnail"]]
124 )))
125
126 = **IST/Initialization state** =
127
128 In the program that using stepping ladder diagram, the initialization state and special relays are automatically controlled.
129
130 (% style="text-align:center" %)
131 [[image:13_html_2725ba6a9256465.png||class="img-thumbnail"]]
132
133 **Stepping ladder diagram program**
134
135 **Content, range and data type**
136
137 (% class="table-bordered" %)
138 |**Parameter**|**Content**|**Range**|**Data type**|**Data type(label)**
139 |(s)|Start bit device number of the run mode switch|~-~-|bit|(((
140 ANYBIT_ARRAY
141
142 (element number: 8)
143 )))
144 |(d1)|The minimum state number of the useful state in automatic mode ((d1)<(d2))|~-~-|bit|ANY_BOOL
145 |(d2)|The maximum state number of the useful state in automatic mode ((d1)<(d2))|~-~-|bit|ANY_BOOL
146 |EN|Execution condition|~-~-|bit|BOOL
147 |ENO|Execution result|~-~-|bit|BOOL
148
149 **Device used**
150
151 (% class="table-bordered" %)
152 |(% rowspan="2" %)**Instruction**|(% rowspan="2" %)**Parameter**|(% colspan="6" %)**Device**|(((
153 **Offset modification**
154 )))|(((
155 **Pulse expansion**
156 )))
157 |**X**|**Y**|**M**|**S**|**SM**|**D.b**|**[D]**|**XXP**
158 |(% rowspan="3" %)IST|(s)|●|●|●| |●|●| |
159 |(d1)| | | |●| | | |
160 |(d2)| | | |●| | | |
161
162 Only device S could be used.
163
164 **Features**
165
166 **(1) IST**
167
168 1) Specify the start input of run mode in (s).
169
170 2) The switch for selecting the run mode occupies 8 points from the start bit device.
171
172 3) The device specified by the switch for selecting the run mode.The switch functions in the following table and X20 are separately assigned to the devices specified by the switch for selecting the run mode. Under the circumstances, to prevent X20 to X24 from being ON at the same time, a rotary switch must be used. Switches that are not in use need no wiring. However, these switches cannot be used for other purposes because they are occupied by IST instructions,
173
174 (((
175 (% class="table-bordered" %)
176 |**Source address**|(% style="width:149px" %)(((
177 **Device number**
178
179 **(example)**
180 )))|(% style="width:178px" %)**Switch function**|(% style="width:1051px" %)**Content**
181 |(s)|(% style="width:149px" %)X20|(% style="width:178px" %)Individual run|(% style="width:1051px" %)Uses each button to turn the each load on or off.
182 |(s)+1|(% style="width:149px" %)X21|(% style="width:178px" %)Origin reset|(% style="width:1051px" %)Press the origin reset button to automatically return the machine to the origin.
183 |(s)+2|(% style="width:149px" %)X22|(% style="width:178px" %)Stepping|(% style="width:1051px" %)Each time the start button is pressed, it advances one process.
184 |(s)+3|(% style="width:149px" %)X23|(% style="width:178px" %)Cycle run once|(% style="width:1051px" %)(((
185 If the start button is pressed at the origin, it will stop at the origin after executing one cycle of automatic operation.
186
187 If the stop button is pressed in the middle, the process will be stopped, and if the start button is pressed again, the operation will continue from there, and then automatically stop at the origin.
188 )))
189 |(s)+4|(% style="width:149px" %)X24|(% style="width:178px" %)continuous run|(% style="width:1051px" %)If the start button is pressed at the origin position, continuous repeated run starts. If the stop button is pressed, the run will stop after reaching the origin.
190 |(s)+5|(% style="width:149px" %)X25|(% style="width:178px" %)Start origin reset|(% style="width:1051px" %)Uses each button to turn the each load on or off.
191 |(s)+6|(% style="width:149px" %)X26|(% style="width:178px" %)Start automatically|(% style="width:1051px" %)Start stepping, cycle run once, continuous run
192 |(s)+7|(% style="width:149px" %)X27|(% style="width:178px" %)Stop|(% style="width:1051px" %)Stop run
193 )))
194
195 4) he minimum state number of the useful state in (d1).(automatic mode)
196
197 5) The maximum state number of the useful state in (d2).(automatic mode)
198
199 6) When the instructions are When the instruction input is ON, the following devices are automatically switched and controlled. It does not change when the instruction input is OFF.
200
201 (% class="table-bordered" %)
202 |**Device number**|**Content**|(% colspan="2" %)**ON/OFF condition**
203 |(% rowspan="2" %)SM240|(% rowspan="2" %)Transfer prohibited|ON condition|(((
204 Always ON during individual run
205
206 Always ON Except that when the start button is pressed during stepping
207
208 When the stop button is pressed during origin reset and cycle run once.
209 )))
210 |OFF condition|(((
211 When the start button is pressed during stepping.
212
213 After the stop button is pressed during origin reset and cycle run once.
214 )))
215 |(% rowspan="2" %)SM241|(% rowspan="2" %)Start transfer|ON condition|(((
216 When the start button is pressed during origin reset and cycle run once.
217
218 After the start button is pressed during continuous run
219 )))
220 |OFF condition|(((
221 When it is from RUN to STOP
222
223 Always ON during individual run and origin reset
224
225 After the stop button is pressed during continuous run
226 )))
227 |(% rowspan="2" %)SM242|(% rowspan="2" %)Start pulse|ON condition|Only at the moment when the start button is pressed
228 |OFF condition|Except when it is ON
229 |(% rowspan="2" %)SM243|(% rowspan="2" %)Origin reset completion|ON condition|When the origin reset is completed (user program)
230 |OFF condition|(((
231 When it is from RUN to STOP
232
233 When the origin reset is not completed
234 )))
235 |(% rowspan="2" %)SM244|(% rowspan="2" %)Origin condition|ON condition|When the origin condition is satisfied (user program)
236 |OFF condition|(((
237 When it is from RUN to STOP
238
239 When origin reset is not completed
240 )))
241 |(% rowspan="2" %)SM245|(% rowspan="2" %)(((
242 All the output
243
244 reset prohibited
245 )))|ON condition|When not executing all the output resets (user program)
246 |OFF condition|When executing all the output resets (user program)
247 |(% rowspan="2" %)SM246|(% rowspan="2" %)STL state ON|ON condition|When STL monitoring valid is ON and any of the stepping relay(device S) is ON
248 |OFF condition|When STL monitoring valid is OFF, or when STL monitoring valid is ON and all the stepping relays(device S) are ON
249 |(% rowspan="2" %)SM247|(% rowspan="2" %)STL monitoring valid|ON condition|When issuing IST instruction
250 |OFF condition|When stepping ladder diagram ends(user program)
251
252 (% class="table-bordered" %)
253 |**Device number**|**Content**|(% colspan="2" %)**ON/OFF condition**
254 |(% rowspan="2" %)S0|(% rowspan="2" %)Initialization state of individual run|ON condition|When it is individual mode
255 |OFF condition|Except the individual mode
256 |(% rowspan="2" %)S1|(% rowspan="2" %)Initialization state of origin state|ON condition|When it is origin reset mode
257 |OFF condition|Except the origin reset mode
258 |(% rowspan="2" %)S2|(% rowspan="2" %)Initialization state of automatic run|ON condition|When it is automatic run mode
259 |OFF condition|Except the automatic run mode
260
261 7) Do not program the following states as normal states.
262
263 (((
264 (% class="table-bordered" %)
265 |**Device number**|**Content**|(% colspan="2" %)**ON/OFF condition**
266 |(% rowspan="2" %)S0 to S9|(% rowspan="2" %)(((
267 Occupied as initialization state
268
269 ✎S0 to S2 are used for individual run, origin reset and automatic run.
270
271 ✎S3 to S9 could be used freely.
272 )))|ON condition|When the step relay (S device) is selected as the initialization state.
273 |OFF condition|When the step relay (S device) is not selected
274 |(% rowspan="2" %)S10 to S19|(% rowspan="2" %)Occupied as origin reset|ON condition|When the step relay (S device) is selected as the origin reset.
275 |OFF condition|When the step relay (S device) is not selected
276 )))
277
278 8) When origin reset completion(SM243) is not ON, if switching between individual run(X20), origin reset(X21) and automatic run(X22,X23,X24), then all the output would be OFF. Automatic operation could be restarted after origin reset completion.
279
280 ✎**Note:**
281
282 1. Mode selection switches don’t need to be all used. Unused switches should be set to empty (cannot be used for other purposes). It is necessary to write the program of the IST instruction before a series of STL loops such as states S0 to S2.
283 1. S10 to S19 should be used for the state of the origin reset operation. In the final state of the origin reset operation, self-reset should be performed after SM243 is set
284 1. Only one IST instruction can be written in the program.
285
286 **(2) IST instruction equivalent loop**
287
288 1) The details of the special relay (SM) and initialization state (S0 to S9) that are automatically controlled by the IST instruction are shown in the following equivalent circuit. (Please read it as a reference.) This equivalent circuit could not be programmed.
289
290 (% style="text-align:center" %)
291 [[image:13_html_99e609560da46061.gif||class="img-thumbnail"]]
292
293 2) If the mode is switched between each, origin reset and automatic, when the machine is outside the origin position, all the outputs (output (Y) not driven by state and output (Y) driven by status by OUT and SET instructions) and the old state are reset in batches. The SM245 drive does not reset all outputs
294
295 (% style="text-align:center" %)
296 [[image:13_html_b4c1b1a6a939bc79.gif||class="img-thumbnail"]]
297
298 **(3) The example of importing IST instruction(workpiece transfer equipment)**
299
300 **Run mode**
301
302 (% style="text-align:center" %)
303 [[image:13_html_f814fecb839cc860.gif||class="img-thumbnail"]]
304
305 (% class="table-bordered" %)
306 |(% colspan="2" %)**Run mode**|**Operations**
307 |(% rowspan="2" %)Manual|Individual run|Uses each button to turn the each load on or off.
308 |Origin reset|Press the origin reset button to automatically return the machine to the origin.
309 |(% rowspan="3" %)Automatic|Stepping|Each time the start button is pressed, it advances one process.
310 |Cycle once|(((
311 If the start button is pressed at the origin, it will stop at the origin after executing one cycle of automatic operation.
312
313 If the stop button is pressed in the middle, the process will be stopped, and if the start button is pressed again, the operation will continue from there, and then automatically stop at the origin.
314 )))
315 |Continuous run|If the start button is pressed at the origin position, continuous repeated run starts. If the stop button is pressed, the run will stop after reaching the origin.
316
317 **Transfer equipment**
318
319 (% style="text-align:center" %)
320 [[image:13_html_3a954a32ec584e9b.gif||class="img-thumbnail"]]
321
322 1) To use IST instructions, mode inputs need to be assigned consecutive number inputs as shown below. When the numbers are not consecutive or a part of the mode is omitted, use the auxiliary relay to change the arrangement as shown in the figure below, and use it as the start input for mode specification.
323
324 (% class="table-bordered" %)
325 |**Input device**|**X20**|**X21**|**X22**|**X23**|**X24**|**X25**|**X26**|**X27**
326 |**Assignment**|Individual run|Origin reset|Stepping|Cycle run once|Continuous run|Origin reset start|Automatic start|Stop
327
328 (% style="text-align:center" %)
329 [[image:13_html_21a483e7a1e9a5cc.gif||class="img-thumbnail"]]
330
331 In this example, M0 is used as the start input for mode specification.
332
333 (% style="text-align:center" %)
334 [[image:13_html_e3eb050bd3aa4d3f.gif||class="img-thumbnail"]]
335
336 2) The special relay (SM) used in the IST instruction has different classifications. One is that the instruction itself is automatically controlled according to the situation and the other needs to be controlled by the program according to the preparation for operation and the purpose of control.
337
338 (% class="table-bordered" %)
339 |**Special relay**|**Content**|**Remark**
340 |(((
341 SM240
342
343 (Transfer prohibited)
344 )))|(((
345 Once the special relay is in operation, all the state transfers are prohibited.
346
347 Individual: SM240 continues operating.
348
349 Origin reset and cycle once: After pressing the stop button, the operation is held until the start button is pressed.
350
351 Stepping: SM240 continues operating, but only when the start button is pressed, it does not operate and the transfer is executed.
352
353 When switching STOP to RUN, the operation of programmable controller is held, and unlocked when the start button is pressed. Even when the transfer state is prohibited, the output in the state continues the origin operation.
354 )))|(% rowspan="4" %)IST instructions execute automatic control
355 |(((
356 SM241
357
358 (Start transfer)
359 )))|(((
360 An auxiliary relay as a transition condition from the initialization state S2 to the next state.
361
362 Individual and origin reset: No operation.
363
364 Stepping and cycle once: Only operates when the start button is pressed.
365
366 Continuous: The operation is held when the start button is pressed, and unlocked after pressing the stop button.
367 )))
368 |SM242(Start pulse)|Only operates at the moment of pressing the start button.
369 |(((
370 SM247
371
372 (STL monitoring valid)
373 )))|(((
374 After using the IST instruction, set SM247 to ON.When SM247 turns ON, the STL monitoring becomes valid, and the status numbers (S0 to S899) in operation are stored in the special registers SD240 to SD247 in ascending order.
375
376 Therefore, a maximum of eight operation states number can be monitored
377
378 Besides, if any of there states is in operation, special relay SM246 also operates.
379 )))
380 |(((
381 SM243
382
383 (Origin reset completion)
384 )))|In origin reset mode, when the machine returns to the origin, operates the special relay (SM) with the user program.|(% rowspan="3" %)Driven by sequential control program
385 |(((
386 SM244
387
388 (Origin condition)
389 )))|The special relay should be driven after detecting the origin condition of the machine. It is valid signal in all the modes.
390 |(((
391 SM245
392
393 (All the output reset prohibited)
394 )))|If switching between individual run, origin reset and automatic mode, when the machine is not in the origin, reset all the outputs and operation states. But if SM245 is driven first, then only the operation state is reset.
395
396 **Program**
397
398 3) When the machine is running, it could switch freely in "Automatic" mode (stepping/cycle once/continuous). In this case, to be safe, the switched mode becomes effective only after all outputs are reset once.(When SM245 (all the output reset prohibited) is set to ON, it will not be reset)
399
400 [[image:13_html_a01525c79014ab77.gif]]
401
402 1. No programming is required if there is no individual run mode.
403
404 (% style="text-align:center" %)
405 [[image:13_html_792e02bae5815ad7.gif||class="img-thumbnail"]]
406
407 4) No programming is required if there is no origin reset mode. But before automatic run, You need to reset the origin first to complete the SM243 set once
408
409 (% style="text-align:center" %)
410 [[image:13_html_512187f8478241a0.gif||class="img-thumbnail"]]
411
412 5) Automatic run (stepping/cycle once/continuous)
413
414 (% style="text-align:center" %)
415 [[image:13_html_8411c8555e38e3af.gif||class="img-thumbnail"]]
416
417 **Error code**
418
419 (% class="table-bordered" %)
420 |**Error code**|**Content**
421 |(% rowspan="2" %)4085H|When the device number specified by (d1) and (d2) is in the following case. (d1)>(d2)
422 |When the device specified in (s) couldn’t reserve eight points.