Campbell Scientific SDM-IO16 16-Channel Input/Output Expansion Module User Manual
Page 33

SDM-IO16 16 Channel Input/Output Expansion Module
; Call instruction 188 to set the ports up
2: SDM-IO16 (P188)
1: 00
SDM
Address
2: 90
Command
Code
Option
3: 4444
Ports
16-13
;configure the ports
4: 4444
Ports
12-9
;Set so all ports will cause an interrupt
5: 4444
Ports
8-5
6: 4444
Ports
4-1
7: 1
Return Code Loc [ Errcount ]
;for return code
8: 2
First Loc [ Portstat_]
9: 1.0
Mult
10: 0.0
Offset
;Set flag 1 high to indicate we have run the setup code
3: Do (P86)
1: 11
Set Flag 1 High
4: End (P95) ; of IF block
;Now the rest of the other normal measurements would follow
*Table 2 Program
02: 0.0000 Execution
Interval
(seconds)
*Table 3 Subroutines
;Subroutine 98 will be run when a signal is generated by the I/O line
;from the IO16 connected to C8 on the datalogger.
1: Beginning of Subroutine (P85)
1: 98
Subroutine
98
;First read the port status from the IO16 as quickly as possible
;The speed at which the datalogger can respond to the I/O signal will
;determine the minimum pulse width that you can guarantee to capture
;as a change of state of a port. Typically this will be 10 ms but will
;vary with the datalogger and other activity.
;Reading the port status will cancel further polling
;until the next change of state.
2: SDM-IO16 (P188)
1: 00
SDM
Address
2: 91
Command
Code
Option
;read the port status into one location
3: 0
Ports
16-13
;port settings not used for code 91
4: 0
Ports
12-9
5: 0
Ports
8-5
6: 0
Ports
4-1
7: 1
Return Code Loc [Errcount ]
;for return code
8: 2
First Loc [Portstat ]
9: 1.0
Mult
10: 0.0
Offset
27