Sign in to follow this  
Followers 0
Studiologe

Cyclic trigger

7 posts in this topic

Hello all, I'm using RSLogix 5000 and all I need is a simple Bit that triggers every 100-300ms. Doesn't really matter how exact somewhere inbetween. I know that I did a similar thing in RSLogix 500 using the S:4/7 Bit. How would I do that in RSLogix 5000? CPU is 1769-L35E And for Now I just want to Pulse an Output every .x seconds just to get a flashing Light for now. Thanks for any advice

Share this post


Link to post
Share on other sites
If timing is not critical, you can create a cyclic TON (put XIO the timer's .DN bit in front of it) Then use a comparison instruction (LES, LEQ, GRT, GEQ) looking at the timer accumulator value to turn your output on. More critical timing is best served using a periodic task, and looking at the processors internal clock using GSV.

Share this post


Link to post
Share on other sites
ControlLogix doesn't have a convenient free-running clock register like the PLC/SLC/MicroLogix. It does have a free-running clock; it's called the Coordinated System Time (CST) clock. You grab the value with a GSV instruction (Get System Variable) and the resolution is in microseconds. But the most common way to generate flashing bits for use with pilot lights and so forth is to just use a self-resetting timer, and compare the accumulated value to the preset. Remember that all ControlLogix timers have a 1 millisecond timebase. So if you had a self-resetting timer (put an XIO Timer.DN in front of the TON instruction) with 1000 ms preset, any time the accumulated value is above 500 you can turn on a bit. That bit will be on for 500 ms, and off for 500 ms, effectively giving you a 1 Hz flasher. I'm attaching a simple example in PDF format. If you want a bit to just be true for one scan, rather than a 50% duty cycle flasher bit, just make the bit true whenever the /DN bit of that self-resetting timer is true. The ControlLogix task model and status structure take some getting used to, but you'll appreciate its flexibility and power. Flasher_Bits.pdf

Share this post


Link to post
Share on other sites
Hello, I enclose an alternative to examples above. If you are interested in flashing bit you can use 2 timers which will reset each other and generate flashing boolean (bit). You can moderate duration by changing timer preset values. For sure due to the cycle time (large applications) of PLC it's not 100% accurate. Best regards, Radek Flashing_bool.bmp

Share this post


Link to post
Share on other sites
Create a free running timer of your own. TON FreeRunningTimer 2147483647 0 OTU FreeRunningTimer.ACC.30 Making the preset 2147483647 and unconditionally unlatching bit 30 of the timer ACC guarantees that the timer will never time out, it will run for as long as the PLC program runs. Each bit of the timer toggles at a rate equal to 2^postion*.001 seconds. FreeRunningTimer.ACC.0 toggles every .001 seconds. ACC.1 is .002 ACC.2 is .004 ACC.3 is .008 ACC.4 is .016 ACC.5 is .032 ACC.6 is .064 ACC.7 is .128 ACC.8 is .256 ACC.9 is .512 ACC.10 is 1.024 ACC.11 is 2.045 and so on. FreeRunningTimer.ACC.7 or FreeRunningTimer.ACC.8 would meet the criteria you have listed.

Share this post


Link to post
Share on other sites
That is a neat trick to generate the timings you listed, however it does have a couple of drawbacks.... 1. The timer rung is executed every scan, placing a burden on the processor which is unnecessary. 2. The "accuracy" or repeatability of the lower bits (higher frequency), will be poor, and will be affected by many things, including any adjustments to the System Overhead Time-Slice. IMHO, the best method to use is to create a periodic task of the time period you want to create. It is easy to toggle a bit in the periodic task. The mechanism for triggering the task is already there as part of the controller's operating system, so there is no code to write to generate the timing. In addition, the "accuracy" or "repeatability" of the timing will only be affected by the task priority assigned to it.

Share this post


Link to post
Share on other sites

why there is no attachment even though the members mentioned it ???

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0