![Mitsubishi Electric MELSEC FX3G Programming Manual Download Page 619](http://html.mh-extra.com/html/mitsubishi-electric/melsec-fx3g/melsec-fx3g_programming-manual_239083619.webp)
617
FX
3G
/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 T
im
e C
lo
ck
C
ont
ro
l
22
FN
C
170-
FN
C
179
Exter
nal D
ev
ice
23
FN
C
180
Al
ter
nate
In
str
uc
tions
24
FN
C
181-
FN
C
189
O
ther
s
25
FN
C
190-
FN
C
199
B
lock D
ata
O
per
at
ion
26
FN
C
200
-F
N
C
20
9
C
har
acter
S
tring
C
ont
ro
l
27
FN
C
210-
FN
C
219
Da
ta
O
per
ation 3
28
FN
C
220-
FN
C
249
Da
ta
C
om
par
ison
29
FN
C
250
-F
N
C
26
9
D
ata T
abl
e
O
per
ati
on
30
FN
C
270-
FN
C
274
Ex
-D
ev
ice
Inv
ert
er
Com
m
s
Program example
In the program example shown below, a random number is stored to D100 every time X010 turns ON.
When the PLC mode switches from STOP to RUN, the time data converted into seconds and added by the
value “(Year + Month)
×
Day” is written to D8311 and D8310.
Data in hour, minute and second
→
Data in second
X010
FNC184
RNDP
D100
END
M8002
FNC166
TRD
D0
FNC164
DHTOS
D14
D3
FNC 20
ADD
D10
D1
D0
FNC 20
DADD
D8310
D12
D14
The clock data is read.
The data in second is added by the value “(Year +
Month)
×
Day”, and written to D8311 and D8310.
FNC 23
MUL
D12
D2
D10