
7 APPLICATION INSTRUCTION
7.8 Random Number Instruction
465
7
7.8
Random Number Instruction
Generating random number
RND(P)
These instructions generate a pseudo-random number ranging from 0 to 32767, and store it as a random number to a device
specified by (d).
Setting data
■
Descriptions, ranges, and data types
■
Applicable devices
Processing details
• These instructions generate a pseudo-random number ranging from 0 to 32767, and store it as a random number to a
device specified by (d).
• In the pseudo-random number sequence, the source value of a random number is calculated every time, and this
instruction calculates a pseudo-random number using the source value.
*1
To (SD8311, SD8310), write a non-negative value (0 to 2,147,483,647) only once when the CPU module mode switches from STOP to
RUN. (K1 is written to (SD8311, SD8310) as the initial value when the power is restored.)
Operation error
There is no operation error.
Ladder diagram
Structured text
ENO:=RND(EN,d);
ENO:=RNDP(EN,d);
Operand
Description
Range
Data type
Data type (label)
(d)
Head device number storing a random number
16-bit signed binary
ANY16
Operand
Bit
Word
Double word
Indirect
specification
Constant
Others
X, Y, M, L,
SM, F, B, SB
U
\G
T, ST,
C, LC
T, ST, C, D,
W, SD, SW, R
U
\G
Z
LC
LZ
K, H
E
$
(d)
Pseudo-random number calculation equation:
(SD8311, SD8310)=(SD8311, SD8310)
11012345
(d) ="([SD8311, SD8310]>>16)&<logical product>00007FFFh"
(d)
Summary of Contents for MELSEC iQ-F FX5 series
Page 1: ...MELSEC iQ F FX5 Series Programming Manual Instructions Standard Functions Function Blocks ...
Page 2: ......
Page 21: ...19 PART 1 PART 1 OVERVIEW Part 1 consists of the following chapter 1 OVERVIEW ...
Page 98: ...96 4 STANDARD FUNCTIONS FUNCTION BLOCKS 4 2 Standard Function Blocks MEMO ...
Page 840: ...838 23 TIME DATA FUNCTIONS 23 4 Division MEMO ...
Page 887: ......