Randomly Generated Outputs?

karl84

Member
Join Date
Jun 2008
Location
black notley
Posts
32
o_O Hi, i'm using GX Developer FX version 8, and i would like to know if it is possible to generate random outputs with this software and how to do it? If i've not explained myself adequatly, the situation is i have four outputs that i wish to randomly generate at any given point while the program is running. Many thanks.
 
Generating a random number is not a trivial task. Apparent randomness can be achieved with a little bit of work. Several methods are covered at wikipedia, http://en.wikipedia.org/wiki/Pseudorandom_number_generator

We have discussed random number generators on this forum, run a search for forum threads. The Search link is right above the list of posts in this thread on this web page.

Limiting the random number to four outputs is trivial. Perfrom modulo division of the random number by 4 and you will be left with 0, 1, 2, or 3.

Here is another thread on the topic - http://www.plctalk.net/qanda/showthread.php?t=34602
 
Last edited:

Similar Topics

Hi all, I'm having a Red Lion DSPLE000 protocol converter on site to interface comms between an Allen Bradley L36ER CompactLogix, a S7-300 PLC...
Replies
0
Views
536
Hey everyone, I've tried the search function for similar issues but couldn't find any relevant info. Issue: I have a Controllogix 1756-L72/A...
Replies
4
Views
1,639
Hi. My FT Linx Browser Randomly losses saved Ethernet data. At times the Ethernet configured drivers will stay in for a couple days, then, at any...
Replies
3
Views
2,188
Hello Experts, I need help from experts of Weintek HMI. I design 5 windows on Easy builder. What i want to do is, Window select randomly and it...
Replies
2
Views
2,029
Hi All, We have a hydraulic press that is being controlled by Siemens S5-95U PLC . Lately the S5-95U has been randomly stopping during operation...
Replies
5
Views
2,440
Back
Top Bottom