LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with Creating Cluster from 2D Array and Adding Flag for Overlapping Time in LabVIEW

Solved!
Go to solution

Thanks @altenbach — I have got my solution!

 

Iterating minute-by-minute across the full time range and checking membership in break/work intervals (with break priority) helped me generate a clean list of flagged intervals. I used this to build the cluster format I needed:

 

Start Time

 

End Time

 

Flag (0 = work, 1 = break)

 

 

Appreciate the insights and nudges in the right direction..

NI community is awesome..🙏🏻😊

0 Kudos
Message 11 of 12
(111 Views)

@Tusharvp4 wrote:

Iterating minute-by-minute across the full time range and checking membership in break/work intervals (with break priority) helped me generate a clean list of flagged intervals. I used this to build the cluster format I needed:

...

Flag (0 = work, 1 = break)..

...


There are dozens of ways to do this, of course, but treating the times as integers is safer for comparisons. You could do the entire first loop in timestamps directly, but it is just more baggage to carry.

 

One problem with only two states (work, break) is that you need to decide how to coerce the two other states if they would ever occur. (break during off time, etc.)

 

You also need to be certain that the input arrays are clean and sorted, ese you need to add code to polish them first.

 

altenbach_0-1750691830479.png

 

It could even be done all in one loop, but my two-loop solution feels cleaner. 😄

 

 

0 Kudos
Message 12 of 12
(96 Views)