Download Print this page

Random Number Instruction - Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual

Instructions, standard functions/function blocks
Hide thumbs Also See for MELSEC iQ-F FX5:

Advertisement

8.10

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).
Ladder diagram
(d)
FBD/LD
EN
ENO
d
Setting data
■Descriptions, ranges, and data types
Operand
Description
(d)
Head device number storing a random number
EN
Execution condition
ENO
Execution result
■Applicable devices
Operand
Bit
X, Y, M, L, SM,
F, B, SB, S
(d)
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.
Pseudo-random number calculation equation:
(SD8311, SD8310)=(SD8311, SD8310)
(d) ="([SD8311, SD8310]>>16)&<logical product>00007FFFh"
*1 To (SD8311, SD8310), write a non-negative value (0 to 2147483647) 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.
Word
T, ST, C, D, W,
U\G
SD, SW, R
*1
1103515245+12345
Structured text
ENO:=RND(EN,d);
ENO:=RNDP(EN,d);
Range
Data type
16-bit signed binary
Bit
Bit
Double word Indirect
specification
Z
LC
LZ
Data type (label)
ANY16
BOOL
BOOL
Constant
K, H
E
$
8 APPLICATION INSTRUCTION
8.10 Random Number Instruction
8
Others
545

Hide quick links:

Advertisement

loading