From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

24 hour timer query

Hi!

I am trying to set up a case where the user has the ability to set the input of a timer for my 3 LED lights RED, GREEN, BLUE.

 

The sort of input i am looking for is to prompt the user to set the period of lighting

For example

16:8 which is 16 hours of light 8 hours of darkness. I would hope this could run in a loop until either a stop button is pressed or the amount of cycles in days is set.

 

Can someone please offer some advice. I have tried different methods but cant seem to get a handle on how to approach the task

0 Kudos
Message 1 of 15
(3,607 Views)

Not able to View your code (using Lower LV version)

Using Get Date and time in seconds function,  subtract initial time from current time which will give you the time difference, continue the same till you reach target time (assume 16 hours of light), once you achieve 16 hours again re initiate the start time and subtract with current time for darkness

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 15
(3,600 Views)

Timimg.png

 

Sample solution. This may give you an hint.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
Message 3 of 15
(3,589 Views)

Hello PalanivelIT, thank you for the hint solution. i will implement it now and see how it goes. and perhaps post some photos if i require

0 Kudos
Message 4 of 15
(3,579 Views)

Not sure if that solves the issue, there is alot more going on in the interface that you might not be able to see 😞

0 Kudos
Message 5 of 15
(3,556 Views)

How about something like this?

OnTime.png

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 6 of 15
(3,553 Views)

Gday RTSLVU 

its only the lights on the red/green/blue arrangements. Attatched is the files associated with this problem

thanks in advance 🙂

Download All
0 Kudos
Message 7 of 15
(3,541 Views)

I can't see your code as I am only running LabVIEW 2017 here.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 8 of 15
(3,539 Views)

You are not attaching all of the files needed for your VI.

 

You should/need to use a State Machine, my favorite is JKI.

 

The JKI State Machine has an event structure in it, you can set a nominal timeout case to check the time elapsed and cycle your LEDs accordingly. You can do this while allowing the user to control the front panel and change things, ie, turn motor on, etc.

 

mcduff

0 Kudos
Message 9 of 15
(3,527 Views)

I too cannot run the code since there are multiple subVI's missing. Please include all code so people on the forum can assist you.

0 Kudos
Message 10 of 15
(3,507 Views)