LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

time of day?

Solved!
Go to solution

I am not to sure if I implemented this code correctly? from the arrays (day mode and times), I want to corresponding time stamp control with the proper mode of day. For example:

 

  • 5:00 AM with morning
  • 10:00 AM with day....and so forth.

my concern is with my implementation of the compare functions to get any time before 5AM as 'night' time mode....it works up to 5:01 AM for change of day. How can I get this code to change day mode at 5:00 AM ? the other times changes accordingly on their specific times (10:00 AM, 05:00 PM and 09:00 PM)....

 

time of day.png

0 Kudos
Message 1 of 8
(3,412 Views)
Solution
Accepted by topic author apok

Put in a first element as 12 midnight and make that a night time mode.

Message 2 of 8
(3,408 Views)

@RavensFan wrote:

Put in a first element as 12 midnight and make that a night time mode.


nice..... Smiley Happy

time of day.png

0 Kudos
Message 3 of 8
(3,402 Views)

too many functions?....

 

Spoiler
time of day.png

 

0 Kudos
Message 4 of 8
(3,385 Views)

You should build up your lookup array before the loop.  There's no need to keep recalculating it.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 5 of 8
(3,373 Views)

I was doing a little in ranging and a bit of coercing and thought of this thread.

 

ModeOfDay.png

 

 

Message 6 of 8
(3,309 Views)

@Darin.K wrote:

I was doing a little in ranging and a bit of coercing and thought of this thread.

 

ModeOfDay.png

 

 


 

wow....that is something different, thanks Darin!

0 Kudos
Message 7 of 8
(3,295 Views)

Hi Apok,

 

even simpler, just an array lookup:

check.png

When you need an offset of a minute or second: just subtract that from the timestamp before conversion to datarec cluster...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 8
(3,280 Views)