×
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

random element on ladder programming

random element on ladder programming

random element on ladder programming

(OP)
I 'd like to know if we can use a random function on ladder programming
For example, if we have -lets say- 12 memories (M1, M2...M12), can we activate/deactivate randomly?

thanks a lot

RE: random element on ladder programming

kounoupis

Im not entirely sure what you mean but if you have say "12 memories" or data memory areas, then each particular memory will contain a piece of information which may or may not change like if you are monitoring an analouge input it will change. When you say activate or deactivate randomly im not sure what you are trying to achieve? As each of the twelve areas maybe used in twelve different circumstances. If you can be a bit more specific then maybe i or others could help.

Regards

Taggy

RE: random element on ladder programming

(OP)
When I say memories, I mean Internal Relays (sorry for my bad english)... or Outputs

RE: random element on ladder programming

ok well i guess you mean you just want to randomly switch your twelve outputs on and off. Personally im unaware of function that would do this well on PLC's i use, but the easiest way (From my known knowledge anyway)would be to write some code that would switch different outputs on and off for a cycle then on then when this small routine is complete begin another which switches them on and off in a different order and different times say. All depends how random you want it to be i suppose. Hope this makes sense?

Taggy

RE: random element on ladder programming

(OP)
Yes it does. I already thought of this, but I want them to be really random and not just some routines
Can you tell me the function your PLC uses?
I use Microsmart PLC. Maybe it swiches :/

RE: random element on ladder programming

(OP)
Oh I just saw that you said that you are unaware (I thought i've read aware :p)

RE: random element on ladder programming

Just had a quick look through our manuals and software for the PLC's i use and i can not see a function that would do this' which i did expect to be honest. Sorry i cant be of any help and keep us informed of anything you do find.

RE: random element on ladder programming

(OP)
thanks for your time :)

RE: random element on ladder programming

A common way to generate random numbers in a PLC is to use a time value, either a free running timer value or a system clock.
With a timer, each time the PLC program scans the logic it should see a different accumulated time, since the program scan and the timer typically run asynchronous.
If you have a system clock, you could just look at the current seconds or milliseconds value, each time the program scans the rung.  Again, if the clock and program scan are asynchronous, you should get a different value on each program scan.

RE: random element on ladder programming

in c programming, there is a rand() function that generates a pseudo-random number.  but each time the function is called, it generates the same sequence.  in order to generate truly random numbers, there is a function called srand() that uses time as the base for generating the numbers.

i would look up the source code for those functions to see if it could be translated into ladder logic.

RE: random element on ladder programming

Go to www.mrplc.com and search downloads for random number, you may find what you need.

RE: random element on ladder programming

correction search all forums.

RE: random element on ladder programming

Also have a look at www.plcs.net
this has been discussed many times there.
Bob

RE: random element on ladder programming

You can generate a random sequence on your PC and then program that sequence into the PLC.
respectfully

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