05-18-2010 09:48 AM
I'm using a DAQmx Write, Single Channel, Single Sample, Boolean to trigger a task through my DaqPad 6015 to turn on and off a relay. How can I put a time delay to perform the task so the relay turns on 14 hours after I started the test and stays on. Also, is there a way to have the task turn off when a certain condition is meet?
Thanks, Joel
05-19-2010 12:48 PM
Hi Joel-
You can perform some basic logic in your program using a state machine. Use a case structure with a boolean input to define two cases. Place a Get Date/Time in seconds VI on the block diagram and another inside the main while loop. Compare the start time to the running time, determine if the running time has past a certain point 14 hours in the future, and have the case structure switch cases once the 14 hour criterion has been met.
I attached a simple VI that demonstrates this architecture. You can add your code to it or modify it as needed.
Best of luck!