LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

timing

I have created a vi to do a period reading on my daq continuity check, I want a relay to close within 1000 ms stop the loop and send signal to my pass / fail button.  I have the daq test figured out, I cannot get my test to fail the 1000 ms timout if the relay does not close within that time frame.  how would I do this?

0 Kudos
Message 1 of 8
(2,944 Views)

A screenshot of your code would be very helpful. How are you capturing your relay state? What are you using for an acquisition loop? Is it a timed loop? If I understand correctly, you want to evaluate whether or not your relay closed within 1000ms of an event. This should be a simple operation. One way to do this is to use a shift register. When your event begins call Get Date/Time and send to send the timestamp to the shift register. When the relay closes, call Get Date/Time again and subtract from the shift register value. The difference will be in seconds. You can evaluate this.

0 Kudos
Message 2 of 8
(2,937 Views)

Here is my vi it is in 2010 let me know if you need it for 2009.

0 Kudos
Message 3 of 8
(2,918 Views)
0 Kudos
Message 4 of 8
(2,916 Views)

Yeah I did that by accident when my internet connection was lost yesterday.

0 Kudos
Message 5 of 8
(2,911 Views)

I'll be honest, you code is a little messed up. The timer you have in there will not work. Basically once the data flow hits that operation it will halt for 10 sec. regardless of your DAQ performance. There are many ways to fix this. Take a look at the snapshot I attached. It eliminates the express timer (you don't need it) and replaces it with Get Date/Time calls.

 

LV_001.png

0 Kudos
Message 6 of 8
(2,893 Views)

There is a mistake in the code I pasted. The 1000 constant should be a 1. Get Date/Time is in seconds, not millisceonds.  

0 Kudos
Message 7 of 8
(2,892 Views)

Thanks for your help, but I think I just got it working.  Check it out if you want.

0 Kudos
Message 8 of 8
(2,887 Views)