Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get a case to run only once

I am using an e-series DAQ board to bring a pwm signal, then I use labview to use that signal to pick one of three cases. depending on the case picked a finite pulse stream is sent out. Currently the finite pulse vi keeps repeating because the the program stays in the case. I need a way to get labview to run the finite pulse output only once, and not run again until a new case is picked. I don't have the case in a while loop.
Thanks For The Help
0 Kudos
Message 1 of 4
(2,603 Views)
Hello,

There shouldn't be any fundamental reason why you cannot execute a case structure just once. Yes, putting the case in a while loop would certainly cause this, but running the VI "continuously" would do the same thing even without a while loop. The next thing to look at is the VI inside the case structure. You can run the VI with the "highlight execution" on to see if it really is the case that is executing continuously or the VI that is running continuously. At any rate, this shouldn't be a problem with the case structure itself. You could test this by making a small program with just a case structure and a dummy operation inside. Let me know if you are still having trouble though.

Russell
Applications Engineer
National Instruments
http://www.n
i.com/support
0 Kudos
Message 2 of 4
(2,603 Views)
I am still haveing problems so I will try and attach my program and see if you can help a little more that. It will probably be easier for you to look at this way. When you look at the diagram sequence 0 is the one the problem is in. In that sequence you will see a case structure and that is where the finite pulse train vi is. When case 1 is selected the finite pulse train will run again and again until I leave case 1. I need to have the program run the finite pulse train once and then wait and do nothing until the case is changed. The finite pulse train will be in all cases inside the case structure I just haven't done that yet, I am waiting until it works. The pulse train is used to move a stepper motor that is why running only once is im
portant because the stepper motor is used to position something.
0 Kudos
Message 3 of 4
(2,603 Views)
I am assuming the "Retriggerable Finite Pulse Train (DAQ-STC).VI" is an example program you downloaded from the website. (It actually wasn't included in your attachment, but I think I found it.) This VI does have a while loop inside of it. If you open it up you will notice that it won't stop until the "Stop" button is pressed. In other words it is the while loop inside this VI that is running continuously hanging execution and not the case structure.

In the future, you can narrow something like this down by using the "highlight execution" button and other debugging tools. They would have indicated that the program execution was stuck somewhere in the VI. In this case, the while loop waiting for the stop button to be pressed.

-Russell
0 Kudos
Message 4 of 4
(2,603 Views)