Fnc184 - Rnd / Random Number Generation - Mitsubishi Electric MELSEC FX3U Programming Manual

Melsec fx series programmable logic controllers
Table of Contents

Advertisement

FX
/FX
/FX
Series Programmable Controllers
3G
3U
3UC
Programming Manual - Basic & Applied Instruction Edition
24.2
FNC184 – RND / Random Number Generation
Outline
This instruction generates random numbers.
1. Instruction format
FNC 184
RND
2. Set data
Operand Type
D
3. Applicable devices
Bit Devices
Oper-
and
System User
Type
X Y M T C S D .b KnX KnY KnM KnS T C D R U \G
D
Explanation of function and operation
1. 16-bit operation (RND and RNDP)
This instruction generates a pseudo-random number within the range from 0 to 32767, and stores it as a
random number to
In the pseudo-random number sequence, the source value of a random number is calculated at every time,
and this instruction calculates a pseudo-random number using the source value.
Command
input
FNC 184
RND
Pseudo-random number calculation equation:
(D8311, D8310) = (D8311, D8310) *
= "([D8311, D8310]>>16)&<logical product>00007FFFh"
D
*1.
To (D8311, D8310), write a non-negative value (0 to 2,147,483,647) only once when the PLC mode
switches from STOP to RUN.
[K1 is written to (D8311, D8310) as the initial value when the power is restored.]
616
Mnemonic
16-bit Instruction
P
RND
3 steps
RNDP
Head device number storing a random number
Digit Specification
.
D
D
1
× 1103515245 + 12345.....(1)
24.2 FNC184 – RND / Random Number Generation
Operation Condition
32-bit Instruction
Continuous
Operation
Pulse (Single)
Operation
Description
Word Devices
Special
System User
Unit
V Z Modify K H
24 Others – FNC181 to FNC189
Mnemonic
Operation Condition
Data Type
16-bit binary
Others
Con-
Real
Charac-
Index
stant
Number
ter String
E
" "
Pointer
P

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec fx3ucMelsec fx3g

Table of Contents