A Cr10X Program That Uses The Interrupt Subroutine In The Datalogger To Record The Time Of Change Of Any One Of The Ports On An Sdm-Io16 - Campbell SDM-IO16 User Manual

16 channel input/output expansion module
Table of Contents

Advertisement

SDM-IO16 16 Channel Input/Output Expansion Module
;Maximum windspeeds with time of maximum
11: Maximum (P73)
1: 4
2: 10
3: 2
;Totalize the rainfall over the previous hour
12: Totalize (P72)
1: 4
2: 6
*Table 2 Program
02: 0.0000
*Table 3 Subroutines
End Program
A.4 A CR10X Program that uses the Interrupt
Subroutine in the Datalogger to Record the Time of
Change of any one of the Ports on an SDM-IO16
;{CR10X}
;An example that shows the use of the IO16 to detect the change
;of state of one of the 16 ports and indicate this to the
;datalogger using the I/O line (which should be connected to C8).
;The datalogger in turn reads the status and captures the
;current port status and writes this with a time stamp to memory
;
*Table 1 Program
01: 5
;First configure the IO16 if not already done
;If flag 1 is not set, i.e. the program has just
;been compiled or datalogger powered up.
;This code is needed to set the IO16 to pulse its I/O line
;if any port changes state.
1: If Flag/Port (P91)
1: 21
2: 30
; Call instruction 188 to set the ports up
2: SDM-IO16 (P188)
1: 00
2: 90
3: 4444
4: 4444
5: 4444
6: 4444
7: 1
8: 2
9: 1.0
10: 0.0
A-8
Reps
Value with Hr-Min
Loc [ Windspd_1 ]
Reps
Loc [ Rain_1 ]
Execution Interval (seconds)
This program can also be used with a CR23X datalogger.
Execution Interval (seconds)
Do if Flag 1 is Low
Then Do
SDM Address
Command Code Option
Ports 16-13
Ports 12-9
Ports 8-5
Ports 4-1
Return Code Loc [ Errcount ]
First Loc [ Portstat_]
Mult
Offset
;configure the ports
;Set so all ports will cause an interrupt
;for return code

Advertisement

Table of Contents
loading

Table of Contents