LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

simple on/off timer for LV 7.0

Hello All
I am a novice trying to use LV 7.0 to control a relay with a digital i/o port of a NI 6008 usb device.
I would like to be able to set the "on time" and "off time" of this relay independantly. Example: 20min on and 5 min off and repeat in a loop until intervals are changed. I found examples done in later versions of LV than I have.....
Any input would be GREAT!!
Thanks
Mully
0 Kudos
Message 1 of 7
(4,219 Views)

First of all, check the current drain and voltage of the relay you are driving.  Compare to the specs of the DIO device.  If the relay draws too much current, you could damage the DIO.  In this case, you would need a driver circuit.  If the relay is not a 5 volt relay, you would need a driver circuit.  A driver can be built with a ULN2003 IC.

For software, write your code to set the DIO output high (or low, whatever turns the relay on).  Then create flat sequence structure that just has a time delay in it.  Set the delay to whatever you want.  Next, change the DIO output, and then another timer.  Put the whole thing in a while loop to repeat, with a stop button to stop it.  Be aware that the stop button will not stop the loop until the entire sequence of events inside the loop have finished executing.

Hope this helps.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 7
(4,214 Views)

Thanks..tbob

I have the I/o part worked out but I can't seem to create the software to control the on/off part. I have not had much exp with labview.

Im not sure what a flat sequence structure does and the help for LV confuses me even more.

I just need a simple adjustable on/of timer for LV-7.0

Thanks

Mully

0 Kudos
Message 3 of 7
(4,209 Views)

A picture is worth a thousand words:

Message Edited by tbob on 02-28-2006 01:20 PM

- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 7
(4,206 Views)

Wow thanks! tbob

I see how most of this should work ..I think ....but I do not understand the relay state control part?? I have to provide port and channel information to the I/O device. I used an array to select port 0 and write a 1 or 0 to turn ch0 of device on and off. Any thoughts??

thanks

Mully

 

0 Kudos
Message 5 of 7
(4,198 Views)
I am not familiar with the NI6008, sorry.  But it seems as if the standard functions for DIO should work.  Look in the Functions palette - NI Measurements - Data Acquisition - Digital I/O.  Read the help on these functions.  Also you can search Labview examples for DIO vi's.
- tbob

Inventor of the WORM Global
0 Kudos
Message 6 of 7
(4,193 Views)

Hey thanks again tbob !!!

Great help!!

I was able to mod your code to exactly what I needed..

Mully

0 Kudos
Message 7 of 7
(4,183 Views)