Square D 400 Alternate Action

C

Thread Starter

Chuck

I am looking for code to generate an alternate action function. Have momentary input that when pushed turns output on, when pushed again turns
output off, etc.
 
S

Steve Myres, PE

Use a math box if available. Initialize an integer to 0, and then subtract the present value from 1 on every button press. Use the value to actuate the process. If math boxes on this processor execute every scan as long as power is
applied, you will need to condition the input with a one shot (A-B is like that).
 
L

Larry Thomson

This is relativly simple to implement.

Rung 1: use a rising edge trigger to drive an internal bit.

Rung 2:
a cominational AND/OR rung driving the output you want to control as follows
N.O. FROM INTERNAL AND N.C. FROM CONTROLLED OUTPUT OR'ED WITH A N.C FROM INTERNAL AND N.O FROM CONTROLLED OUTPUT.

If the above is not clear, send your email address to me at [email protected] and I will send you a logic drawing.

Regards,

Larry
 
J
I have always used a self-resetting counter (resets back to zero when it gets to two) and an IF statement that turns on the output when the counter equals one. This takes two rungs of the program but it is fairly easy to visualize.
 
I'm sure you've solved this problem by now, but.

A two rung solution I've used.

Take your input to a transistional coil. Second Rung.

rung 1, N.O. trans contact in series with N.C. output. In parallel with that a N.O. output in series with a N.C. trans contact. Your coil in this rung is the output.

This logic toggled for me on every motor I used it on.

Later
DR
 
Top