539
RND, RNDP, SRND, SRNDP
1
2
3
4
4
6
7
8
7.12
Special function
instructions
7.12.2
7
RND,
RNDP, SRND
, SRNDP
Operat
i
on
E
rror
(1) In any of the following cases, an operation error occurs, the error flag (SM0) turns on, and an error code is stored into
SD0.
Program
E
xamp
l
e
(1) This following program obtains the value for common logarithm of the 64-bit floating-point data type real number
specified by D600 to D603 when M0 is turned on. Then the program stores the operation result into D123 to D126.
[Ladder Mode]
[List Mode]
[Operation]
: Head number of the devices where random numbers will be stored (BIN 16 bits)
: Random number serial data or the first number of the devices where the random number serial data is stored (BIN 16 bits)
Error
code
Error details
Q00J/
Q00/
Q01
QnH
QnPH QnPRH
QnU
LCPU
4100
The value specified in is negative.
The value specified in is 0.
––
––
––
––
4140
The specified device value is not within the following range:
0, 2
-1022
| Specified device value | < 2
1024
The value specified by is -0.
––
––
––
––
4141
The operation result is within the following range (when an overflow
occurs):
2
1024
| Operation result |
––
––
––
––
7.12.27 RND, RNDP
Random number generation
SRND, SRNDP
Series updates
7.12.27
RND, RNDP, SRND, SRNDP
• Basic model QCPU: The serial number (first five digits) is
"04122" or later.
Setting
Data
Internal Devices
R, ZR
J \
U \G
Zn
Constants
K, H
Other
Bit
Word
Bit
Word
––
––
––
S
S
S
Step
I
nstruct
i
on
De
vi
ce
D603 D602
D601 D600
Log
10
2.806
D126 D125
D124 D123
0.448088
Basic
Process
High
performance
Redundant Universal
LCPU
Ver.
Command
Command
Command
Command
SR
N
DP
SR
N
D
R
N
DP
R
N
D
SRNDP
SRND
RNDP
RND
S
D
D
S
D
S
D
S