AB SLC5/03 OTL & OTU instructions

mike p

Member
Join Date
Jul 2006
Location
Texas
Posts
7
I want to alternate two pumps daily based on the processor clock. When the clock is at the correct time, I set a bit to increment a counter. I use the counter done bit as a permisive for my latch bit, which in turn is used on my pump rung as a pump toggle bit.If I use the counter done bit to latch my pump toggle bit, what do I unlatch it with? If I am using counter done bit for that as well, won't the toggle bit unlatch right after it latches in the scan?
 
If you are alternating just two pumps then use the Counter.ACC/0 bit.

When the counter value is odd then the bit COUNTER.ACC/0 is set. When the counter value is even the bit COUNTER.ACC/0 is clear. This way the counter functions as a flip flop to alternate the selected pump. If you use this then you do not need to worry about the counter done bit, the counter preset, resetting the couner, or counter rollover as the /0 bit will go on alternating between 0 and 1.

The following will switch between pump 1 and 2 at midnight.


---+-EQU---------+----------+-CTU-------+--
| A S:40 | | C5:0 |
| B 0 | | PRE 0 |
+-------------+ | ACC 0 |
+-----------+

C5:0.ACC/0 PUMP 1
----]/[---------------------------( )----

C5:0.ACC/0 PUMP 2
----] [---------------------------( )----


 
So you are saying don't reset the counter? That means I would get 32767 days of pump switching without a problem, if I condition the counter with the processor clock hour. What happens in 89 years or so when the counter overflows, or do we even care?
 
mike p said:
When the clock is at the correct time, I set a bit to increment a counter.
I really don't understand the function of the counter in this post.

Why not use a one-shot based on the time of day (derived from whatever combination of status bits that indicate your appropriate "time to toggle") that is used to cycle a flip-flop.

For example, if you want to toggle the pumps at midnight, then energize the flip-flop. At midnight the next day, the one-shot would energize the flip-flop again, returning service to the first pump.

There are tons of flip-flop examples on this site in other posts. I just don't understand the need for a counter here. You're not "counting" anything...
 
If in 89 years these pumps are still running off of the same processor and get an overflow fault, odds are you won't be available to take the phone call. I'd say the lifecycle of the system will be shorter than the time it takes for your counter to overflow.
 
I generally put a line under the counter to reset the counter if the (.acc) = (# of pumps + 1). You never worry about the counter maxing out and the same logic can be used for however pumps there are. If a pump can be manually turned off put parallel logic to the increment logic to increment again if a pump is selected as off and the .acc is pointing to it.
 
there would not be a overflow fault

Why do you think the processor would fault??? at your 89 year mark...you would just go to a -32768 then start counting back...


PS, do you realy think that Alaric would write a program that would fail...think about it...;)
 
LJBMatt said:
If in 89 years these pumps are still running off of the same processor and get an overflow fault, odds are you won't be available to take the phone call. I'd say the lifecycle of the system will be shorter than the time it takes for your counter to overflow.

I would still suggest that you reset the counter and not allow an overflow condition. I would consider it incomplete programming to allow a system to overflow, even if it would take 89 years.


EDIT: Mark, is that what would happen? I never let it get that high so I'm not sure. I guess I will have to try it after our plant shutdown (in day 3 of 5 now and getting a little blurry eyed after 2 weeks of 12+ hours per day).
 
Last edited:
brucechase said:
I would still suggest that you reset the counter and not allow an overflow condition. I would consider it incomplete programming to allow a system to overflow, even if it would take 89 years.
I agree. Murphy has a way to make things fail when even the most unimaginable happens. Ponder this:
Someone gets online to the processor and dials in some crazy acccumulated value. Then the thing fails much sooner.

On a whimsical note, you could just reset the counter based on the arrival of Halley's comet (whatever that status bit is.) You would still have a margin of error of 11 years.

Back to "serious"...I still don't know why the need for the counter. Isn't a duplex pump system simply based on a flip-flop? Unless you are trying to distill a triplex pump application down to just two pumps.
 
I give up

There is not a overflow fault!!!!

and never will be...the count will go -

bit 16 will go hi this will cause the

counter to start counting down...





Edit: I paid attention that day in Alaric’s class :)
 
Last edited:
I am with Jimmie, all it is is a flip flop so a counter is not needed.

An even easier method to me since there are just 2 compressors is use a compare that enables a bit for 12 hours of the day then use compressor 1 when that bit is TRUE and compressor 2 when it is FALSE.

It is also just as easy to use a compare instruction with S:40 to start compressor1 at 1:00 and unlatch compressor2 then at 13:00 start compressor2 and unlatch compressor1. With this, or any, method be sure to include a RUN ENABLE condition or some condition that allows you to stop either compressor at any time regardless if the other is running.

I do not think I understand the 89 year thing using a counter, if it counts 2 times a day and runs 7 days a week then I get 44.5 years. I agree that its probably not relevant overall.

You also did not metion whether the system(s) would be monitoring line pressure to run both compressors if necessary OR if one fails the other automatically goes online...how you do something depends on all variables involved.
 
rsdoran said:
I do not think I understand the 89 year thing using a counter, if it counts 2 times a day and runs 7 days a week then I get 44.5 years. I agree that its probably not relevant overall.
After re-reading Alaric's old post, his method is basically to check the "odd/evenness" of the ACC of the counter. His method does not overflow, but eventually counts down, then back up, then presumably repeats forever. Therefore, as the recent replies state, the reset problem is non-existent and a moot point.

But I still think a flip-flop is the simplest.
 

Similar Topics

I have wasted a week trying to figure out how to connect an SLC5/03 with my laptop. I do not have and can not Buy the 1747 UIC and PC3 cables. I...
Replies
14
Views
2,479
I am trying to connect to SLC5/03 using an FTDI usb to rs232 with female to female converter at 1 end... however I can not connect to it ... the...
Replies
8
Views
1,183
Good evening. I am in serious need of help. I am trying to connect a Panelview Plus 7 Standard to a SLC5/03(1741-L531) using a Moxa MGate...
Replies
3
Views
604
Hi. I am having trouble establishing comms between an slc5/04 and panel view plus 7 via a PLX51-net-eni. The set up is: 5/04 Channel 0 DF1...
Replies
8
Views
872
Hi All, I have programmed some MSG instruction in SLC5/05 64k CPU series D FW 13 brand new cpu. 2 of the MSG instructions are direct IP to other...
Replies
3
Views
962
Back
Top Bottom