6.1 CRBasic programming
6.1.1
SDMCD16AC()
instruction
Syntax
SDMCD16AC
(Source, Reps, SDMAddress)
Remarks
A port on an SDM-CD16ACA 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.
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-CD16ACA to enable/disable its ports. An SDM-CD16ACA has 16 ports; therefore, the source
array must be dimensioned to 16 times the number of repetitions (the number of SDM-CD16ACA
devices to be 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-CD16ACA.
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-CD16ACA 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 data logger will
increment the SDM address for each subsequent device that it communicates with.
6.1.2
SDMSpeed()
instruction
The
SDMSpeed()
instruction is used to change the speed at which data is clocked to and from
attached SDM devices. Slowing down the clock rate may be necessary when many SDM devices
are connected to the data logger, or even when a single SDM device is connected over a long
cable.
SDM-CD16ACA 16 Channel AC/DC Controller
9