Mitsubishi — 5.6 Descriptions of the Applied Instructions

AH500 Motion Control Module Manual  S 1 : Minimum random value; S 2 : Maximum random value; D : Result  16-bit instruction: The value in S 1 and the value in S 2 are in the range of K0 to K32,767. 32-bit instruction: The value in S 1 and the value in S 2 are in the range of K0 to K2,147,483,647.  The value in S 1 must be less than the value in S 2 . If the value in S 1 is greater than the value in S 2 , an operation error will occur.  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. K4M0 and K4S16 (decimal numeral system).

Explanation  When X0.0 is ON, the instruction RAND is used to generate a random value in the range of the value in D0 to the value in D10, and the random value is stored in D20. Example X0.0 5-116 API Instruction code Operand Function 154 D RAND P S , S , D 1 2 Random value Device Xn.n Yn.n M S K 16# F KnM KnS D W T C V Z S 1           S 2           D         Pulse instruction 16-bit instruction (7 steps) 32-bit instruction (9 steps )    RAND D0 D10 D20