Analog inputs, Channel selection, Important note on channels selection – Spectrum Brands MI.20xx User Manual
Page 41
![background image](/manuals/154775/41/background.png)
Analog Inputs
Channel Selection
(c) Spectrum GmbH
41
Analog Inputs
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
the driver automatically remaps this to the best matching activation mask. You can read out the channel en-
able register to see what channel activation mask the driver has set.
Reading out the channel enable register can be done directely 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 board of the actual series. There can be less channels on your actual type of board or
bus-system. Please refer to the table above to get the actual number of available channels.
Register
Value
Direction
Description
SPC_CHENABLE
11000
r/w
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 are: %ld \n", lActivatedChannels);