Controllogix5000 Lead/Lag/Off Logic

Several questions. What plc? ladder, structured text, function blocks, what are the specifications?
sounds like a homework assignment.
Please show us what you have done and we will be glad to help, but we will not do your homewok for you.
it will not do you any good when you get a job.
james
 
Thank you James, I am using L81 PLC. and what I am looking for, is how to switch between the pumps via HMI. for instance, if P1 is lead and the operator select P2 as lead, then P1 should switch to off. I am not looking for start/stop logic. just how the operator select the pumps as lead/lag /off. if it is in ladder, then it is easier for me. thank you again.
 
You want logic to control three pieces of logic:
  • the first piece chooses the numberof pumps that should be running
    • if there are only two pumps, and at most one should be running at any time, then this is a simple start/stop circuit pattern logic, which you probably already know, controlling the value of one bit, let's call that bit Run
  • the second piece chooses which pump should run when the number of pumps that should be running is not zero
    • if there are only two pumps, then this is modeled with a single bit
      • Let's call that bit Pump2_is_Lead
        • When that bit's value is 1, then Pump 2 is the lead pump, and Pump 1 is the lag pump (and will not run)
        • When that bit's value is 0, then Pump 1 is the lead pump, and Pump 2 is the lag pump (and will not run)
    • Changing that bit a simple flip/flop circuit that responds to the rising edge (one-shot) of an HMI button press
      • see this thread: One Input, Alternating two outputs, RSLogix 5000,
      • or search the forum for Alternating Outputs, flip-flop, wig-wag, etc.
      • for the rising edge/one-shot, the best way to do that is the "Set-and-Forget HMI/PLC" pattern i.e. have the HMI only write a 1 to a PLC memory bit from the HMI on a button press, and, after the PLC uses that 1 to trigger the flip-flop, have the PLC always write a 0 to that same bit
  • The third piece actually runs one of the pumps:
    • if the value of bit Run is 1, and the value of bit Pump2_is_Lead is 1, then run Pump 2, and don't run Pump 1
    • if the value of bit Run is 1, and the value of bit Pump2_is_Lead is 0, then run Pump 1, and don't run Pump 2
    • if the value of bit Run is 0, then don't run either pump
    • That is pretty trivial logic, and is left as an exercise
The trick here is "separation of concerns" i.e. isolating
  • control of when to run any pump, from
  • control of which pump to run
And then combining those isolated models to actually run a pump
 
You want logic to control three pieces of logic:
  • the first piece chooses the numberof pumps that should be running
    • if there are only two pumps, and at most one should be running at any time, then this is a simple start/stop circuit pattern logic, which you probably already know, controlling the value of one bit, let's call that bit Run
  • the second piece chooses which pump should run when the number of pumps that should be running is not zero
    • if there are only two pumps, then this is modeled with a single bit
      • Let's call that bit Pump2_is_Lead
        • When that bit's value is 1, then Pump 2 is the lead pump, and Pump 1 is the lag pump (and will not run)
        • When that bit's value is 0, then Pump 1 is the lead pump, and Pump 2 is the lag pump (and will not run)
    • Changing that bit a simple flip/flop circuit that responds to the rising edge (one-shot) of an HMI button press
      • see this thread: One Input, Alternating two outputs, RSLogix 5000,
      • or search the forum for Alternating Outputs, flip-flop, wig-wag, etc.
      • for the rising edge/one-shot, the best way to do that is the "Set-and-Forget HMI/PLC" pattern i.e. have the HMI only write a 1 to a PLC memory bit from the HMI on a button press, and, after the PLC uses that 1 to trigger the flip-flop, have the PLC always write a 0 to that same bit
  • The third piece actually runs one of the pumps:
    • if the value of bit Run is 1, and the value of bit Pump2_is_Lead is 1, then run Pump 2, and don't run Pump 1
    • if the value of bit Run is 1, and the value of bit Pump2_is_Lead is 0, then run Pump 1, and don't run Pump 2
    • if the value of bit Run is 0, then don't run either pump
    • That is pretty trivial logic, and is left as an exercise
The trick here is "separation of concerns" i.e. isolating
  • control of when to run any pump, from
  • control of which pump to run
And then combining those isolated models to actually run a pump
Thanks for explanation! it is very useful. the only difference is I have 3 pumps. one lead, one lag and one off. If P1 is lead and P2 is lag, I couldnt find out how to program it if the operator select the P3 as lead (in this situation, P1 should go to the Off status on the HMI).
 
How do you rotate lead/lag/off status between the pumps? is the a particular sequence with transitions e.g.
  1. 1=lead; 2=lag; 3=off; transition to #2
  2. 2=lead; 3=lag; 1=off; transition to #3
  3. 3=lead; 1=lag; 2=off; transition to #1
or something else? the logic is similar to what I suggested, except that you the state is stored in integers, and you do compares instead of contacts e.g.
  • IF (pump_count_to_run > 0 AND pump_1_leadlag=0) OR (pump_count_to_run > 1 AND pump1_1_leadlag<2) THEN <run pump 1>
where pump_N_leadlag is 0, 1, or 2, when pump_N is lead, lag, or off, respectively, and pump_count_to_run is the number of pumps to run.
 
I have this logic but it does not work. the status of the 3 pumps mixes up when I change one of them to lead or lag.
 

Attachments

  • Untitled1.jpg
    Untitled1.jpg
    111.4 KB · Views: 8
  • Untitled2.jpg
    Untitled2.jpg
    116.9 KB · Views: 9
  • Untitled3.jpg
    Untitled3.jpg
    74.7 KB · Views: 6
  • Untitled4.jpg
    Untitled4.jpg
    54.5 KB · Views: 7
what is the sequence of lead/lag/off assignment you are trying to implement?

how does the operator/HMI control the lead/lag/off state of the pumps?

there are only 9 possible unique pairs of comparisons, so why does that code have 15 pairs of comparisons?

why do the comparison output rungs run through ONS instructions?

why is there a start and stop for each pump in the HMI? the hmi should only control the number of pumps to be run (i.e. 0 or 1 or 2), and the lead/lag/off state of each pump.
 

Similar Topics

Looking to see if anyone has setup a ControlLogix Via Ethernet to a Omega Temperature controller CNi16D33-EIT-AL. Omega sent me an i-Server users...
Replies
0
Views
970
Can a ControlLogix PLC communicate over Ethernet using TCP/IP? I need to interface to an existing (proprietary) system, sending TCP/IP 'frames'...
Replies
12
Views
4,145
OK, (some of) you guys know by now that I'm not a PLC programmer, so I'm not really familiar with how a well-structured PLC program is typically...
Replies
2
Views
1,475
Sorry for these very basic questions, but I'm not a PLC programmer (per se): It appears that timers always seem to appear at the very end of a...
Replies
28
Views
10,479
If I define an INT or DINT for, say ... a BitFlag word ... is there any way to name each bit in that flagword with a unique name? It would seem...
Replies
17
Views
3,973
Back
Top Bottom