Specifications
Appendix A. Door Switch
'\\\\\\\\\\\\\\\\\\\\\\\\\\\ PROGRAM ////////////////////////////
BeginProg
Scan(1,Sec, 3, 0)
' Configure control ports as inputs or outputs
PortsConfig (&B11111111,&B00000000)
' Measure Door switch
' (0=low=closed, 1=high=open)
If CheckPort(1) = true then
DOOR_open_1 = 1
Else
DOOR_open_1 = 0
EndIf
' 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
' If (DOOR_open_1 = 1)
Then
DOOR_output = 1
EndIf
CallTable Table101
' Reset door status after output interval
If TimeInToInterval(0,5,Min) Then
DOOR_output = 0
EndIf
' Method #2: Door open status may be recorded as a fraction of the output
' interval (between 0 and 1) using the Histogram instruction.
CallTable Table102
NextScan
EndProg
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
A-9










