Phrog30
Member
1. A little late to the party
2. For a PLC5??
1. A little late to the party
Be practical. Although any pattern will eventually be repeated there are some that won't happen in a life time or while the earth still exists.Technically there is no such thing as a true random number generator in a computer. There is always a pattern although sometimes the pattern is so long it appears that it is random. Having said that someone discovered using a Lavalamps as an analog input creates a true random number generator.
https://en.wikipedia.org/wiki/Lavarand
Doesn't a PLC5 have a bit shift block where many bits can be shifted at once? ANDing with 65535 simply means separating a 32 bit value into two 16 bit ones and treating them like an unsigned number.1. A little late to the party
2. For a PLC5??
Be practical. Although any pattern will eventually be repeated there are some that won't happen in a life time or while the earth still exists.
A lava lamp with an analog output? Give me a break. The AtoD converter has only some many bits of output. I you count sequences of analog output then there is still a limitation as the analog values will not change instantly.
Peter I'm wondering what it's like to be a so superior to everyone else. Yet again you took what was one persons input into an interesting topic and turn it into a personal attack. I could care less what you think about my thoughts on any topic and I think you taking it to a personal level speaks volumes to the kind of person you are.
Guys, do you have any strategies that you use?
Doesn't a PLC5 have a bit shift block where many bits can be shifted at once? ANDing with 65535 simply means separating a 32 bit value into two 16 bit ones and treating them like an unsigned number.
Doesn't a PLC5 have a bit shift block where many bits can be shifted at once? ANDing with 65535 simply means separating a 32 bit value into two 16 bit ones and treating them like an unsigned number.
It is the algorithm that is important. Some assembly may be required.Yes, I was merely stating your linked C# example isn't a direct drop in.
Do an internet search for "random number generator PLC5". All you get it this thread. There aren't any PLC5 random number generator examples.Probably better to reference PLC code, not C# code. But, that's just me.
It is the algorithm that is important. Some assembly may be required.
I can think of only one potential problem. The generated numbers will appear random but the sequence of numbers will always be the same. This may be good or bad depending on needs.