beautypg.com

Cr23x example – discrete outputs – Campbell Scientific 0871LH1 Freezing Rain Sensor User Manual

Page 13

background image

10

Scan (5,Sec,0,0)

'Start timer to corrdinate monitoring of ice signal output from sensor

TimeCount = Timer (1,Sec,0 )

'During icing event the sensor cycles through a 60 second monitoring 'interval. When the first icing event occurs

'a 60 second counter is started in the sensor. Once the 60 seconds have pasted the sensor will determine

'if further icing has occurred. If yes, the sensor signals the icing event, heats the probe, and resets counter.

'If no, the sensor signals no ice and resets counter.

If TimeCount >= 61 Then

'Record sensor outputs for icing and status. Based on scan rate.

PortGet (IceSignal,1 )
PortGet (StatusSignal,2)

'If a status fault is detected then the status code is stored to the Sensor Status data table.

'Only fault status data is stored to the table.

If StatusSignal = 1 Then
CallTable Sensor_Status
EndIf

'If an icing event is detected then store the record to the Ice Condition data table.

If IceSignal = 0 Then
CallTable Ice_Condition

'Reset the datalogger counter during icing events so that data is'coordinated with the sensors counter.

Timer (1,Sec,3)
EndIf
EndIf
NextScan
EndProg

1

10.2

CR23X Example – Discrete Outputs

;Set Timer input location

1: Timer (P26)
1: 3 Loc [ Timer ]

;Use Timer to monitor Control Ports 1 & 2 every 61 seconds

2: If (X<=>F) (P89)
1: 3 X Loc [ Timer ]
2: 3 >=
3: 61 F
4: 30 Then Do

3: Set Port(s) (P20)
1: 9999 C8..C5 = nc/nc/nc/nc
2: 9988 C4..C1 = nc/nc/input/input

;

Read the status of the ports and store to input locations for comparison.

4: Read Ports (P25)
1: 1 Mask (0..255)
2: 2 Loc [ IceStat ]

5: Read Ports (P25)
1: 2 Mask (0..255)
2: 1 Loc [ FaultStat ]

;Check to see if there is a fault in the sensor and output it to final storage.

6: If (X<=>F) (P89)
1: 1 X Loc [ FaultStat ]
2: 1 =
3: 1 F