Random numbers |
Top |
For simulation of disturbances you can let create random numbers by TrySim. For that four functions are available which you call with the key word FUNC x:
Examples: L 10 FUNC 100 // In accu 1 is now a random number from 0 - 9
L 5 FUNC 101 // In the accu there is now a random number from -5 till +5
L 10000 FUNC 103 // With a chance of 1:10000 the RLO is now ‘1’
The operation FUNC cannot be exported because it is only defined within TrySim. That is why you should restrict the use of this operation to the OB2 and OB3 ( or to the blocks called there).
The example ‘Random’ demonstrates the four ways to create random numbers.
Please note also that the generator can create dynamics of random size.
|