Sets the ranges of the analog inputs.
Namespace:
Quanser.Hardware
Assembly:
Quanser.Hardware.Hil (in Quanser.Hardware.Hil.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Sub SetAnalogInputRanges ( _
channels As Integer(), _
minimums As Double(), _
maximums As Double() _
) |
C# |
---|
public void SetAnalogInputRanges(
int[] channels,
double[] minimums,
double[] maximums
) |
Visual C++ |
---|
public:
void SetAnalogInputRanges(
array<int>^ channels,
array<double>^ minimums,
array<double>^ maximums
) |
JavaScript |
---|
function setAnalogInputRanges(channels, minimums, maximums); |
Parameters
- channels
- Type: array<
System..::.Int32
>[]()[]
An array containing the numbers of the analog input channels whose ranges will be configured.
Channel numbers are zero-based. Thus, channel 0 is the first channel, channel 1 the second channel, etc.
Select a board type from the list for board-specific details:
.
- minimums
- Type: array<
System..::.Double
>[]()[]
An array of doubles containing the minimum value of the input
range for the corresponding channel in the channels array. This
array must be the same size as the channels array.
- maximums
- Type: array<
System..::.Double
>[]()[]
An array of doubles containing the maximum value of the input
range for the corresponding channel in the channels array. This
array must be the same size as the channels array.
Remarks
Examples
This sample illustrates how to use the
SetAnalogInputRanges(array<Int32>[]()[], array<Double>[]()[], array<Double>[]()[]) method.
It sets the range of analog input 0 to ±10V, the range of analog input 3 to 0..5V
and the range of input 5 to ±5V.
C# | Copy Code |
---|
int [] channels = { 0, 3, 5 };
double [] minimums = { -10, 0, -5 };
double [] maximums = { +10, 5, +5 };
board.SetAnalogInputRanges(channels, minimums, maximums);
|
Visual Basic | Copy Code |
---|
Dim channels() As Integer = {0, 3, 5}
Dim minimums() As Double = {-10, 0, -5}
Dim maximums() As Double = {+10, 5, +5}
board.SetAnalogInputRanges(channels, minimums, maximums)
|
Visual C++ | Copy Code |
---|
array<int>^ channels = { 0, 3, 5 };
array<double>^ minimums = { -10, 0, -5 };
array<double>^ maximums = { +10, 5, +5 };
board->SetAnalogInputRanges(channels, minimums, maximums);
|
Exceptions
Exception | Condition |
---|
Quanser.Hardware..::.HilException |
If the input ranges cannot be configured then an exception is thrown. This situtation
typically arises if the card does not support programmable analog input ranges.
|
See Also