Arithmetic instructions Chapter 5
Rockwell Automation Publication 2080-RM001D-EN-E - February 2015 93
From a defined range, RAND yields random integer values.
Arguments
Parameter
Parameter
Type
Data Type Description
EN Input BOOL Function enable.
When EN = TRUE, execute the random integer value computation
When EN = FALSE, there is no computation.
base Input DINT Defines the supported set of numbers.
RAND Output DINT Random value in set [0..base-1].
ENO Output BOOL Enable out.
RAND function language examples
Function block diagram
Ladder diagram