Analog Outputs
Channel Selection
(c) Spectrum GmbH
39
Analog Outputs
Channel Selection
One key setting that influences all other possible settings is the channel enable register. An unique feature of the Spectrum boards is the
possibility to program the number of channels you want to use. All on-board memory can then be used by these activated channels.
This description shows you the channel enable register for the complete board family. However your specific board may have less channels
depending on the board type you purchased and did not allow you to set the maximum number of channels shown here.
The channel enable register is set as a bitmap. That means one bit of the value corresponds to one channel to be activated. To activate more
than one channel the values have to be combined by a bitwise OR.
Example showing how to activate 4 channels:
The following table shows all allowed settings for the channel enable register.
Any channel activation mask that is not shown here is not valid. If programming another channel activation
mask the driver automatically remaps this to the best matching activation mask. You can read out the chan-
nel enable register to see what channel activation mask the driver has set.
Reading out the channel enable register can be done directly after setting it or later like this:
Important note on channels selection
As some of the manuals passages are used in more than one hardware manual most of the registers and
channel settings throughout this handbook are described for the maximum number of possible channels that
are available on one card of the actual series. There can be less channels on your actual type of board or
bus-system. Please refer to the table(s) above to get the actual number of available channels.
Disabling the outputs
In contrast to simply not using one or more channels by setting the channel enable registers accordingsly, the outputs can also be set to a
zero voltage output. Because of the internal structure the outputs can only be disabled per module by the registers shown in the table below.
Register
Value
Direction
Description
SPC_CHENABLE
11000
read/write
Sets the channel enable information for the next board run.
CHANNEL0
1
Activates channel 0
CHANNEL1
2
Activates channel 1
CHANNEL2
4
Activates channel 2
CHANNEL3
8
Activates channel 3
SpcSetParam (hDrv, SPC_CHENABLE, CHANNEL0 | CHANNEL1 | CHANNEL2 | CHANNEL3);
Channels to activate
Ch0
Ch1
Ch2
Ch3
Values to program
Value as hex
Value as decimal
X
CHANNEL0
1h
1
X
X
CHANNEL0 | CHANNEL1
3h
3
X
X
CHANNEL0 | CHANNEL2
5h
5
X
X
X
X
CHANNEL0 | CHANNEL1 | CHANNEL2 | CHANNEL3
Fh
15
SpcGetParam (hDrv, SPC_CHENABLE, &lActivatedChannels);
printf ("Activated channels bitmask is: %x\n", lActivatedChannels);
Register
Value
Direction
Description
SPC_DISABLEMOD0
203000
r/w
Disables the outputs of module 0 (channel 0 and channel 1). Outputs will go to zero voltage.
SPC_DISABLEMOD1
203010
r/w
Disables the outputs of module 1 (channel 2 and channel 3). Outputs will go to zero voltage.