adccommunitymod (AutomationDirect) asked a question.

Generate Random Integers?

Created Date: February 06,2002

Created By: sjstein

**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****

Does anyone have an elegant method to generate a random number on a DL250? I suppose I could do something with the scan number and/or the RTC, but I was hoping for something a little better...


  • adccommunitymod (AutomationDirect)

    Created Date: May 12,2011

    Created by: DamnDogDesigns

    Random Numbers

    The link listed for Quantum Automation is not good anymore, and I couldn't find it on their site. Does anyone have this or know of a simple way to generate random numbers in a DL06 or similar?

  • adccommunitymod (AutomationDirect)

    Created Date: May 12,2011

    Created by: franji1

    I know that generating random numbers is good for testing, but are there PLC applications that need random number generation?

  • adccommunitymod (AutomationDirect)

    Created Date: May 12,2011

    Created by: bcarlton

    What type numbers? BCD or binary, single or double word, real? What range?

  • adccommunitymod (AutomationDirect)

    Created Date: May 12,2011

    Created by: Do-more PE

    I know that generating random numbers is good for testing, but are there PLC applications that need random number generation?

    A lot of folks want random numbers to switch between pumps or other devices to even out wear. There are actually quite a few applications for randomness in PLC's.

  • adccommunitymod (AutomationDirect)

    Created Date: May 12,2011

    Created by: bcarlton

    Atatched is a DL05 program for 16 bit random in V2000. (You may have to modify the First Scan code to place a non-zero number into V2000).

  • adccommunitymod (AutomationDirect)

    Created Date: April 24,2012

    Created by: rvaughn

    Random Numbers

    bcarlton, thanks for taking the time to post your random number code. It was very helpful for my application. I am using a DL05 to run simulations that require random timing between events (and this is very difficult without something to generate random numbers!)

  • adccommunitymod (AutomationDirect)

    Created Date: February 06,2002

    Created by: sjstein

    Does anyone have an elegant method to generate a random number on a DL250? I suppose I could do something with the scan number and/or the RTC, but I was hoping for something a little better...