欢迎图片
Version 2.1 by Iris on 2025/10/21 13:59

Hide last authors
Iris 1.2 1 === **SFRD/Shift Read** ===
Iris 1.1 2
Iris 1.2 3 **SFRD(P)**
Iris 1.1 4
5 Data read instructions for first-in, first-out and control.
6
7 -[SFRD (s)  (d) (n)]
8
9 **Content, range and data type**
10
11 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
12 |(s)|(((
13 The start word device number storing data
14
15 (The start is a pointer, and the data starts from (s)+1)
16 )))|-|Signed BIN 16 bit|ANY16
17 |(d)|The word device number storing the first-out data|-|Signed BIN 16 bit|ANY16
18 |(n)|It should be specified as the value of the number of points + 1 of the stored data. +1 is pointer|2 to 512|Signed BIN 16 bit|ANY16
19
20 **Device used**
21
22 |(% rowspan="2" %)**instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|**Index modification**|(((
23 **Pulse**
24
25 **extension**
26 )))
27 |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP**
28 |(% rowspan="3" %)SFRD|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | | | | |●|●
29 |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|●
30 |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|●
31
32 **Features**
33
34 Transfer (s)+1 written sequentially to (d) by SFWR instruction, shift up each point (n)-1 by one word from (s)+1. The number of stored data of (s) subtracts one.
35
36 The content of (s)+1 is transferred (read) to (d). At the same time, the content of the pointer (s) decreases, and the data is shifted up by 1 word each. (In the continuous execution instruction SFRD, each operation cycle will shift, so the pulse execution instruction SFRDP should be used for programming).
37
Iris 1.3 38 (% style="text-align:center" %)
39 [[image:1761018188037-771.png]]
Iris 1.1 40
Iris 1.3 41
Iris 1.1 42 **Related device **
43
44 |**Devices**|**Name**|**Content**
45 |SM153|Zero bit|Data readout usually starts from (s)+1, but when the pointer (s) is 0, the zero bit SM153 will operate.
46
47 **✎Note: **
48
49 The data after reading would not change the content of (s)+(n) due to reading.
50
51 In the case of continuous execution (SFRD) instructions, each scan time (operation cycle) will be read sequentially, but the content of (s) + (n) would not change. When the pointer (s) is 0, it would become no processing, and the content of (d) would not change.
52
53 **Error code**
54
55 |**Error code**|**Content**
56 |(% rowspan="2" %)4084H|When the value set in (n) is other than the following. 2≤(n)≤512
57 |A negative value is specified in (s).
58 |4085H|When the device specified in the read application instruction (s) and (n) exceeds the corresponding device range.
59 |4086H|When the device specified in the write application instruction (s) and (d) exceeds the corresponding device range.
60
61 **Example**
62
63 The following examples illustrate the use of shift write (SFWR) and shift read (SFRD) instructions.
64
65 (1) Action content
66
Iris 1.4 67 1) While registering the product number, in order to realize the first-in-first-out principle, the following introduces an example of a ladder ladder diagram that outputs the current product number.
Iris 1.1 68
Iris 1.4 69 2) The product number is a hexadecimal number with 4 digits or less, and the maximum inventory is below 99 points.
Iris 1.3 70
Iris 1.1 71 (2) Program
72
Iris 1.4 73 1) Program 1
Iris 1.1 74
Iris 1.4 75 (% style="text-align:center" %)
76 [[image:1761018361678-654.png]]
Iris 1.1 77
Iris 1.4 78 (% style="text-align:center" %)
79 [[image:1761018410107-778.png||height="328" width="445"]]
Iris 1.1 80
Iris 1.4 81 2) Program 2
Iris 1.1 82
Iris 1.4 83 (% style="text-align:center" %)
84 [[image:1761018480645-416.png]]
Iris 1.1 85
86
87 Turn X0 from OFF to ON, and this instruction acts according to the following numbers 1 to 3. (The content of D10 remains unchanged),
88
89 * The content of D2 is read out and sent to D20.
90 * D10 to D3 all shift one register to the right.
91 * The contents of pointer D1 are reduced by 1.
92
Iris 1.4 93 === **POP/Read From the Back of the Data Table** ===
Iris 1.1 94
95 **POP(P)**
96
Iris 1.2 97 Read the last data written by the shift write instruction (SFWR) for first in first out/first in last out control. 
Iris 1.1 98
99 -[POP  (s)  (d)  (n)]
100
101 **Content, range and data type**
102
103 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
104 |(s)|The start device number that stores the first-in data (including pointer data) (the start word device number that stores data)|-|Signed BIN 16 bit|ANY16
105 |(d)|The device number that stores the last-out data|-|Signed BIN 16 bit|ANY16
106 |(n)|The points of stored data|2 to 512|Signed BIN 16 bit|ANY16
107
108 **Device used**
109
110 |(% rowspan="2" %)**instruction**|(% rowspan="2" %)**parameter**|(% colspan="24" %)**Devices**|**Index modification**|(((
111 **Pulse**
112
113 **extension**
114 )))
115 |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP**
116 |(% rowspan="3" %)POP|Parameter 1| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|●
117 |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|●
118 |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|●
119
120 **Features**
121
122 For the word device of "(s) to (s)+(n)-1", the device of "(s) + instruction data (s)" will be read to (d) ( The last data written by the shift write instruction (SFWR) for first-in first-out control is read to (d)). (N) Specifies 2 to 512.
123
124 The value of pointer data (s) is reduced by one.
125
126 First-in-last-out control data
127
128 | |**Content**
129 |(S)|Pointer data (the number of stored data)
130 |(S)+1|(% rowspan="7" %)(((
131 Data field
132
133 (Data entered by shift write instruction (SFWR))
134 )))
135 |(S) +2
136 |(S) +3
137 |......
138 |(S)+(n)-3
139 |(S)+(n)-2
140 |(S)+(n)-1
141
142
Iris 1.4 143
144 (% style="text-align:center" %)
145 [[image:1761018592821-392.png]]
146
Iris 1.1 147 **✎Note: **
148
149 **✎**If the POP(P) instruction is programmed in continuous execution type, the instruction will be processed per cycle. Therefore, it may not be possible to achieve the desired action. Generally, POP(P) instruction programming should be executed with "pulse execution type" or "pulse specified contact".
150
151 **✎**When the current value of pointer (s) is 0, the zero flag SM153 turns on, and the POP(P) instruction becomes no processing.
152
153 **✎**When the current value of pointer (s) is 1, write 0 to (s), and the zero flag SM153 turns on.
154
155 **Error code**
156
157 |**Error code**|**Content**
158 |(% rowspan="3" %)4084H|(s)>(n)-1
159 |(s)<0
160 |Data outside the specified range is entered in (n). 2≤(n)≤512
161 |4085H|When the device specified in the read application instruction (s) and (n) exceeds the corresponding device range
162 |4086H|When the device specified in the write application instruction (s) and (d) exceeds the corresponding device range
163
164 **Example**
165
Iris 1.4 166 (% style="text-align:center" %)
167 [[image:1761018612253-455.png]]
Iris 1.1 168
169 Each time M1 is ON, for the values of D20 input first in D101 to D106, the last saved value would be saved in D10, and then the data saved number (pointer D100) will be reduced by 1.
170
171 When the data entered first is the content in the table below.
172
173 |**Pointer**|D100|K3
174 |(% rowspan="6" %)**Data**|D101|H1234
175 |D102|H5678
176 |D103|HABCD
177 |D104|H0000
178 |D105|H0000
179 |D106|H0000
180
181
182
Iris 1.4 183 (% style="text-align:center" %)
Iris 2.1 184 [[image:1761018751619-514.png||height="262" width="620"]]
Iris 1.1 185
Iris 1.4 186 === **SFWR/Shift Write** ===
Iris 1.1 187
Iris 1.4 188 **SFWR(P)**
189
Iris 1.1 190 Data writing instructions for first-in-first-out and control.
191
192 -[SFWR (s)  ( d) (n)]
193
194 **Content, range and data type**
195
196 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
197 |(s)|The word device number that stores the data you want to enter first|-|Signed BIN 16 bit|ANY16
198 |(d)|The start word device number for storing data and shifting (the start is pointer, and data starts from (d)+1)|-|Signed BIN 16 bit|ANY16
199 |(n)|The value of points + 1 of stored data should be specified|2 to 512|Signed BIN 16 bit|ANY16
200
201 **Device used**
202
203 |(% rowspan="2" %)**instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|**Index modification**|(((
204 **Pulse**
205
206 **extension**
207 )))
208 |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP**
209 |(% rowspan="3" %)SFWR|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|●
210 |Parameter 2| | | | | | | | | | | |●|●|●|●|●|●|●|●| | | | | |●|●
211 |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|●
212
213 **Features**
214
215 Start from (d)+1, write the contents of (s) to point (n)-1, and the stored data of (d) add one. For example, if (d)=0, write to (d) +1, (d)=1, write to (d)+2.
216
217 Through the first execution, the content of (s) is stored to (d)+1 and becomes the value of (s).
218
219 If the content of (s) is changed and executed for the second time, the content of (s) is stored to (d)+2, and the content of (d)+2 becomes (s) (in the continuous execution instruction SFWR, each operation cycle will be stored sequentially, so the pulse execution instruction SFWRP should be used for programming). After that, the data will be filled in sequentially from the right, and the number of data storage points is displayed by the content of the pointer (d).
220
Iris 1.4 221 [[image:1761018913263-720.png]]
Iris 1.1 222
Iris 1.4 223
Iris 1.1 224 **Related device**
225
226 |**Devices**|**Name**|**Content**
227 |SM151|carry|When the content of pointer (s) exceeds (n)-1, it becomes no processing (no writing), and the carry flag SM151 turns ON.
228
229 **✎Note: **
230
231 In the continuous execution type (SFWR) instruction, you should be noted that each scan time (operation cycle) will be stored (overwritten) sequentially.
232
233 **Error code**
234
235 |**Error code**|**Content**
236 |(% rowspan="2" %) 4084H|When the value set in (n) is other than the following. 2≤(n)≤512
237 |A negative value is specified in (d).
238 |4085H|When the device specified in the read application instruction (s), (d) and (n) exceeds the corresponding device range.
239 |4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range.
240
241 **Example**
242
243 The following examples illustrate the use of shift write (SFWR) and shift read (SFRD) instructions.
244
Iris 2.1 245 (1) Action content
Iris 1.1 246
Iris 2.1 247 1) While registering the product number, in order to realize the first-in-first-out principle, the following introduces an example of a ladder ladder diagram that outputs the current product number.
Iris 1.1 248
Iris 2.1 249 2) The product number is a hexadecimal number with 4 digits or less, and the maximum inventory is below 99 points.
250
Iris 1.1 251 (2) Program
252
Iris 2.1 253 1) Program 1
Iris 1.1 254
Iris 2.1 255 (% style="text-align:center" %)
256 [[image:1761025772517-240.png]]
Iris 1.1 257
Iris 2.1 258 (% style="text-align:center" %)
259 [[image:1761025809106-559.png||height="382" width="528"]]
Iris 1.1 260
Iris 2.1 261 2) Program 2
Iris 1.1 262
Iris 2.1 263 (% style="text-align:center" %)
264 [[image:1761025894776-671.png||height="130" width="570"]]
Iris 1.1 265
266
267 When X0=1, the content of D0 is stored in D2, and the content of D1 becomes 1. When X0 changes from OFF to ON again, the content of D0 is stored in D3, the content of D1 becomes 2, and so on. If the content of D1 exceeds n-1, the instruction is not processed, and the carry flag M8022 will be set to 1.
268
Iris 2.1 269 === **FINS/Data Table Data Insertion** ===
Iris 1.1 270
Iris 2.1 271 FINS(P)
Iris 1.1 272
273 Insert the BIN 16-bit data specified in (s) into the number (n) of the data table specified in (d). After the instruction is executed, the data starting with number (n) in the data table will be postponed downward one by one.
274
275 -[FINS (s) (d) (n)]
276
277 **Content, range and data type**
278
279 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
280 |(s)|The start number of device storing the inserted data|-|Signed BIN 16 bit|ANY16
281 |(d)|The starting number of table|-|word|ANY16
282 |(n)|The position of the inserted table|1-512|Signed BIN 16 bit|ANY16
283
284 **Device used**
285
286 |(% rowspan="2" %)**instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|**Index modification**|(((
287 **Pulse**
288
289 **extension**
290 )))
291 |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP**
292 |(% rowspan="3" %)FINS|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|●
293 |Parameter 2| | | | | | | | | | | | | | |●|●|●|●|●| | | | | |●|●
294 |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|●
295
296 **Features**
297
298 Insert the BIN 16-bit data specified in (s) into the number (n) of the data table specified in (d). After the instruction is executed, the data starting with number (n) in the data table will be postponed downward one by one.
299
Iris 2.1 300 (% style="text-align:center" %)
301 [[image:1761025985201-177.png||height="245" width="556"]]
Iris 1.1 302
303 * N: the number of data storage;
304 * DTr: data table range;
305 * When (n)=2, it will be inserted into (d)+2.
306
307 ✎Note:
308
309 ✎The range of device used in the data table is managed by user.
310
311 ✎The range of the data table is (d) started from device (d) +1) after the number of data (d).
312
313 Error code
314
315 |**Error code**|**Content**
316 |(% rowspan="4" %)4084H|FINS(P) instruction is executed when the value of (d) is 0.
317 |The storage data of the table of (d) exceeds 512.
318 |When the data set in (n) is other than the following, 1≤(n)≤512.
319 |When the FINS(P) instruction is executed, the table position (n) of the inserted data is greater than data storage number.
320 |4085H|When the device specified in the read application instruction (s), (d) and (n) exceeds the corresponding device range.
321 |4086H|When the device specified in the write application instruction (d) exceeds the corresponding device range.
322
323 **Example**
324
Iris 2.1 325 (% style="text-align:center" %)
326 [[image:1761026072396-253.png||height="80" width="604"]]
Iris 1.1 327
328 When X10=ON, insert the data of D100 into No. 3 of the data table of D0 to D4.
329
330 However, when the number of saved data exceeds 7, the FINS(P) instruction is not executed (the device range used in the data table is D0 to D7).
331
Iris 2.1 332 === **FDEL/Data Deletion of Data Sheet** ===
Iris 1.1 333
Iris 2.1 334 FDEL(P)
Iris 1.1 335
336 Delete the (n)th data of the data table specified in (d) and store it in the device specified in (s). After the instruction is executed, the data after (n)+1 in the data table will be postponed forward one by one.
337
338 -[FDEL (s)  (d) (n)]
339
340 **Content, range and data type**
341
342 |**Parameter**|**Content**|**Range**|**Data type**|**Data type (label)**
343 |(s)|The start number of the device stored deleted data|-|Signed BIN 16 bit|ANY16
344 |(d)|The starting number of the table|-|word|ANY16
345 |(n)|The position of the deleted table|1-512|Signed BIN 16 bit|ANY16
346
347 **Device used**
348
349 |(% rowspan="2" %)**instruction**|(% rowspan="2" %)**Parameter**|(% colspan="24" %)**Devices**|**Index modification**|(((
350 **Pulse**
351
352 **extension**
353 )))
354 |**X**|**Y**|**M**|**S**|**SM**|**T(bit)**|**C(bit)**|**LC(bit)**|**HSC(bit)**|**D.b**|**KnX**|**KnY**|**KnM**|**KnS**|**T**|**C**|**D**|**R**|**SD**|**LC**|**HSC**|**K**|**H**|**E**|**[D]**|**XXP**
355 |(% rowspan="3" %)FDEL|Parameter 1| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | | | | |●|●
356 |Parameter 2| | | | | | | | | | | | | | |●|●|●|●|●| | | | | |●|●
357 |Parameter 3| | | | | | | | | | |●|●|●|●|●|●|●|●|●| | |●|●| |●|●
358
359 **Features**
360
361 Delete the (n)th data of the data table specified in (d) and store it in the device specified in (s). After the instruction is executed, the data after (n)+1 in the data table will be postponed forward one by one.
362
Iris 2.1 363 (% style="text-align:center" %)
364 [[image:1761026280809-833.png||height="271" width="659"]]
Iris 1.1 365
Iris 2.1 366
Iris 1.1 367 **✎Note:**
368
369 **✎**The user is responsible for the management of the device range used in the data sheet.
370
371 **✎**The range of the data table is (d) after the data storage number (d) of the device ((d) + 1).
372
373 **Error code**
374
375 |**Code**|**Content**
376 |(% rowspan="4" %)4084H|FDEL(P) instruction is executed when the value of (d) is 0.
377 |The storage data of the table of (d) exceeds 512.
378 |When the data set in (n) is other than the following, 1≤(n)≤512.
379 |When the FDEL(P) instruction is executed, the table position (n) of the deleted data is greater than data storage number.
380 |4085H|When the device specified in the read application instruction (d) and (n) exceeds the corresponding device range.
381 |4086H|When the device specified in the write application instruction (s) and (d) exceeds the corresponding device range.
382
383 **Example**
384
Iris 2.1 385 [[image:1761026311306-866.png]]
Iris 1.1 386
387 When X10 is ON, delete the second data in the data table of D100 to D105, and save the deleted data in D0. However, when the number of data saved is 0, do not execute the FDEL instruction. (The device range used in the data table is D100 to D107.)
388
Iris 2.1 389 (% style="text-align:center" %)
390 [[image:1761026366795-447.png]]
Iris 1.1 391
392