Create program to run on units

Add points to control as Absolute (hardcoded to id). In this case we only want to bring in points from units 2-4 since the first one starts from the schedule. Include scheduleRefs (on equip) curVal and nextTime variables.

Create a time variable. We called it "storedScheduleTime".

Then configure the logic below.

Logic Flow:

IF nowBlock + timeBlock add (use timeToTimeAdd block) to scheduleNextTime + timeBlock are inRange of min=0 and max=1 AND scheduleCurVal is UnOccupied, then set storedScheduleTime to scheduleNextTime + timeBlock. (We are getting the current time and schedule time from the dateTime format and adding them up. If they are within range and schedule curVal is Unoccupied, store the current schedules time. Reason we want to store the schedule time is because once the schedule time is reached, it changes to the next time, which would no longer be useful. So we capture the time before it changes.)

Continue from 1, Else IF storedScheduleTime add to nowBlock + timeBlock are inRange of min=0 and max=10 AND scheduleCurVal is Occupied, then set Unit 2 to UnOccupied, else null. (After capturing the scheduleTime, we now add that with now time to get a number value. For every minute, it'll go up one. So 10 = 10 mins. At this point, the schedule would also be Occupied since it reached the time, so we include the parameter in there to check.)

Continue from 2, Else IF storedScheduleTime add to nowBlock + timeBlock are inRange of min=0 and max=20 AND scheduleCurVal is Occupied, then set Unit 3 to UnOccupied, else null.

Continue from 3, Else IF storedScheduleTime add to nowBlock + timeBlock are inRange of min=0 and max=30 AND scheduleCurVal is Occupied, then set Unit 4 to UnOccupied, else null.