Delta AH500 — 6.16.2 Explanation of Floating-point Number Instructions

AH500 Programming Manual API 1517 Symbol: S 1 : Minimum value Word S 2 : Maximum value Word D : Device in which the result is stored Word Explanation: 1. The instruction is used to generate the random number within the range between the minimum value in S 1 and the maximum value in S 2 , and the result is stored in D . 2. If the value in S 1 is larger than the value in S 2 , the values in S 1 and S 2 are taken as the maximum value and the minimum value respectively when the instruction is executed. Example: When X0.0 is ON, the random number within the range between the minimum value in D0 and the maximum value in D10 is generated, and the result is stored in D20. Additional remark:

The values in S 1 and S 2 should be within the range between 0 and 0~32767. If the value in S 1 or S 2 exceeds the range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003. 6-348 Instruction code Operand Function RAND P S , S , D 1 2 Random number Device X Y M S T C HC D L SM SR E PR K 16# “$” DF S 1            S 2            D          Pulse instruction 16-bit instruction (7 steps) 32-bit instruction AH500 AH500 -