04-02-2015 10:46 AM
I have two stepper motors which control a cart on each axis. My goal is to make a program which allows others in my lab to easily assign a direction and distance they want the cart to move and then issue the command. I want them to be able to update the direction and distance and then push a GO button which will sent the signal to the cart. This is done using a VISA resource. I have most the program done. The issue I am running into is that my button does not work the way I want. Either it doesn't always register the push or it sends the signal multiple times to the drive. I have attached 2 VIs which implement my button mechanics in two ways. Any help as to what I can to one or the other VI to get it to issue the command only once while letting the operator make additional input changes w/o stopping and starting the VI. Thanks.
Solved! Go to Solution.
04-02-2015 11:11 AM - edited 04-02-2015 11:12 AM
You should be using the event structure so good for you on one of those examples attempting to use it. Attached is the implementation that will actually work. You press the button once and it acts on it once. Also pressing stop, or closing the window does work as well.
EDIT: If you get some free time you should take some training and try to find examples on the event structure.
6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
04-02-2015 11:12 AM
In your Drive Control.vi, change the Mechanical Action of your Go button to be Latch When Released. This will allow the command to be send once every time the button is clicked.
I also recommend moving the rest of your code into your event structure so ensure the command has the latest values when you press the button.