Input offset – Spectrum Brands MI.20xx User Manual

Page 43

Advertising
background image

Analog Inputs

Setting up the inputs

(c) Spectrum GmbH

43

Input offset

In most cases the external signals will not be symmetrically re-
lated to ground. If you want to acquire such asymmetrical sig-
nals, it is possible to use the smallest input range that matches
the biggest absolute signal amplitude without exceeding the
range.

The figure at the right shows this possibility. But in this exam-
ple you would leave half of the possible resolution unused.

It is much more efficient if you shift the signal on-board to be
as symmetrical as possible and to acquire it within the best
possible range.

This results in a much better use of the converters resolution.

On all acquisition boards from Spectrum you have the possi-
bility to adjust the input offset separately for each channel.

The example in the right figure shows signals with a
range of ±1.0 V that have offsets up to ±1.0 V. So relat-
ed to the desired input range these signals have offsets
of ±100 %.

For compensating such offsets you can use the offset reg-
ister for each channel separately. If you want to compen-
sate the +100 % offset of the outer left signal, you would
have to set the offset to -100 % to compensate it.

As the offset levels are relatively to the related input
range, you have to calculate and set your offset again
when changing the input’s range.

The table below shows the offset registers and the possi-
ble offset ranges for your specific type of board

When writing a program that should run with different board families it is useful to just read-out the possible offset than can be programmed.
You can use the following read only register. It will give you the maximum relative offset in percentage as an interger value.

To give you an example how the registers of the input range and the input offset are to be used, the following example shows a setup to
match all of the four signals in the second input offset figure to match the desired input range. Therefore every one of the four channels is set
to the input range of ± 1.0 V. After that the four offset settings are set exactely as the offsets to be compensated, but with the the opposite
sign. The result is, that all four channels match perfectely to the choosen input range.

Register

Value

Direction

Description

Offset range

SPC_OFFS0

30000

r/w

Defines the input’s offset and therfore shifts the input of channel0.

± 400 % in steps of 1 %

SPC_OFFS1

30100

r/w

Defines the input’s offset and therfore shifts the input of channel1.

± 400 % in steps of 1 %

SPC_OFFS2

30200

r/w

Defines the input’s offset and therfore shifts the input of channel2.

± 400 % in steps of 1 %

SPC_OFFS3

30300

r/w

Defines the input’s offset and therfore shifts the input of channel3.

± 400 % in steps of 1 %

Register

Value

Direction

Description

SPC_READMAXOFFSET

3100

r

Reads out the maximum offset that can be used to compensate an signal offset.

SpcSetParam (hDrv, SPC_AMP0 , 1000); // Set up channel0 to the range of ± 1.0 V
SpcSetParam (hDrv, SPC_AMP1 , 1000); // Set up channel1 to the range of ± 1.0 V
SpcSetParam (hDrv, SPC_AMP2 , 1000); // Set up channel2 to the range of ± 1.0 V
SpcSetParam (hDrv, SPC_AMP3 , 1000); // Set up channel3 to the range of ± 1.0 V

SpcSetParam (hDrv, SPC_OFFS0, -100); // Set the input offset to get the signal symmetrically to 0.0 V
SpcSetParam (hDrv, SPC_OFFS1, -50);
SpcSetParam (hDrv, SPC_OFFS2, 50);
SpcSetParam (hDrv, SPC_OFFS3, 100);

Advertising