06-14-2011 04:48 PM
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?
06-14-2011 05:25 PM - edited 06-14-2011 05:26 PM
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.
06-15-2011 08:19 AM
Here is my vi it is in 2010 let me know if you need it for 2009.
06-15-2011 08:22 AM
06-15-2011 08:39 AM
Yeah I did that by accident when my internet connection was lost yesterday.
06-15-2011 10:50 AM
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.
06-15-2011 10:53 AM
There is a mistake in the code I pasted. The 1000 constant should be a 1. Get Date/Time is in seconds, not millisceonds.
06-15-2011 11:07 AM
Thanks for your help, but I think I just got it working. Check it out if you want.