Campbell Scientific SDM-CD16S 16-Channel Solid State DC Relay Controller Module User Manual
Page 15

SDM-CD16S 16 Channel Solid State DC Control Module
The Example 1 program uses an array of values to set the SDM-CD16S 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
If (Temp(I) >= 27.5) Then
Cool(I)
=
1
ElseIf (Temp(I) < 24.5) Then
Cool(I)
=
0
EndIf
If (Heat(I) <> 0) OR (Cool(I) <> 0) Then
Fan(I)
=
1
Else
Fan(I)
=
0
EndIf
Next I
If TimeInToInterval(10,15,Min) Then Flag(2) = True
If TimeInToInterval(0,15,Min) Then Flag(2) = False
If Flag(2) = True then
For I = 1 to 5
Fan(I)
=
1
Next I
EndIf
For I = 1 to 5
CD16_Output(I)
=
Heat(I)
CD16_Output(I+5)
=
Cool(I)
CD16_Output(I+10)
=
Fan(I)
Next I
SDMCD16AC(CD16_Output(),
1,
0)
NextScan
EndProg
11