Campbell Scientific SDM-CD8S 8 Channel Solid State DC Control Module User Manual

Page 16

Advertising
background image

SDM-CD8S 8 Channel Solid State DC Control Module

The Example 1 program uses an array of values to set the SDM-CD8S control
outputs:

'Program name: SDMCD8Example.CR1
'Date written: 3/25/2008

'\\\\\\\\\\\\\\\\\\\\\\\\\ DECLARATIONS /////////////////////////
Public Flag(8) As Boolean
Public I
Public Temp(2)
Public Heat(2)
Public Cool(2)
Public Fan(2)
' Note CD16_Output(I), I = 1 & 2 are for Heat, I = 3 & 4 are for Cooling, I= 5 & 6 are for Fans
Dim CD16_Output(16)

'\\\\\\\\\\\\\\\\\\\\\\\\\\\ PROGRAM ////////////////////////////

BeginProg
Scan(5,Sec, 3, 0)

For I = 1 To 2

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 2

Fan(I) = 1

Next

I

EndIf

For I = 1 To 2

CD16_Output(I) = Heat(I)

CD16_Output(I+2) = Cool(I)

CD16_Output(I+4) = Fan(I)

Next

I

SDMCD16AC(CD16_Output(), 1, 0)

NextScan
EndProg

10

Advertising