Campbell Scientific SDM-CD16AC 16-Channel ac/dc Relay Controller User Manual
Page 17

SDM-CD16AC 16 Channel AC/DC Controller
The program assumes the temperature measurements have been made, and the
average temperature for each greenhouse is computed and residing in the
appropriate variable
Input Location assignments are as follows:
Variable Array
Description
Temp(5)
Avg temp, greenhouse 1..5
Heat(5)
Heater control, greenhouse 1..5 SDM-CD16AC
Port 1..5
Cool(5)
Cooler control, greenhouse 1..5 SDM-CD16AC
Port 6..10
Fan(5)
Fan control, greenhouse 1..5 SDM-CD16AC
Port 11..15
CD16_Output(16)
EXAMPLE 1: the actual values used to control
the SDM-CD16: CD16_Output(I), I = 1 to 5 are
for Heat, I = 6 to 10 are for Cooling, I= 11 to 15
are for Fans
CD16_Output as Long
EXAMPLE 2: the actual value used to control
SDMCD the CD16_Output bits set the SDM-
CD16AC ports. bits 0 to 4 are for ‘Heat, 5 to 9 are
for Cooling, 10 to 14 are for Fans
The Example 1 program uses an array of values to set the SDM-CD16AC
control outputs:
Program name: SDMCD16Example1.CR1
'Date written: 6/25/2007
'\\\\\\\\\\\\\\\\\\\\\\\\\ DECLARATIONS /////////////////////////
Public Flag(8) as boolean
Public I
Public Temp(5)
Public Heat(5)
Public Cool(5)
Public Fan(5)
'Note CD16_Output(I), I = 1 to 5 are for Heat, I = 6 to 10 are for ‘Cooling, I= 11 to 15 are for Fans
Dim CD16_Output(16)
'\\\\\\\\\\\\\\\\\\\\\\\\\\\ PROGRAM ////////////////////////////
BeginProg
Scan(5,Sec, 3, 0)
For I = 1 to 5
If (Temp(I) < 23.5) Then
Heat(I)
=
1
ElseIf (Temp(I) >= 25.5) Then
Heat(I)
=
0
EndIf
13