Sign in to follow this  
Followers 0
kcor

1sec Clock Pulse

11 posts in this topic

Trying to figure out the best way to create a 1 sec pulse in order to use to increment a counter and track cycles per minute. It appears from reading the documentation on a micrologixs 1200 that you have to use a comination of the free running clock bits added together to create a 1 sec clock pulse. When using a omron plc, there are special mem bits such as 1 sec clock pulse, .1 sec clock pulse, etc., is there the same thing with a AB, and I am just brain dead and overlooking it. thanks

Share this post


Link to post
Share on other sites
if the free running clock is not something you can use, just make your own... you can create as many timers as you wish unless you run out of memory.

Share this post


Link to post
Share on other sites
There is a timer which increments every 20ms (I think). The result of that is that if you use bit 0 its 20ms, bit 1 is 40ms ... 6th bit is 640ms, 7th bits 1280ms. As panic mode says, I belive the free running clock is calculated using this pulse and has a second 'hand' in S:42 (S:42/0) which you could use. I don't know if it's accurate but I expect so. You could also use a timer which resets itself with a XIO DN bit, however that will ve inaccurate. Edited by Spedley

Share this post


Link to post
Share on other sites
The lowest order bit of any timer accumulator toggles at the timers timebase. When the ACC is even, the bit is off, when ACC is odd, the bit is on. Create a self resetting timer, lets say T4:0. Give it a 1 second time base and a preset of 32766. (The preset needs to be an even number) XIC T4:0/DN TON T4:0 1.0 32766 0 Bit T4:0.ACC/0 will be on for one second, off for one second.

Share this post


Link to post
Share on other sites
Thanks for input, thats what i did, i created a timer with a 1 sec time base and used it to increment a counter.

Share this post


Link to post
Share on other sites
Not that it should be a problem in a 1200, but if you adapt this schema to a higher level processor make sure your scan time is less than 100 ms or you'll be innaccurate.

Share this post


Link to post
Share on other sites
clock.xlsLike Bob said the system clock is inaccuret for the most part I like to do something like this. Edited by Smoke

Share this post


Link to post
Share on other sites
Thanks for replys Smoke - I did exactly as you posted, and works great

Share this post


Link to post
Share on other sites
That is probably the least accurate method!

Share this post


Link to post
Share on other sites
That's how I make lights blink at different rates. All critical time is done here with a time sync form the mainframe

Share this post


Link to post
Share on other sites
I would use: XIO T4:0/DN TON T4:0 200 0 GEQ T4:0.ACC 100 OSR CTU C5:0 32000 0 Change the compare statement to give you whatever frequency you want. Edited by Jamie571

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