ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stopping a Test

I have a VI constructed in Labview, where I am using a digital 5V output from a plc to start my test. I have used the trigger vi to do this and my vi runs fine and starts up fine when it recieves the digital signal. My question is how do I stop it? I can get another digital pulse from the plc assigned to the same port, or a differnt port if needed. Or I could get the digital 5V to stay on during the test and shut off when the test is complete. What I dont know is how to write the code to do any of this. Any suggestions or examples I could look at would be greatly appreciated. Thanks.
 
Thomas
0 Kudos
Message 1 of 4
(2,620 Views)

It is a little hard to determine the best answer for you without seeing your existing code, but if you put the test in a while loop with your DAQ pin read, and place the test code inside a case statement that runs when the pin is high (True condition) and executes another "Null" case when low, then it will only run when True. This is a little bit of a simplification. Also, remember to put a "Wait (ms)" function from the "Time & Dialog" pallette with some value wired to it. This is to prevent the loop from maxing out your CPU.

If you can send a copy of your code, or a screen shot of the diagram (.jpg NOT .bmp Please!) it might help.

 

P.M.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 2 of 4
(2,618 Views)
Here is my code so far. Im not sure I understand how to use a case structure yet. Thanks for the info!
0 Kudos
Message 3 of 4
(2,600 Views)
I'm not certain, don't have the hardware here, but you might try the "Reference Digital Edge" mode of the trigger vi. You probably want to have a case statement around you "checking and display code" in the main loop, that looks at the DAQ output to see if you are getting anything. It may be triggered on the error out, using the "timeout error" of the DAQ to determine whether to run the other code. You could filter for that code number (don't know what it is, probe the error out when you run it the first time and see), use it to set the case to not run your code and reset the error cluster to "no error".
 
P.M.

Message Edited by LV_Pro on 08-04-2005 11:16 AM

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 4 of 4
(2,568 Views)