kcor
Mar 3 2006, 01:02 PM
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
panic mode
Mar 3 2006, 01:22 PM
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.
Spedley
Mar 3 2006, 04:20 PM
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.
Alaric
Mar 3 2006, 05:37 PM
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.
kcor
Mar 3 2006, 10:17 PM
QUOTE(Alaric @ Mar 3 2006, 05:37 PM) [snapback]29222[/snapback]
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.
Thanks for input,
thats what i did, i created a timer with a 1 sec time base and used it to increment a counter.
BobLfoot
Mar 29 2006, 01:10 AM
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.
Smoke
Mar 29 2006, 09:39 AM
[attachmentid=2173]Like Bob said the system clock is inaccuret for the most part I like to do something like this.
kcor
Mar 31 2006, 12:29 PM
QUOTE(Smoke @ Mar 29 2006, 09:39 AM) [snapback]30678[/snapback]
[attachmentid=2173]Like Bob said the system clock is inaccuret for the most part I like to do something like this.
Thanks for replys
Smoke - I did exactly as you posted, and works great
Spedley
Mar 31 2006, 02:04 PM
QUOTE(kcor @ Mar 31 2006, 05:29 PM) [snapback]30839[/snapback]
QUOTE(Smoke @ Mar 29 2006, 09:39 AM) [snapback]30678[/snapback]
[attachmentid=2173]Like Bob said the system clock is inaccuret for the most part I like to do something like this.
Thanks for replys
Smoke - I did exactly as you posted, and works great
That is probably the least accurate method!
Smoke
Mar 31 2006, 04:26 PM
That's how I make lights blink at different rates. All critical time is done here with a time sync form the mainframe
Jamie571
Apr 4 2006, 08:30 PM
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.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.