06-22-2025 11:42 PM
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..🙏🏻😊
06-23-2025 10:18 AM - edited 06-23-2025 10:25 AM
@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.
It could even be done all in one loop, but my two-loop solution feels cleaner. 😄