Rndm (Random) - IDEC MICROSmart FC6A Series Ladder Programming Manual

Automation organizer windldr
Hide thumbs Also See for MICROSmart FC6A Series:
Table of Contents

Advertisement

7: B
A
INARY
RITHMETIC

RNDM (Random)

RNDM(W)
Device
S1 (Source 1)
S2 (Source 2)
D1 (Destination 1)
*1 0 to 32,767 can be input.
For the valid device address range, see "Device Addresses" on page 2-1
• When the data in S1 or S2 is outside the range of 0 to 32,767, the result is a user program execution error.
• When the data specified by S1 is the same value as the data specified by S2 or a larger value, the result is a user program execution error.
For user program execution errors, see "User Program Execution Errors" on page 3-10.
Valid Data Types
W (word)
X
I (integer)
D (double word)
L (long)
F (float)
Example: RNDM
RNDM(W)
SOTU
I0
7-18
I
NSTRUCTIONS
S1
S2
D1
*****
*****
*****
Function
Minimum value of pseudorandom numbers
Maximum value of pseudorandom numbers
Destination to store results
When a word device such as D (data register) is designated as the source or destination, 1 point (word) is
used.
S1
S2
1
6
D0010
FC6A S
MICROS
ERIES
MART
Generates pseudorandom numbers.
When the input is on, a pseudorandom number is generated with the data specified by
S1 as the lower limit and the data specified by S2 as the upper limit, and that value is
stored in D1.
The result is stored to the destination designated by device D1.
I
Q
.
When the input is turned on, a pseudorandom number is generated in the
D1
range of 1 to 6, and the result is stored in D0010.
L
P
M
ADDER
ROGRAMMING
M
R
T
C
D
P
X
X
X
FC9Y-B1726
ANUAL
Constant
Repeat
*1
X
*1
X

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents