Campbell SDM-IO16 User Manual page 35

16 channel input/output expansion module
Table of Contents

Advertisement

;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
3: 0
Ports 16-13
4: 0
Ports 12-9
5: 0
Ports 8-5
6: 0
Ports 4-1
7: 1
Return Code Loc [Errcount ]
8: 2
First Loc [Portstat ]
9: 1.0
Mult
10: 0.0
Offset
;Set the output flag to force immediate storage of data
3: Do (P86)
1: 10
Set Output Flag High (Flag 0)
;Fix the array ID at 2000
4: Set Active Storage Area (P80)
1: 1
Final Storage Area 1
2: 200
Array ID
;Store the time now
5: Real Time (P77)
1: 1111
Year,Day,Hour/Minute,Seconds (midnight = 0000)
;Switch to high resolution to ensure we can store the maximum value with
;full resolution, i.e. 5 digits for 65536
6: Resolution (P78)
1: 1
High Resolution
;Sample the port status as a single binary value
7: Sample (P70)
1: 1
Reps
Appendix A. Program Examples
;read the port status into one location
;port settings not used for code 91
;for return code
A-9

Advertisement

Table of Contents
loading

Table of Contents