It was brought up to us a while ago that it might be useful to have a block for Siemens that generates a random number in order to simulate noise or other various random conditions. We searched online to try and find an example but found that most of them were in actuality not very random at all. Other blocks use the system time and a sin/cos or exponential function to generate the random number, but the results end up being sinusoidal.
So we decided to make a quick version of our own. We took the same general idea and premise of the examples we found and made a couple tweaks to make it more random in nature. The block source and a graph of the results are shown below.
When you call the block, you tell it a maximum value and it will spit out a random number between 0 and that value (including 0 but excluding that number).