Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Insert time delay on DAQmx Write

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

0 Kudos
Message 1 of 2
(3,076 Views)

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!

Gary P.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(3,059 Views)