2 edlog example – Campbell Scientific SDM-CD16AC 16-Channel ac/dc Relay Controller User Manual

Page 19

Advertising
background image

SDM-CD16AC 16 Channel AC/DC Controller

ElseIf (Temp(I) < 24.5) Then

'Set appropriate Cooler Bit Low:

CD16_Output

=

CD16_Output AND (&H7FFF - 2^(I+4))

EndIf

Next I

CD16_Output = (CD16_Output AND &H3FF) 'Set all Fan Bits Low

'Turn on Fan Bits for active Heaters or Coolers:

CD16_Output = CD16_Output OR (((CD16_Output*2^5) OR (CD16_Output*2^10)) AND &H7C00)


If TimeInToInterval(10,15,Min) Then TimedFanON = True

If TimeInToInterval(0,15,Min) Then TimedFanON = False

If TimedFanON = True Then

CD16_Output = CD16_Output OR &H7C00


SDMCD16AC(CD16_Output(),

1,

0)

NextScan
EndProg

8.2 Edlog Example

The example is written for the CR10(X) Measurement and Control Module.
The program concepts presented are the same for the CR23X, 21X, and CR7
dataloggers with minor program code changes.

In this example, the SDM-CD16AC is used to control the temperature between
23

° and 28°C in each of 5 greenhouses. In each green house the SDM-

CD16AC controls a heating unit, a refrigerating unit, and an air mixing fan
according to the following conditions.

Heating unit: Activate when temperature < 23.5

°C. Deactivate when

temperature > 25.5

°C

Cooling unit: Activate when temperature > 27.5

°C. Deactivate when

temperature < 24.5

°C

Mixing fan: Activate whenever the heating or cooling units are activated.
Activate for 5 minutes out of every 15 minutes.

The program assumes the temperature measurements have been made, and the
average temperature for each greenhouse is computed and residing in Input
Locations 1 through 5.

15

Advertising