Ny-Series Instructions Reference Manual (W560 - Omron NY532-5400 Reference Manual

Ny-series
Hide thumbs Also See for NY532-5400:
Table of Contents

Advertisement

2 Instruction Descriptions
The Rand instruction generates a repeatable series of random numbers.
1st execution: Rnd = abc
2nd execution: Rnd = abc
3rd execution: Rnd = abc
Power supply turned OFF and ON again.
1st execution: Rnd = abc
2nd execution: Rnd = abc
3rd execution: Rnd = abc
* The values of the random numbers that are given above are examples. The actual values will be different.
Additional Information
The value of Rnd is a real number between 0 and 1. Use the following processing to generate ran-
dom numbers within a specific range.
Example: The following formula generates random numbers between 100 and 200.
2-220
Power ON
LREAL#0.12
LREAL#0.34
LREAL#0.56
LREAL#0.12
LREAL#0.34
LREAL#0.56
Rand_instance(A, UINT#1, abc);
Random number:=LREAL_TO_INT((200.0-100.0)*abc)+100;
The same random numbers are generated
each time the power supply is turned ON.

NY-series Instructions Reference Manual (W560)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents