Programming, 1 crbasic – Campbell Scientific SDM-AO4 4-Channel Continuous Analog Output Module User Manual
Page 10

SDM-AO4 Four Channel Analog Output
6. Programming
This section is for users who write their own datalogger
programs. A datalogger program can be generated using
Campbell Scientific’s SCWIN Short Cut Program Generator.
You do not need to read this section to use Short Cut.
NOTE
The datalogger is programmed using either CRBasic or Edlog. Dataloggers
that use CRBasic include our CR800, CR850, CR1000, CR3000, and CR5000.
Dataloggers that use Edlog include our CR7, CR10X, CR10, CR23X, and
21X. Both CRBasic and Edlog are included in PC400 and LoggerNet
datalogger support software.
In both CRBasic and Edlog, the datalogger programming instruction allows the
user to set four separate voltage levels in one SDM-AO4, or move voltage
levels with multiple SDM-AO4s. Voltage levels are reset each time the
instruction is executed. The voltage range is ±5 Volts; voltage levels sent to
the SDM-AO4 which are out of the range limits will appear as either + 5 Volts
or - 5 Volts depending on whether it is overranged or underranged.
6.1 CRBasic
6.1.1 SDMAO4 Instruction
The SDMAO4 instruction is used to set the voltage to an SDM-AO4 four
channel analog output device.
The SDMAO4 instruction was at one time named the AO4
instruction. Please change your program accordingly.
NOTE
The SDMAO4 instruction has the following syntax:
SDMAO4(
Source
,
Reps
,
SDMAddress
)
Description of the parameters follows:
Source: The Source parameter is the variable or variable array that holds the
voltage(s), in millivolts, that will be sent to the SDM-AO4(s). If multiple
SDM-AO4s are to be triggered with one instruction, this parameter must be
dimensioned to the total number of channels for all the devices being set (e.g.,
if all four channels are being set on two SDM-AO4 devices, Source must be
dimensioned to eight).
Reps: The Reps parameter determines the number of SDM-AO4 output
channels that will be set. If this parameter is greater than four (i.e., voltage is
being set for more than one SDM-AO4 device), voltage is set on the next
consecutively addressed SDM-AO4 device. In this case, the SDM-AO4s must
have sequential SDM addresses.
6