Double Action Push Button - Logix Pro

automotivated

Member
Join Date
Oct 2016
Location
Wisconsin
Posts
5
Hello,

I am new to this forum and currently taking an intro to PLC class. I am working through a lab and currently stuck on a portion of the problem. It wants me to create a double action push button that will stop and start a timer that controls street lights. This button when pressed will need to start the sequence and then when pressed again stop the sequence and remember where it was at. When pressed after it has been stopped, the button will resume the program.

I am not looking for somebody to solve this program for me, only some hints that will help me solve it. Thanks in advance!

Objective:
Lab #4 includes practice problems for Chapter 9 (Prog

ram control commands), and Chapter 10 (comparison commands). Design a solution for the two associated problems, implement and test your design using your
ProLogix 500 software and submit the working files to me in ProLogix runnable file format.


Problem #1: The Double Action Pushbutton

Chapter 9 covers program control commands and these can be quite complex, so I have a "simple" little control problem for you. Of course, by now you know there is usually a twist to my little problems, and this one is no different. This one involves using only one normally open

pushbutton switch (NOPB) to turn on, and turn off an operation. In Lab #1 we used a NOPB to perform one action when pressed, to start or to stop an action. However, with a little creative programming using the control commands in Chapter 9 combined
with the Bit commands in Chapter 6, a NOPB can be used in a toggle fashion to do both. The first press
and release of the pushbutton starts an action (turns ON), pressing the PB a second time stops the action (turns it OFF). Same button, two results.
This is why it's called a "double" action PB. Old style
mechanical double action PB's used a holding spring and a catch to accomplish this function, but it can be done with a regular NOPB and a PLC with a little ingenuity.
Design a PLC circuit to operate so that when a NO
PB is pressed the operation in part 2 of the lab
begins, and when it’s pressed the second time it stops.
. Two design considerations: (1) you want the PB status to change only once per press, but the PLC will complete several scans during the time the PB is pressed down. If it toggles each scan time the result of the press will be random.


Hints: (1)
How can we make a PLC read that an input went true but only for one scan time? Also (2) how can we turn something on or off and make it stay that way until we decide to change it? So look at the bit commands in
Module #2? The big question you might have right now is "how will the PLC know what state the
operation is already in when I push the button so it can switch to the opposite?" Now that's a good question. The program has to determine what the current state
is, then change , or toggle,it. So we are dealing with a type of memory, the program has to remember what happened last time you pushed that button, and then do the opposite this time. Then it has to choose which rung will do that action, and go to it while it ignores, or skips over, the other option. Obvious this is a Program Control problem and the answer is in Chapter 9. So, I want you to use Input 0 as your double acting pushbutton. Now what is the operation I want you to control?
 
Use a One-Shot in this logic. (answer to hint number 1)

If you know how try making a flow chart or sequence of events (also called an algorithm in programming terms) to help you write the program.
 
Thanks for the quick reply! I will look into the one shot. I have the traffic light portion figured out, it is only the push button that is confusing to me right now.
 
Search the forum for flip flop. There are no less than 26 different ways to do this. Some are slicker than others, but beauty is in the eye of the code writer.
 
I am trying to get the OSR to work, and I believe I had it for a minute but I am not too sure what I did. Now when I activate the pushbutton, the timer EN flashes really quick and then does nothing. Do I have to latch the timer somehow?

Capture.jpg
 
Mark the TON and press [F1], take a deep breath and read the second paragraph. :)
The TON will start accumulating time when the rung condition is true. When the ring condition is false the accumulated time is reset to zero. With placing an OSR in front of that timer you are enabling the timer for one cycle and reseting it on the next cycle.
 
OSR requires the preceding instructions in the rung to transition from true to false before it will allow the rung conditions to be true again, and then only for one scan cycle.

There is also a limit instruction called LIM. Your software likely has it, and it will take care of your GEQ and LEQ instructions with a single instruction.
 
automotivated, sounds like you are still struggling. Do you have access to the instruction help and timing charts for a ONS and TON? That is what MaReKA was getting at. If you do and you read them, you should see why your code is a bit off base. Here are some hints:

A TON will only run when the rung in condition is true. That is, everything to the left of the TON instruction on a rung of logic would need to be true/on for the TON to be enabled and start timing.

On a rung of logic with a ONS, when every condition to the left of the ONS is true, the logic on the right side of the instruction will execute exactly once as long as the conditions on the left of the instruction stays true. If the conditions to the left of the ONS were to become false/turn off, then the next time they became true, the logic to the right of the ONS instruction could then again execute exactly once.

You can examine the output of a rung that you turn on with an OTE or a Latch with an XIC or XIO instruction on any rung (including the same rung as the OTE or Latch).

You need to get used to imagining how the logic is scanning. It is from left to right and then top to bottom. And once you reach the end of your program and the controller loops back to the top/first rung to begin again, all the outputs are still in the same state as the previous scan until that rung of logic is evaluated.
 
So, I was able to use the OSR to get the timer to run one cycle. Now, I need to get it to reset at the end of the cycle and also stop when I push the same NOPB that starts the program. From what I gathered from your posts the program would not run since the momentary push button only make the rung stay trung for a brief moment. By using a latch output and creating an input from that before the OSR, it enables the timer to run. Here is what I have now.

Capture.jpg
 

Similar Topics

What is the simples way to do a double click of a button in a ladder logic. New here and I hope this has not been asked before.
Replies
22
Views
535
Hi All, I'm keep getting double quotes in between selections rather than the beginning and the end. Here's the script and please help to find...
Replies
7
Views
800
Hi! I am using a TM200CE40T PLC from Schneider to write data over Modbus. I have used Memory words (%MW) before using the Write variable...
Replies
1
Views
534
Hello All, IÂ’m starting a new project where the plc is connected throught LAN with external software which write some data on PLC db, obviously...
Replies
1
Views
515
Hello. I have been working on my first plc project for a while now. I just ordered all the parts that I need and before I did that, I created the...
Replies
10
Views
2,031
Back
Top Bottom