3 . I n s t r u c t i o n S e t
M N 0 5 0 0 3 0 0 3 E F o r m o r e
i n f o r m a t i o n
v i s i t :
w w w. e a t o n . c o m
3 - 3 7 3
API Mnemonic
Operands
Function
154
D RAND P
S
1
, S
2
, D
Random Number
Bit Devices
Word devices
Program Steps
Type
OP
X Y M S K H KnX KnY KnM KnS T
C
D
E
F
S
1
*
*
*
*
*
*
*
*
*
*
*
S
2
*
*
*
*
*
*
*
*
*
*
*
D
*
*
*
*
*
*
*
*
RAND, RANDP: 7 steps
DRAND, DRANDP: 13
steps
ELC ELCB
ELCM
PB PC/PA/PH
PV
PB PH/PA
32
16
P
32
16
P
32
16
P
32 16 P
32
16
P
Operands:
S
1
: lower limit for the random numbers
S
2
: upper limit for the random numbers
D
: Random
number result
Description:
1.
The range of 16-bit operands
S
1
,
S
2
is: K0
≦
S
1
,
S
2
≦
K32,767, the range of 32-bit operands
S
1
,
S
2
is: K0
≦
S
1
,
S
2
≦
K2,147,483,647.
2. If
S
1
>
S
2
, the ELC will produce an operand error and M1067 and M1068=ON, and error code
0E1A(HEX) will be recorded in D1067.
Program Example:
When X0=ON, the random number produced between lower limit D0 and upper limit D10 will be
saved in D20.
X0
RAND
D0
D10
D20
Summary of Contents for ELC-PB
Page 1: ......
Page 5: ...For more information visit www eaton com MN05003003E iv...
Page 29: ...ELC Programming Manual For more information visit www eaton com MN05003003E 1 24 MEMO...
Page 502: ...3 Instruction Set MN05003003E For more information visit www eaton com 3 333...
Page 601: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 432...
Page 625: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 456...