AH500 Motion Control Module Manual Explanation S : Device which is moved; D : Initial device; n : Number of devices The values in the n word devices starting from D are defined as first in, first out values, and D is taken as a pointer. When the instruction is executed, the value of the pointer D increases by one, and the value in S is written into the device to which the pointer D points. When the value of the pointer is greater than or equal to n -1, the instruction does not process the writing of the value, and a carry flag is ON. When the value of the pointer D is greater than n -1, the instruction does not process the writing of a value, and the carry flag SM22 is ON.
SM1066 is the carry flag in an Ox motion subroutine, and SM970 is the carry flag in O100. If KnM/KnS is used, it is suggested that M device numbers/S device numbers should start from a number which is a multiple of 16 in the decimal numeral system, e.g. K1M0 and K4S16 (decimal numeral system). Generally, the pulse instruction SFWRP is used. 2≤ n ≤512 SM20 is a zero flag, and SM968 is the zero flag in O100. The value of the pointer D0 is cleared to 0 first. When X0.0 is turned from OFF to ON, the value in D20 is written into D1, and the value of D0 becomes 1. When X0.0 is turned from OFF to ON again, the value in D20 is written to D2, and the value in D0 becomes 2.
The value in D20 is moved and written into D1 in the way described below. The value in D20 is written into D1. The value of D0 becomes 1. Example X1.0 The value of D0 is cleared to 0 first. X0.0 D 0 = 3 2 1 Additional remark The instruction SFWR can be used with the instruction SFRD to write a value and read values.
5-58 API Instruction code Operand Function Moving a value and 38 SFWR P S, D, n writing it into a word device Device Xn.n Yn.n M S K 16# F KnM KnS D W T C V Z S D n Pulse instruction 16-bit instruction (9 steps) 32-bit instruction – RST D0 .0 SFWRP D20 D0 K10 Source D20 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0 Poin D20 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0 Poin