Random Number Generator in PM573.
I am trying to simulat one project and try to generate rendom value between range.
Please suggest me any function/Function block/formula.
If you're trying to simulate a varying signal, then then an evenly spaced random number doesnt really work very well - you're better to use a gaussian RNG because this gives you a random number where the next number in the sequence is "sort of" similar to the previous one. This way you get a value that wanders randomly up and down.
However, RNG's arent really required to simulate anything usefull. You can get usefull results by just adding a +/- 0.5% of range sine wave to to the simulated signal value.
If you just want something simple and dont care that its predicatable ....
i = 7 * i `mod` 11
--- you can seed "i" with any value but the ms of current time works well.
once you have a simple RNG you can make a gaussian RNG ( if you really want to go to the trouble)
Hi, maybe you should try the OSCAT Basic library, there are some functions available to calculate pseudo-random numbers (RDM, RDM2, RDMDW).