LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simple Event Timing on/off (lights, pumps, ect)

I want to make a simple vi to turn on and off lights for my aquarium at a selected time of day everyday.

The vi I should have a time and date stamp with a control for selecting the on and off time.

Sound�s simple enough but I�m having difficulty making any of the vi�s I�ve found work.
Does anybody have a vi that works well and is simple

Your help is appreciated
Mitchel
0 Kudos
Message 1 of 13
(3,913 Views)
Find attached a sample vi to get you started.
0 Kudos
Message 2 of 13
(3,913 Views)
there seems to be part of this vi that is missing.

"timed while loop.vi" is a vi that i don't have.

i'd like to have a look at your sugestion

thanks for your help
0 Kudos
Message 3 of 13
(3,913 Views)
Here is the complete vi
0 Kudos
Message 4 of 13
(3,913 Views)
If I understand what you are doing, this can be done using the get date/time function, and entering the on time and off time as a string. You break the string into hour, minute, and second. Then compare the current time to the ON/OFF times to control a boolean indicator. Then you would have to pass out the boolean value to control a switch for a light.

Attached is a working VI that does everything but the actual IO to control the light. Just think of the boolean indicator as being your aquarium light.
0 Kudos
Message 5 of 13
(3,913 Views)
Evan thanks a lot for your help.

The Vi you sent is nearly exactly what I�m looking for!!!!

I don�t want to look a gift horse in the mouth but there are a couple of things id like to change.

Do you know how to make the �enter time of day on/off� a control with up and down arrows to change the minutes in 15min increments. I was hoping to use a 12hr am/pm clock as well.

I was playing with a the vi but was unable to get a digital control to do what I wanted.

I also want to make this vi a subvi to use for multiple timing events.

I am able to understand most of this vi except for the pattern match and decimal string to number functions you used. The light in my head just isn�t coming on. I see that it works I just don�t understand how yet.
I�m looking at the help file to get a better understanding.

Also I�m not sure if the LED in your vi is big enough so I made it a little larger (for the blind) (kidding)

Thanks again for your help
Mitchel
0 Kudos
Message 6 of 13
(3,913 Views)
Mitchel,

give this a try. Let me know if you need any explaination for this. This version seems pretty self explainatory.
0 Kudos
Message 7 of 13
(3,913 Views)
Well thanks so much!!

This is a very simple vi that I�m able to understand completely.

I have only taken basics 1 and 2, two weeks ago so all this is very new to me.

I�m also new to programming but have a back ground in electronics.

I�ve spent a lot of time looking for a simple vi to do this type of simple timing. Much of what I�ve looked at is too difficult for me to follow and likely over kill for my needs.

Looking at other peoples code is a really good what to see just how things are done.

Thanks
Mitchel
0 Kudos
Message 8 of 13
(3,913 Views)
Well thanks so much!!

This is a very simple vi that I�m able to understand completely.

I have only taken basics 1 and 2, two weeks ago so all this is very new to me.

I�m also new to programming but have a back ground in electronics.

I�ve spent a lot of time looking for a simple vi to do this type of simple timing. Much of what I�ve looked at is too difficult for me to follow and likely over kill for my needs.

Looking at other peoples code is a really good way to see just how things are done.

Thanks
Mitchel
0 Kudos
Message 9 of 13
(3,913 Views)
Hello Evan just wondering if you could tell me why this vi might not be working?

I have edited your vi a bit and used it as a sub vi but it doesn�t seem to be working.

thanks
Mitchel
0 Kudos
Message 10 of 13
(3,913 Views)