Wendy Viera Posted February 4, 2011 Report Share Posted February 4, 2011 Hi! I need to generate a random number between 1 and 10. I tried to generate the random number with a formula, but it always generates the same form or sequence (not random). Any ideas? Thanks in advance!!! Quote Link to comment Share on other sites More sharing options...
Stein Yair Posted February 6, 2011 Report Share Posted February 6, 2011 Hi Wendy, The type of random number generator depends on the application I can offer you two different random number generators which you might find useful. Random Number Generator 2.vlp V570_Random_number_generator.vlp Quote Link to comment Share on other sites More sharing options...
MVP 2021 Flex727 Posted February 2, 2013 MVP 2021 Report Share Posted February 2, 2013 I don't know if Stein Yair is still around and participating in this forum, but I just want to say thanks. I had an urgent need for some random number generation and the above post is exactly what I needed. By the way, Unitronics should consider adding a RND function to the available math functions in VisiLogic. 1 Quote Link to comment Share on other sites More sharing options...
kamrca Posted October 31, 2014 Report Share Posted October 31, 2014 Can pls somebody expain how the above two RNGs work or how can I open vlp files. I use jazz / M-90. THX! Quote Link to comment Share on other sites More sharing options...
MVP 2021 Flex727 Posted October 31, 2014 MVP 2021 Report Share Posted October 31, 2014 Install VisiLogic to open .vlp files. Quote Link to comment Share on other sites More sharing options...
s.pratt Posted October 31, 2014 Report Share Posted October 31, 2014 Hello kamrca, You must use our software VisiLogic to open .vlp files. The Jazz/M90 controllers will be programmed in U90, .U90 file extension. Here is a basic overview of the programs: The V570_Random_Number_Generator takes a 32-bit value and multiplies it by 75 (a random number) then divides that value by 65537, and the random number will be the remainder of the division. The Random Number Generator 2 takes a 2.5msec count (generated by the system) and multiplies it by the current second (also a system operand). Then it reduces the number such that it is a value between 1 and 10 by taking the remainder of the product created before and using the remainder after dividing by 10. Hope this helps. Quote Link to comment Share on other sites More sharing options...
kamrca Posted November 2, 2014 Report Share Posted November 2, 2014 Thx a lot to your kind answers!. I thout it was that Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.