Announcement

Collapse
No announcement yet.

On/off input toggle switch

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts


  • On/off input toggle switch

    Giving some insight:

    The application will have a forward and backwards button inputs and will also have a on/off toggle switch input. I will assign the forwards button to x1, backwards button to x2, and lastly the on/off toggle switch input to x3. I will be using stages for the ladder logic. I will also have two outputs Y0 and Y1 which will be connected to two different motions on my stepper motor.

    I would like my program to run for 10 cycles and have done that using an UDC and have that coming through an input from the stepper motors output which allows the PLC to sense when it completes 1 cycle. The input from the driver is connected to the up portion on my counter and have the counter reset tied to holding my backwards button for three seconds. I have programmed the motor to stop once the stepper motor has reached 10 cycles or if I press the backwards button.

    The part that I am having trouble with is that I would like to use an on/off toggle switch for my input, where if it is ON, triggers my Y0 to run. And if it is Off, the triggers y1 to run. Since the on/off toggle switch is connected only through one input how would I program it to run y0 if there is no contact with x3 or to run y1 if there is contact with x3. Originally I was thinking of having x1 advance to my SG1 and then in my SG 1 having the on/off toggle switch select in between the two different outputs as stated above. And from there would activate X1 again to advance to SG3 and run which ever output is told to be on. I thought about doing this through attaching a cbit in stage 2 and then attaching that same cbit to my actual outputs y0 or y1 in stage 3 so that when I advance to my next stage the program will automatically run which that output. But say I pause the program as it has only completed 5 cycles and wish to resume that how would I do so using my forward button since I would have tied that to advancing between the second stage and third stage?

    Anyone have a way to solve this? Please include a picture of the ladder logic so I can visual how it will look. I appreciate the help and guidance. I will attach a photo of the part I have completed which is the UDC counter wired to tell the motor to stop.
    Attached Files


  • #2
    If X3 is a Toggle Switch then you don't need a C bit to know its State, its either on or off and stays that way until you hit the button. So in your stages you could possibly ( any logic And x3 do y1) or ( any logic And Not x3 do y0). I guess i'm envisioning something like in each stage you have 2 options one with X3 on and one with X3 off unless you need X3 to stay the same thru 10 cycles then you'd have to use a C bit to capture the state before your 10 cycles begin.

    Comment



    • #3
      Originally posted by brucekess View Post
      If X3 is a Toggle Switch then you don't need a C bit to know its State, its either on or off and stays that way until you hit the button. So in your stages you could possibly ( any logic And x3 do y1) or ( any logic And Not x3 do y0). I guess i'm envisioning something like in each stage you have 2 options one with X3 on and one with X3 off unless you need X3 to stay the same thru 10 cycles then you'd have to use a C bit to capture the state before your 10 cycles begin.
      HOw would I use the cbit to capture the state before the cycles begin?

      Comment



      • #4
        Because stages reset certain memory upon exit that stage, Outputs turn off when you go from sg1 to sg2, but if they turn back on in sg2 then you don't notice because the output table is written to after all the logic is done. Outside and before your stage ( if x3 is 1 then set c1000, then use c1000 thru your 10 cycles or just all the way thru 1 cycle), don't forget to reset at the end.

        I don't know if you want the ability to do 4 cycles with x3 on then 6 with x3 off, or some other combination. If you don't then this is why you would set the bit and do all 10 cycles the same way. If you don't care then this is not needed. After rereading your original post i may have had a different idea than what you are trying to do.

        If X3 is going to control which motor you are running then I don't know why you would want to stop motor 1 and start motor 2 midway thru with some1 pressing the button only. I'd want to get to a certain point and stop, then wait for someone to press x3 and toggle it to do the rest with the other motor. Seems like it could use either motor at random just by pressing X3.


        Comment

        Working...
        X