6 Application Instructions API 00-49 API 39 Operands: S : Start No. of stack data D : Device of stack data read out n : Length of stack data Explanations: 1. Range of n : 2 ~ 512 2. See the specifications of each model for their range of use. 3. Flag: M1020 (zero flag) 4. The stack data of n words starting from S are defined as “first-in, first-out” stack data. After the content in S minuses 1, the content in the device designated by ( S + 1) will be written into the location designated by D , and ( S + n -1) ~ ( S + 2) will all right shift for one register while the content in ( S + n -1) remains the same.
When the content in S equals 0, this instruction will not process any new value read out and the zero flag M1020 = On. 5. This instruction adopts pulse execution instructions (SFRDP) Program Example: 1. When X0 = Off→On, the content in D1 will be sent to D21 and D9~D2 will shift to the right for 1 register (content in D9 remains unchanged) and the content in D0 minus 1. 2. The figure below illustrates the shift and reading in 1~3 execution of the instruction. The content in D1 is sent to D21. D9 ~ D2 shift to the right for 1 register. The content in D0 minuses 1. X0 data read Remarks:
This instruction can be used together with API 38 SFWR for the reading/writing of “first-in, first-out” stack data. DVP-PLC Application Manual 6-60 Mnemonic Operands Function SFRD P Shift Register Read Type OP Bit Devices Word Devices Program Steps X Y M S K H KnX KnY KnM KnS T C D E F SFRD, SFRDP: 7 steps S * * * * * * D * * * * * * * * n * * PULSE 16-bit 32-bit EH3 V SV2 ES EX SS S EH3 ES EX SS SA SX SC EH SV EH3 SV2 ES EX SS SA SX SC EH S A SX SC EH SV SV2 SFRDP D0 D21 K10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0 D21 pointer D9 D8 D7 D6 D5 D4 D3 D2 D1 D0 D21