Campbell Scientific SDM-CD16AC User Manual

SDM-CD16AC 16 Channel
AC/DC Controller
Revision: 12/08
Copyright © 1987-2008
Campbell Scientific, Inc.

Warranty and Assistance

The SDM-CD16AC 16 CHANNEL AC/DC CONTROLLER is warranted by CAMPBELL SCIENTIFIC, INC. to be free from defects in materials and workmanship under normal use and service for twelve (12) months from date of shipment unless specified otherwise. Batteries have no warranty. CAMPBELL SCIENTIFIC, INC.'s obligation under this warranty is limited to repairing or replacing (at CAMPBELL SCIENTIFIC, INC.'s option) defective products. The customer shall assume all costs of removing, reinstalling, and shipping defective products to CAMPBELL SCIENTIFIC, INC. CAMPBELL SCIENTIFIC, INC. will return such products by surface carrier prepaid. This warranty shall not apply to any CAMPBELL SCIENTIFIC, INC. products which have been subjected to modification, misuse, neglect, accidents of nature, or shipping damage. This warranty is in lieu of all other warranties, expressed or implied, including warranties of merchantability or fitness for a particular purpose. CAMPBELL SCIENTIFIC, INC. is not liable for special, indirect, incidental, or consequential damages.
Products may not be returned without prior authorization. The following contact information is for US and International customers residing in countries served by Campbell Scientific, Inc. directly. Affiliate companies handle repairs for customers within their territories. Please visit www.campbellsci.com to determine which Campbell Scientific company serves your country. To obtain a Returned Materials Authorization (RMA), contact CAMPBELL SCIENTIFIC, INC., phone (435) 753-2342. After an applications engineer determines the nature of the problem, an RMA number will be issued. Please write this number clearly on the outside of the shipping container. CAMPBELL SCIENTIFIC's shipping address is:
CAMPBELL SCIENTIFIC, INC.
RMA#_____ 815 West 1800 North Logan, Utah 84321-1784
CAMPBELL SCIENTIFIC, INC. does not accept collect calls.
SDM-CD16AC Table of Contents
PDF viewers note: These page numbers refer to the printed version of this document. Use the Adobe Acrobat® bookmarks tab for links to specific sections.
1. Function........................................................................1
2. Control Specifications.................................................2
3. Power Considerations.................................................2
4. Installation.................................................................... 3
4.1 Wiring.......................................................................................................4
4.1.1 SDM-CD16AC Power and Control Connections ...........................4
4.1.2 Controlled Device to SDM-CD16AC Connections........................5
4.1.3 Motor Control.................................................................................6
5. Address Selection Switches.......................................7
6. Datalogger Programming............................................8
6.1 CRBasic Programming.............................................................................8
6.1.1 SDMCD16AC Instruction ..............................................................8
6.1.2 SDMSpeed Instruction....................................................................9
6.2 Edlog Programming................................................................................ 11
7. Theory of Operation ..................................................11
8. Program Examples....................................................12
8.1 CRBasic Example...................................................................................12
8.1.1 Controlling Two SDM-CD16ACs................................................12
8.1.2 Control Temperature and Fans......................................................12
8.2 Edlog Example .......................................................................................15
Figures
1. SDM-CD16AC Face Panel.........................................................................1
2. Connection Block Diagrams.......................................................................3
3. Switch Operation........................................................................................5
4. Typical Wiring Application........................................................................6
5. SDM-CD16AC Relay Outputs to MCC .....................................................7
6. Addressing..................................................................................................8
i
SDM-CD16AC Table of Contents
Tables
1. Datalogger to SDM-CD16AC Connections............................................... 4
2. Base 10 to Base 4 Reference Chart............................................................9
3. Bit Period Values..................................................................................... 10
ii

SDM-CD16AC 16 Channel AC/DC Controller

3
16
4
C2
C2
5
16
C2
C2
C2
6
16
C2
C2
C2
7
16
C2
C2
8
C2
16
C2
9
C2
C2
16
C2
10
C2
C2
16
11
C2
C2
C2
16
12
C2
C2
13
C2
16
C2
14
C2
C2
16
15
C2
ON
OFF
AUTO
+12V
GND
C1
C2
C3
C2
16
C2
C2
C2
C2
C2
16
16
C2
C2
C2
16
C2
C2
SDM-CD16AC
16 CHANNEL AC/DC CONTROLLER
LISTED
5Z21
U
L
2
1
ADDRESSES
2
1
Logan, Utah
3
0
3
0
INDUSTRIAL CONTROL EQUIPMRNT
U
L
FIGURE 1. SDM-CD16AC Face Panel
INPUT: 12 VDC
LOAD: 5 A 277 VAC 1/6 HP 5 A 125 VAC 1/10 HP
S/N:
ON
OFF
AUTO
1
16
C2
C2
16
C2
2
C2
C2
16
C2
C2
C2
C2
C2
MADE IN USA

1. Function

NOTE
The SDM-CD16AC has 16 AC/DC relay control ports (see Figure 1). Each relay port can be controlled by a datalogger or controlled manually with a manual override toggle switch.
The toggle switch has three positions; "ON" and "OFF" for manual override, and "AUTO" for datalogger control. In the "ON" position, the common (COM) and normally open (NO) contacts are closed (see Figure 3). In the "AUTO" position, the state of the relays are controlled by the datalogger control ports.
The SDM-CD16AC is a synchronously addressed datalogger peripheral. Three ports on the datalogger are used to address the SDM-CD16AC, then clock out the desired state of each of the 16 control ports. Up to 16 SDM­CD16ACs may be addressed, making it possible to control a maximum of 256 ports from the three datalogger ports.
In CRBasic, the SDMCD16AC instruction is used to control the SDM­CD16AC. In Edlog, either I/O Instruction 104 (CR10(X), CR23X, 21X) or Instruction 29 (CR7) is used.
Ensure that the datalogger contains the appropriate instruction prior to system deployment. The SDM-CD16AC is not compatible with our CR200-series, CR500, or CR510 dataloggers.
1
SDM-CD16AC 16 Channel AC/DC Controller

2. Control Specifications

Operating voltage: 12 VDC nominal (9 to 18). Current drain at 12 VDC: 6 mA quiescent; 45 mA per active LED (switch on
or auto active). Total cable length: cable lengths should be kept as short as possible; 20 ft (for
many applications); lengths longer than 20 ft may be possible for CRBasic dataloggers if the SDMSpeed instruction is used; 600 ft (possible for CR7)
Toggle switch: ON/OFF manual override; AUTO for datalogger control. Underwriters Laboratories (UL) and Canadian Underwriters Laboratories
(CUL) listed product. UL and CUL listing number is 5Z21.
RELAY SPECIFICATIONS
Arrangement: Single pole double throw, Break before make Contact material: Gold-clad silver Individual contact rating: 5 A at 30 VDC, .3 A at 110 VDC, 5 A 1/10 HP at
125 VAC, 5 A 1/6 HP at 277 VAC Coil voltage: 9 to 18 VDC Coil resistance: 360 Ohms±10% Expected life (contact closures): Mechanical 10 Actuation/Release time: Approx. 4 ms Operating temp.: -40° to 70°C

3. Power Considerations

The SDM-CD16AC power requirements are large compared to most CSI products. For most applications an external power supply (see Figure 2) is recommended to power the SDM-CD16AC.
For some applications it may be convenient to use the datalogger supply to power the SDM-CD16AC (see Figure 2). For long-term applications, the lead acid power supply available with CSI dataloggers should be used, allowing the batteries to be float charged. It is not recommended that the datalogger alkaline supply be used to power the SDM-CD16AC for long term applications.
If the datalogger lead acid supply is used, the number of SDM-CD16AC's that can be powered is limited by the 300 mA current sourcing capability of the wall charger. With a continuous 6 mA current drain per SDM-CD16AC and 45 mA per active LED, a maximum of 6 LEDs may be powered by the datalogger, after which, more current is drawn than can be sourced by the wall charger. If this condition is maintained, it will ultimately lead to battery deep discharge, requiring new batteries.
7
2
SDM-CD16AC 16 Channel AC/DC Controller
SDM-CD16AC
SDM-CD16AC
EXTERNAL
9 TO 18 VDC
+ —
GND
12 V C1 or SDM-C1 C2 or SDM-C2 C3 or SDM-C3
Connection With External Supply
GND
12 V C1 or SDM-C1 C2 or SDM-C2 C3 or SDM-C3
Connection with Datalogger Supply
FIGURE 2. Connection Block Diagrams
DATALOGGER
DATALOGGER

4. Installation

If the 21X power supply is used to power the SDM-CD16AC, all low level analog measurements (thermocouples, pyranometers, thermopiles, etc.) must be made differentially. This is a result of slight ground potentials created along the 21X analog terminal strip when the 12 V supply is used to power peripherals. This limitation reduces the number of available analog input channels and may mandate an external supply for the SDM-CD16AC.
The SDM-CD16AC must be installed in an enclosure that provides a
pollution degree 2 environment (normally, only nonconductive pollution. However, a temporary conductivity caused by condensation may be expected). All Campbell Scientific enclosures meet this requirement.
Use copper conductors only.
Wire Range: 30 14 AWG
Tightening Torque: 5 7 in./lb.
Use minimum 60/75 degree C wire.
Input power must be connected to a class 2 supply only. All Campbell
Scientific power supplies meet the class 2 supply requirements.
3
SDM-CD16AC 16 Channel AC/DC Controller
CAUTION
Cables connecting the terminals of the datalogger and SDM device should be kept as short as possible to minimize the risk of corruption of the signals and damage from induced surges. Where long cable runs (>3 m) are unavoidable and the cables run outside, some extra protection may be required for the SDM control terminals. Please contact Campbell Scientific for further advice. When connecting wires to the SDM signal terminals please ensure they are at ground potential before making the connection, e.g. by touching them to the earth terminal.
For datalogger connections, see Table 1.
Multiple SDM-CD16AC's may be wired in parallel by connecting the datalogger side of one SDM-CD16AC to the next. The CABLE5CBL-L or an equivalent cable is used to connect the module to the datalogger. A 1-ft cable length should be sufficient when both datalogger and SDM-CD16AC are housed within an ENC12/14; a 2-ft length may be required if the datalogger and SDM-CD16AC are housed at opposite ends of an EN16/18 enclosure.
CRBasic dataloggers should use the SDMSpeed instruction if the cable length is longer than 20 feet. The maximum recommended cable length for the CR7 is 600 feet. For other Edlog dataloggers, the maximum recommended cable length is 20 feet.
NOTE
SDM cables in noisy environments need to be suitably shielded.

4.1 Wiring

4.1.1 SDM-CD16AC Power and Control Connections
Refer to Figure 2 and Table 1 for SDM-CD16AC operating power and control connections to the datalogger.
TABLE 1. Datalogger to SDM-CD16AC Connections
(see caution)
Connection Order
First 12 V 12 V on datalogger or Power external supply Second Gnd Gnd Common ground C1 SDM-C1 (CR3000,
C2 SDM-C2 (CR3000,
C3 SDM-C3 (CR3000,
SDM-CD16AC Datalogger (see note) Function
CR5000) or C1 (other dataloggers)
CR5000) or C2 (other dataloggers)
CR5000) or C3 (other dataloggers)
Data
Clock
Enable
4
SDM-CD16AC 16 Channel AC/DC Controller
CAUTION
NOTE
The order in which connections are made is critical. Always connect 12 V first, followed by ground, then Control Ports.
On a CR7, SDMs connect to the ports at the upper right corner of the 700X Control Module. On a CR9000X, SDMs connect to the ports on the CR9032 CPU Module, and on a CR9000, SDMs connect to the ports on the CR9080 PAM Module.
4.1.2 Controlled Device to SDM-CD16AC Connections
DANGER!
ELECTROCUTION HAZARD! USE EXTREME CAUTION WHEN WORKING WITH HIGH VOLTAGE INPUTS. DO NOT COME IN CONTACT WITH HOT LEADS!
Figure 3 shows how the switches in each channel operate. NO means “normally open”, NC means “normally closed”. COM means “common” to NO and NC.
Position of Contacts When Position of Contacts When Coil is Energized (ON) Coil Is Not Energized (OFF)
FIGURE 3. Switch Operation
In most applications, the SDM-CD16AC acts as a switch (controllable break) in one wire of the circuit powering the controlled device. One side of this break may have power (hot). Figure 4 shows an example.
5
SDM-CD16AC 16 Channel AC/DC Controller
4.1.3 Motor Control
The SDM-CD16AC is a UL approved Start/Stop motor controller. In the figure below, a typical 5 Amp 115 VAC relay contact circuit shows how to control a three phase motor starter in a Motor Control Center (MCC). Typically, the datalogger will automatically command the appropriate relay to energize the motor starter. The relay in the SDM-CD16AC will remain latched until the datalogger program commands that the motor be turned off, at which time the relay will open the circuit to the motor starter and the motor will stop.
Device
COM
Neutral (-) Hot (+)
FIGURE 4. Typical Wiring Application
NO
NC
The SDM-CD16AC can be used to control three phase pump motors, air blowers, and large control valves in the same fashion.
6
SDM-CD16AC 16 Channel AC/DC Controller
Datalogger
PS100 POWER SUPPLY
FIGURE 5. SDM-CD16AC Relay Outputs to MCC

5. Address Selection Switches

Each SDM-CD16AC can have 1 of 16 addresses. Shipped from the factory, the address is set at 00. The following table shows switch position and the corresponding address (see Figure 6).
Switch A 0 1 2 3
Switch B
0 00 01 02 03 1 10 11 12 13 2 20 21 22 23 3 30 31 32 33
Base 4 Address Matrix
(00, 01, 02 . . . 32, 33)
7
SDM-CD16AC 16 Channel AC/DC Controller
3
2
1
0
3
2
BA
ADDRESSES
1
0
FIGURE 6. Addressing

6. Datalogger Programming

In CRBasic, the SDMCD16AC instruction is used to control the SDM­CD16AC. Dataloggers that are programmed with CRBasic include our CR800, CR850, CR1000, CR3000, and CR5000. The SDMSpeed instruction should also be used if the cable length is longer than 20 ft.
Edlog Instruction 104 is used by the CR23, 21X, and CR10(X) to control the SDM-CD16AC, and Edlog Instruction 29 is used by the CR7. SDM-CD16AC outputs that are to be controlled by the datalogger must have the toggle switch in the AUTO position.

6.1 CRBasic Programming

6.1.1 SDMCD16AC Instruction
Syntax
SDMCD16AC (Source, Reps, SDMAddress)
Remarks
A port on an SDM-CD16AC is enabled/disabled (turned on or off) by sending a value to it using the SDMCD16AC instruction. A non-zero value will enable the port; a zero value disables it. The values to be sent to the CD16AC are held in the Source array.
8
The SDMCD16AC instruction has the following parameters:
Source: The Source parameter is an array which holds the values that will be sent to the SDM-CD16AC to enable/disable its ports. An SDM-CD16AC has 16 ports; therefore, the source array must be dimensioned to 16 times the number of Repetitions (the number of SDM-CD16AC devices to be
SDM-CD16AC 16 Channel AC/DC Controller
controlled). As an example, with the array CDCtrl(32), the value held in CDCtrl(1) will be sent to port 1, the value held in CDCtrl(2) will be sent to port 2, etc. The value held in CDCtrl(32) would be sent to port 16 on the second SDM-CD16AC.
If the Source parameter is defined as a Long variable, but it is dimensioned less than 16X Reps, Source will act as a binary control for the instruction whose bits 0…15 will specify control ports 1…16, respectively. In this situation, Source (1) will be used for the first Rep; Source (2) will be used for the second Rep, and so on.
Reps: The Reps parameter is the number of SDM-CD16AC devices that will be controlled with this instruction.
SDMAddress: The SDMAddress parameter is used to define the address of the CD16AC that will be controlled with this instruction. Valid SDM addresses are 0 through 14. Address 15 is reserved for the SDMTrigger instruction. If the Reps parameter is greater than 1, the datalogger will increment the SDM address for each subsequent device that it communicates with.
NOTE
CRBasic dataloggers use base 10 when addressing SDM devices. Edlog programmed dataloggers (e.g., CR10X, CR23X) used base 4 for addressing (see Table 2).
TABLE 2. Base 10 to Base 4 Reference Chart
Base 10 Base 4 Base 10 Base 4
0 0 8 20 1 1 9 21 2 2 10 22 3 3 11 23 4 10 12 30 5 11 13 31 6 12 14 32 7 13 15 33 (reserved)
6.1.2 SDMSpeed Instruction
The SDMSpeed instruction is used to change the bit period that the datalogger uses to clock the SDM data. Slowing down the clock rate may be necessary when long cable lengths are used to connect the datalogger and SDM devices.
The syntax of this instruction is as follows:
SDMSpeed (BitPeriod
The BitPeriod argument can be an integer or a variable. If the SDMSpeed instruction is not in the program, a default bit period is used. If 0 is used for the argument, the minimum allowable bit period is used. Table 3 shows the
)
9
SDM-CD16AC 16 Channel AC/DC Controller
default, minimum allowable, and maximum bit period for each of our CRBasic dataloggers.
TABLE 3. Bit Period Values
Datalogger
CR800, CR850 CR1000 CR3000 CR5000
Default Bit Period
Minimum Allowable Bit Period
26.04 μsec 8.68 μsec
26.04 μsec 8.68 μsec
26.04 μsec 8.68 μsec 30 μsec 8 μsec
Maximum Bit Period
2.2 msec
2.2 msec
2.2 msec 3 msec
The equation used to calculate the bit rate depends on the datalogger used. The datalogger will round down to the next faster bit rate.
Equation for CR800, CR850, and CR1000:
bit_rate=INT((k*72)/625)*Resolution
Where: k= the value entered in BitPeriod
Resolution=8.68 microseconds
Equation for CR3000:
bit_rate=INT((k*144)/625)*Resolution
Where: k= the value entered in BitPeriod Resolution= 4.34 μsec.
Equation for CR5000:
bit_rate=INT(k*20)*Resolution
Where: k= the value entered in BitPeriod Resolution=50 nsec.
10

6.2 Edlog Programming

Instruction 104SDM-CD16AC use with CR23X, CR10(X), and 21X
Param. Type Description
1 2 Reps (# of modules sequentially addressed) 2 2 Starting Address (base 4: 00..33) 3 4 Starting Input Location
Execution Time = 2 ms per Rep for the CR10X, 3.5 ms per Rep for the 21X
Param Type Description
1 2 Reps (# of modules sequentially addressed) 2 2 Device (2 = SDM-CD16AC) 3 2 Starting Address (base 4: 00..33) 4 2 Card (Excitation card #) 5 4 Starting Input Location
Execution Time = 150 to 190 ms per Rep
The number of SDM-CD16ACs to be addressed is defined by the Reps (repetitions) parameter. Each Rep will sequentially address (00, 01, 02,...32,
33) SDM-CD16ACs starting with the address specified in parameter 2 (Instruction 29 parameter 3).
SDM-CD16AC 16 Channel AC/DC Controller
Instruction 29 - SDM-CD16AC use with CR7
For each Rep, the 16 ports of the addressed SDM-CD16AC are set according to 16 sequential Input Locations starting at the Input Location specified in parameter 3 (Instruction 29 parameter 5). Any non-zero value stored in an input location activates the associated SDM-CD16AC port. A value of zero (0) deactivates the port For example, assuming 2 Reps and a starting Input Location of 33, OUTPUT 1 through 16 of the first SDM-CD16AC are set according to Input Locations 33 through 48, and OUTPUT 1 through 16 of the second SDM-CD16AC are set according to Input Locations 49 through 64.
For Instruction 29, the Device (parameter 2) specifies what type of synchronously addressed peripheral is to be addressed. The Device code for an SDM-CD16AC is 2.
For Instruction 29 only (CR7), the Card parameter 4 specifies which 725 Excitation Card is being used for the Control Port signals. The Reps parameter does not advance beyond the specified Card, requiring another Instruction 29 for each 725 Excitation Card used.

7. Theory of Operation

The SDM-CD16AC is a synchronously addressed peripheral. C2 and C3, driven high by the datalogger, initiate a cycle. While holding C3 high, the datalogger drives C2 as a clock line and C1 as a serial data line. The datalogger shifts out a data bit on C1 (LSB first) on the falling edge of the C2 clock. The SDM-CD16AC shifts in the C1 data bit on the rising edge of the C2 clock.
11
SDM-CD16AC 16 Channel AC/DC Controller
The first 8 bits clocked out represent the SDM-CD16AC address. If the address matches the SDM-CD16AC's address, the SDM-CD16AC is enabled. If enabled, the next 16 bits are shifted into the SDM-CD16AC, each bit controlling one port, the first of which controls OUTPUT1.
When the 16 control bits are clocked in, C2 is held high while C3 is pulsed low then high to latch the control bits. The datalogger then lowers both C3 and C2 to complete the cycle.

8. Program Examples

8.1 CRBasic Example

8.1.1 Controlling Two SDM-CD16ACs
In the following CR1000 program example, a counter is used to fill an array called Src( ) that will control two SDM-CD16ACs.
'Dimension Variables
Public src(32) Dim i, count, mask(16)
'Program
BeginProg for i=1 to 16 mask(i) = 2^(i-1) next i Scan(20,msec,2,0) count = count + 1 for i=1 to 32 src(i) = count AND mask(((i-1) MOD 16) +1) next i SDMCD16AC(src(),2,1) NextScan EndProg
12
8.1.2 Control Temperature and Fans
In this example, the SDM-CD16AC is used to control the temperature between 23° and 28°C in each of 5 greenhouses. In each greenhouse 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.
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 ‘Cooli ng, 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
SDM-CD16AC 16 Channel AC/DC Controller
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
The Example 2 program uses an integer instead of an array to set the SDM­CD16AC control outputs:
'Program name: SDMCD16Example2.CR1 'Date written: 6/25/2007 '\\\\\\\\\\\\\\\\\\\\\\\\\ DECLARATIONS /////////////////////////
Public Temp(5) Public TimedFanOn as Boolean Dim I as Long Dim CD16_Output as Long
'Note: 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
'\\\\\\\\\\\\\\\\\\\\\\\\\\\ PROGRAM ////////////////////////////
BeginProg Scan(5,Sec, 3, 0) For I = 1 to 5 If (Temp(I) < 23.5) Then 'Set appropriate Heater Bit High: CD16_Output = CD16_Output OR 2^(I-1) ElseIf (Temp(I) >= 25.5) Then 'Set appropriate Heater Bit Low: CD16_Output = CD16_Output AND (&H7FFF - 2^(I-1)) EndIf If (Temp(I) >= 27.5) Then 'Set appropriate Cooler Bit High: CD16_Output = CD16_Output OR 2^(I+4)
14
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
SDM-CD16AC 16 Channel AC/DC Controller
Input Location assignments are as follows:
Input Location
Location Label
Description
1..5 Temp #1..#5 Avg temp, greenhouse 1..5
10..14 Heat #1..#5 Heater control, greenhouse 1..5 SDM-CD16AC Port 1..5
15..19 Cool #1..#5 Cooler control, greenhouse 1..5 SDM-CD16AC Port 6..10
20..24 Fan #1..#5 Fan control, greenhouse 1..5 SDM-CD16AC Port 11..15
1: Beginning of Loop (P87) Master Loop, End 1: 0 Delay Loop at Step 30 2: 5 Loop Count
START HEATER CONTROL LOGIC
2: If X<=>F (P89) If "Heater On" 1: 1-- X Loc threshold is 2: 4 < exceeded 3: 23.5 F 4: 30 Then Do Then
3: Z=F (P30) Put a "1" into Heater 1: 1 F Control Location 2: 0 Exponent of 10 3: 10-- Z Loc :
4: End (P95) End Then Do/End
5: If X<=>F (P89) If Heater 1: 10-- X Loc #1 on (Heater Control 2: 2 <> Location <> 0) 3: 0 F 4: 30 Then Do Then
6: If X<=>F (P89) 1: 1-- X Loc Temp #1 Check Upper Threshold 2: 3 >= to see if heater should 3: 25.5 F be turned off 4: 30 Then Do
7: Z=F (P30) If heater should be turned 1: 0 F off, enter a "0" into 2: 0 Exponent of 10 heater control location 3: 10-- Z Loc :
8: End (P95) Else Then Do/End
16
SDM-CD16AC 16 Channel AC/DC Controller
9: Else (P94) Else, If the heater is off,
10: Z=F (P30) 1: 0 F Enter a "0" into heater 2: 0 Exponent of 10 control location 3: 10-- Z Loc :
11: End (P95) End Then Do/Else/End
END HEATER CONTROL LOGIC
START COOLER CONTROL LOGIC
12: If X<=>F (P89) If "Cooler" on 1: 1-- X Loc threshold is 2: 3 >= exceeded 3: 27.5 F 4: 30 Then Do Then
13: Z=F (P30) Put a "1" into cooler 1: 1 F Control Location 2: 0 Exponent of 10 3: 15-- Z Loc :
14: End (P95) End Then Do/End
15: If X<=>F (P89) If cooler is on 1: 15-- X Loc (Cooler control 2: 2 <> Location <>0) 3: 0 F 4: 30 Then Do Then
16: If X<=>F (P89) Check lower threshold to 1: 1-- X Loc see if cooler should be 2: 4 < turned off 3: 24.5 F 4: 30 Then Do
17: Z=F (P30) If cooler should be turned 1: 0 F off, put a "0" into cooler 2: 0 Exponent of 10 control location 3: 15-- Z Loc :
18: End (P95) End Then Do/End
19: Else (P94) Else if cooler is off
20: Z=F (P30) 1: 0 F Put a "0" into cooler 2: 0 Exponent of 10 control location 0: 15-- Z Loc :
17
SDM-CD16AC 16 Channel AC/DC Controller
21: End (P95) End Then Do/Else/End
END COOLER CONTROL LOGIC
START FAN CONTROL LOGIC BASED ON HEATER/COOLER
22: If X<=>F (P89) If heater is on 1: 10-- X Loc 2: 2 <> 3: 0 F 4: 11 Set high Flag 1 Set flag 1
23: If X<=>F (P89) If cooler is on 1: 15-- X Loc 2: 2 <> 3: 0 F 4: 11 Set high Flag 1 Set flag 1
24: If Flag/Port (P91) If flag 1 is set 1: 11 Do if flag 1 is high 2: 30 Then Do Then
25: Z=F (P30) Put a "1" into fan 1: 1 F control location 2: 0 Exponent of 10 3: 20-- Z Loc:
26: Else (P94) Else, If flag 1 is reset
27: Z=F (P30) Put a "0" into fan 1: 0 F control location 2: 0 Exponent of 10 3: 20-- Z Loc :
28: End (P95) End Then Do/Else/End
29: Do (P86) Reset flag 1 1: 21 Set low Flag 1
30: End Loop (P95) End Master Loop
END FAN CONTROL LOGIC BASED ON HEATER/COOLER
START FAN CONTROL LOGIC BASED ON TIME
31: If time is (P92) If 5 minutes remain 1: 10 minutes into a out of 15 minute 2: 15 minute interval interval, 3: 12 Set high Flag 2 set flag 2
18
SDM-CD16AC 16 Channel AC/DC Controller
32: If Flag/Port (P91) If flag 2 is set 1: 12 Do if flag 2 is high 2: 30 Then Do Then
33: Beginning of Loop (P87) Start fan loop 1: 0 Delay 2: 5 Loop Count
34: Z=F (P30) PUT A "1" INTO FAN 1: 1 F CONTROL LOCATION 2: 0 Exponent of 10 3: 20-- Z Loc :
35: End (P95) End fan loop
36: End (P95) End then do
37: If time is (P92) 1: 0 minutes into a Reset flag 2 at the 2: 15 minute interval end of the 15 minute 3: 22 Set low Flag 2
END FAN CONTROL LOGIC BASED ON TIME
INPUT LOCATIONS 10 THROUGH 24 ARE NOW LOADED WITH "1" OR "0" TO SET PORTS ON THE SDM-CD16AC.
38: SDM-CD16AC (P104) Send instructions to the 1: 1 Reps SDM-CD16AC with address 00 2: 00 Address 3: 10 Loc
39: End Table 1 (P)
19
SDM-CD16AC 16 Channel AC/DC Controller
20
This is a blank page.
Campbell Scientific Companies
Campbell Scientific, Inc. (CSI)
815 West 1800 North
Logan, Utah 84321
UNITED STATES
www.campbellsci.com
info@campbellsci.com
Campbell Scientific Africa Pty. Ltd. (CSAf)
PO Box 2450
Somerset West 7129
SOUTH AFRICA
www.csafrica.co.za
cleroux@csafrica.co.za
Campbell Scientific Australi
PO Box 444
Thuringowa Central QLD 4812 AUSTRALIA www.campbellsci.com.au
info@campbellsci.com.au
Campbell Scientific do Brazil Ltda. (CSB)
Rua Luisa Crapsi Orsi, 15 Butantã
CEP: 005543-000 São Paulo SP BRAZIL
www.campbellsci.com.br
suporte@campbellsci.com.br
Campbell Scientific Canada Corp. (CSC)
11564 - 149th Street NW
Edmonton, Alberta T5M 1W7
CANADA
www.campbellsci.ca
dataloggers@campbellsci.ca
Campbell Scientific Ltd. (CSL)
Campbell Park
80 Hathern Road
Shepshed, Loughborough LE12 9GX
UNITED KINGDOM
www.campbellsci.co.uk
sales@campbellsci.co.uk
Campbell Scientific Ltd. (France)
Miniparc du Verger - Bat. H
1, rue de Terre Neuve - Les Ulis
91967 COURTABOEUF CEDEX
FRANCE
www.campbellsci.fr
info@campbellsci.fr
Campbell Scientific Spain, S. L.
Psg. Font 14, local 8
08013 Barcelona
SPAIN
www.campbellsci.es
info@campbellsci.es
Please visit www.campbellsci.com to obtain contact information for your local US or International representative.
a Pty. Ltd. (CSA)
Loading...