Combining Auto and Manual control

40mpg

Member
Join Date
Dec 2021
Location
Oakland, CA
Posts
82
Hello,


I am trying to write a logic to control a pump. I have my logic as attached. Is there a way to do Auto and Manual control without having two rungs with two OTE?


In Auto - pump will start if Tank high level alarm triggers, will start if user "kick start" the pump. The pump will stop if tank low level alarm triggers or E_STOP is trigger


In Manual - user can start the pump, pump will stop if user press stop button or E_STOP condition triggers.


Is there a way to combine the two in one rung?

Capture.jpg
 
Nobody gives out awards for cramming the maximum amount of logic into a single rung. And trying to do so often ends up with logic that's hard to understand and debug.

In your example, you need two separate OTEs, one for auto mode run, the other for manual mode run. Then you need a third rung where you OR the two OTEs to turn on the Sump_Pump OTE.
 
This is a simple one on one rung, note the use of a Man/OFF/Auto switch as just a Man/Auto means it will latch if running so rather than just use not auto in the top rung it has a Man position with centre off.
You cannot use a output twice unless SET/RESET as one will override the other.

Auto_Man.png
 
40mpg,

your programs has 2 outputs with the identical name
the last rung wins !
i would have an Auto_Sump_Pump and a Manual_Sump_Pump output.
then do as suggested, use a 3rd rung.
Always remember one thing !
just because you understand the logic, does NOT mean maintenance will at 2 am when there is a problem. write the code to where maintenance can understand it and DOCUMENT with rung comments. they will bend over backwards to fix the issue. if the code is so complex that a phd is neededto understand the code, maintenance can't understand the code and fix the issue,
the machine is down, the production manager will ask the maintenance manager what happened, the plant manager gets involved, your boss gets a call, then you get raked over the coals and have to be on call 24/7 until you write a more simpler program. in the meantime, your boss is told never let you write code like that again or lose a customer.
It happened to someone i worked with. he wrote code so complex that we had him rewrite it. 3 weeks lost of another project's time. the boss finally let him go.
james
 
Parky is right, if you were to test your logic, it would never run in auto. The second OTE will always determine the state of your output since it is the last one evaluated. If you want to do it all on one rung, then the logic in "Auto Manual Combined Logic" should work. If you want it to be a little easier to read, I believe "Three Rung Logic" will work.

Auto Manual Combined Logic.png Three Rung Logic.png
 
Nobody gives out awards for cramming the maximum amount of logic into a single rung. And trying to do so often ends up with logic that's hard to understand and debug.

In your example, you need two separate OTEs, one for auto mode run, the other for manual mode run. Then you need a third rung where you OR the two OTEs to turn on the Sump_Pump OTE.

Thank you!!


Having miniature seizures wondering why people are choosing 8 lines of logic to turn on an output by moving whole control words into output words....... when just laying out it in a couple clear and concise rungs with one output per command would work fine...
 
+1 for everyone else, especially about making it easy to understand.

I do disagree about one thing though: the two seal-ins mean that OP's code in Post #1 would work as intended in auto, despite the DDB (duplicate destructive bit). Things could get a bit confusing for the operator if they switch between auto and manual while the pump is running.

DDBs are the canonical beginner mistake; we've all done it, and the only response is to not repeat it in future. DDBs usually make things not work as intended, but here those seal-ins get around that.

@MikeyN's three-rung solution is probably the best i.e. easiest to understand by others at 2AM, because it does the fewest number of things at a time.
 
Last edited:
I do disagree about one thing though: the two seal-ins mean that OP's code in Post #1 would work as intended in auto, despite the DDB (duplicate destructive bit).

The seal in does not go around the System_AUTO bit though. Without some OTU trickery, that bit cannot be true and false at the same time. So if the system is in auto, the XIO will evaluate to false, keeping the sump pump off. It could have worked had OP used different tags for auto and manual.
 
The seal in does not go around the System_AUTO bit though. Without some OTU trickery, that bit cannot be true and false at the same time. So if the system is in auto, the XIO will evaluate to false, keeping the sump pump off. It could have worked had OP used different tags for auto and manual.


d'Oh, I got that wrong!
 

Similar Topics

Hi, I have a functions which extends codes generation for RFID tags. Basically it takes a char and splits it's hex value over 2 chars. I cannot...
Replies
24
Views
9,456
I'm onsite right now and I'm trying to decide how to proceed. I need to make some major edits to the Micrologix 1400 file, but the guy with the...
Replies
9
Views
1,161
Hi there, Quick Question. I have 2 PLCs and 2 solenoids. I would like to wire these up so that If either one turns on, it will turn on both...
Replies
17
Views
11,419
Hi all. I’m currently trying to combine 3 memory words in to a single display on a weintek hmi as I want to display running time. I have the...
Replies
4
Views
1,833
I have an application where I need around 60 Amps of 24V. Most 24V PS go up to 40A, so I need to be able to add them in parallel. Puls power...
Replies
36
Views
10,384
Back
Top Bottom