NETWORK 1 // Main Program
// On the first scan, call subroutine 0
LD SM0.1
CALL SBR_0
NETWORK 1 // Subroutine 0
LD SM0.0
TON T37, +50 // Set the interval for the timed interrupt 0 to 5 SEC
LD T37
ATCH INT_0 10 // Attach timed interrupt 0 (Event 10) to INT_0
ENI // Global interrupt enable
NETWORK 1 // Interrupt 0
// Read the value of AIW4 every 5 SEC
LD SM0.0
MOVW AIW4 VW100
// On the first scan, call subroutine 0
LD SM0.1
CALL SBR_0
NETWORK 1 // Subroutine 0
LD SM0.0
TON T37, +50 // Set the interval for the timed interrupt 0 to 5 SEC
LD T37
ATCH INT_0 10 // Attach timed interrupt 0 (Event 10) to INT_0
ENI // Global interrupt enable
NETWORK 1 // Interrupt 0
// Read the value of AIW4 every 5 SEC
LD SM0.0
MOVW AIW4 VW100