571
FX
3U
/FX
3UC
Series Programmable Controllers
Programming Manual - Basic & Applied Instruction Edition
24 Others – FNC181 to FNC189
24.2 FNC184 – RND / Random Number Generation
21
FN
C
160-FN
C
169
R
eal
Ti
m
e
C
loc
k
C
ont
ro
l
22
FN
C
170
-F
N
C
17
9
E
xt
e
rnal
D
evi
ce
23
FN
C
180
Su
b
st.
I
n
str
. I
n
fo
24
FN
C
181-FN
C
189
O
ther
s
25
FN
C
190-FN
C
19
9
B
loc
k D
a
ta
O
per
at
io
n
26
FN
C
200-FN
C
209
C
har
act
e
r St
ring
C
ont
ro
l
27
F
N
C2
10
-F
NC
21
9
Da
ta
O
per
at
ion 3
28
FN
C
220-FN
C
24
9
Da
ta
Co
m
p
a
ris
o
n
29
FN
C
250-FN
C
269
Da
ta
T
a
b
le
O
per
at
io
n
30
FN
C
27
0-F
N
C
274
Ex
-D
ev
ic
e
In
ve
rte
r C
o
mm
s
24.2
FNC184 – RND / Random Number Generation
Outline
This instruction generates random numbers.
1. Instruction format
2. Set data
3. Applicable devices
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.
Pseudo-random number calculation equation:
(D8311, D8310) = (D8311, D8310) *
1
× 1103 12345.....(1)
= “([D8311, D8310]>>16)&<logical product>00007FFFh”
*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.]
Operand Type
Description
Data Type
Head device number storing a random number
16-bit binary
Oper-
and
Type
Bit Devices
Word Devices
Others
System User
Digit Specification
System User
Special
Unit
Index
Con-
stant
Real
Number
Charac-
ter String
Pointer
X Y M T C S D
.b KnX KnY KnM KnS
T
C
D
R U
\G
V
Z Modify K
H
E
"
"
P
3
3
3
3 3 3 3
3
3
P
FNC 184
RND
Mnemonic
Operation Condition
16-bit Instruction
3 steps
RND
RNDP
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
32-bit Instruction
⎯
⎯
D
D
D
FNC 184
RND
Command
input
D
D
Содержание FX3U Series
Страница 1: ...PROGRAMMING MANUAL Basic Applied Instructions Edition FX3U FX3UC SERIES PROGRAMMABLE CONTROLLERS ...
Страница 2: ......
Страница 889: ......