A.2.2 edlog, A.2.2 – Campbell Scientific ENC10/12, ENC12/14, ENC14/16, ENC16/18 Enclosures User Manual
Page 34

Appendix A. Door Switch
A.2.2 Edlog
;{CR10X}
; File name = Door Switch CR10X.csi 7Nov2005
; Door Switch Wiring
; +5V black - power to door switch
; C1 black - signal to control port 3
*Table 1 Program
01: 1
Execution
Interval
(seconds)
1: Set Port(s) (P20)
; Configure control ports as inputs or outputs
1: 9999
C8..C5
=
nc/nc/nc/nc
2: 9998
C4..C1
=
nc/nc/nc/input
; Measure Door switch
2: If Flag/Port (P91)
; (0=low=closed, 1=high=open)
1: 41
Do if Port 1 is High
2: 30
Then
Do
3: Z=F x 10^n (P30)
1: 1
F
2: 00
n,
Exponent
of
10
3: 1
Z Loc [ DOORopen1 ]
4: Else (P94)
5: Z=F x 10^n (P30)
1: 0
F
2: 00
n,
Exponent
of
10
3: 1
Z Loc [ DOORopen1 ]
6: End (P95)
; Two of many possible methods to output the status of the door open switch
; - assumes 5 minute data:
; Method #1: If the door is open even one reading during the output interval, output a 1
; for the Door variable
; Method #2: Door open status may be recorded as a fraction of the output interval
; (between 0 and 1) using the Histogram instruction.
; Method #1 ==================================
7: If (X<=>F) (P89)
1:
X
Loc
[
DOORopen1
]
2: 1
=
3: 1
F
4: 30
Then
Do
8: Z=F x 10^n (P30)
1: 1
F
2: 00
n,
Exponent
of
10
3: 2
Z Loc [ DOOR_out ]
A-6