//temperature monitoring system
     //set IO channel 1 when AD>50 during weekends
     //set IO channel 1 when AD>40 during weekdays
 
LABEL LOOP
     IF DAYOFWEEK = 1 Then
          //weekend
          CALL CHECK_WEEKEND
     ELSE
          IF DAYOFWEEK = 7 Then
               //weekend
               CALL CHECK_WEEKEND
          ELSE
               //weekday
               CALL CHECK_WEEK
          END IF
     END IF
GOTO LOOP
 
 
SUB CHECK_WEEKEND
     IF AD02 > 050 Then
          //above 50
          SETIO 01
     ELSE
          //below 50
          CLEARIO 01
     END IF
END SUB
 
 
SUB CHECK_WEEK
     IF AD02 > 040 Then
          //above 40
          SETIO 01
     ELSE
          //below 40
          CLEARIO 01
     END IF
END SUB

BACK TO SAMPLE OVERVIEW