11-04-2009 05:35 PM
I have two prox switches and two relays that I can control in labview manually, however I have been unable to generate the code need to "latch" either of the relays depending on which prox was activated. The application is very simple, I have a linear actuator that I am running to the end of the stroke until it activates the "extended" prox switch. At that point I want to activate the second relay to reverse the direction of the motor until it activates the "retracted" prox switch.
I know this will take someone about two seconds to bust out the code but I have been failing for about 2 days on it. Any help would be much appreciated.
Thanks.
Solved! Go to Solution.
11-04-2009 08:02 PM
You probably just need the right logic along with some shift registers to remember the previous state of the relays.
Is your application designed to just run back and forth continuously? Do you ever need to stop the motor? What does each relay do? Is it one for forward, one for reverse, both on is invalid, and both off is stopped?
If you can post whatever is the best effort you have to date, it would be easier for us to get something working based on that rather than trying to start from scratch.
11-04-2009 11:16 PM
This application is for a test fixture that I am using to do life cycle testing with and will just run the actuator back and forth continuoulsy. I will need to put a timer delay in there in order to not viloate the duty cycle of the motor but I beleive I can handle that part if I can just figure out how to program the relays. One relay will be for reverse, one for forward and both on is invalid. I have been playing around shift registers but have been unable to figure out the right logic. My latest attempt is shown below, dont be confused by all the stuff around the prox outputs and relay inputs, those are just the associated logic from communicating with my LabJack hardware. My idea on how this should work is the VI starts, the motor starts driving (I dont care which way) as soon as it hits a prox it would switch the motor relays and the motor would reverse direction. I am not worried about which prox initiates which direction just as long as the relay stays on until it hits the next prox.
11-04-2009 11:41 PM - edited 11-04-2009 11:44 PM
Try this. The proximity switches and the relay outputs are all simulated. You will need to replace those with your digitial inputs and digital outputs.
In the final frame, that is a small flat sequence with the stop button running to it to ensure all relays are shut off in the event the Stop Program button is pressed by wire a False to the local variable. VI snippets turned it into property nodes with control reference controls wired into them.
11-13-2009 08:19 PM