×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Automation Direct DL05 - random time routine needed

Automation Direct DL05 - random time routine needed

Automation Direct DL05 - random time routine needed

(OP)
I have a Koyo DL05 PLC.  I have the code written (is that really a good term for developing ladder logic?) to generate a 1 min timer to increment a counter, so I can program a delay of 45 minutes.  Now, what I need to do is have a random amount of time from 1 minute up to 15 minutes added to this intial 45 minutes.  Using a microcontroller its easy, but how do you generate a seed for a random number generator?  I played with barrel counters and IF I could have it so it could "pick" a contact when the intial counter reached 45 minutes, that might work.  After the 45 min + random time, a second fixed time sequence occurs.  So far, everything works except for the random time adder.  Any ideas?

RE: Automation Direct DL05 - random time routine needed

If I understand your problem correct then you need some sort of random number generator (1 to 15).
You can make a timer (anther timer say T2 with 17 as preset value) the timer is self reset timer when reach value of 17. when you reach your 45 minutes read the timer value and use it as your random number (if timer =0  or >15 then you can assign numbers or add/deduct 2 from timer value).
The number 17 will give you 1020 before same pattern will be repeated.
Alternative to timer you can do it with counter.

Your program may looks like this
(T0/)---------------------TMR T0   K60    
{ timer T0 will generate pulse each one minute}

(TO)---------------------CNT  1 K45        
(CT1/)    
{Counter 1 will advance one per minute then reset it self when =45}

CT1 ----------------------> your equired actions here

Add these rungs

(T2/)------------------ TMR T2   K17
CT1-------------------- LD TA2
            OUT V2000
CT1------(TA2=0)------- LD  K1    
                        OUT V2000
CT1-------(TA2>=16)---- LD   TA2
            SUBB k2
            OUT V2000

Now in V2000 you will have your random number.
Also you can use fast timer instead of normal timer this will give you much better results

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources