Sets the configurations of the analog inputs.
Namespace:
Quanser.Hardware
Assembly:
Quanser.Hardware.Hil (in Quanser.Hardware.Hil.dll)
Syntax
JavaScript |
---|
function setAnalogInputConfiguration(channels, configurations); |
Parameters
- channels
- Type: array<
System..::.Int32
>[]()[]
An array containing the numbers of the analog input channels whose configurations will be changed.
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:
.
- configurations
- Type: array<
Quanser.Hardware..::.Hil..::.AnalogInputConfiguration
>[]()[]
An array of input configurations containing the new configuration for each channel.
Each element in the configurations array corresponds to the same
element in the channels array.
Hence, there must be as many elements in the configurations array
as there are channels.
Refer to the Hil..::.AnalogInputConfiguration enumeration for a list of valid
configurations.
Remarks
Examples
This sample illustrates how to use the
SetAnalogInputConfiguration(array<Int32>[]()[], array<Hil..::.AnalogInputConfiguration>[]()[]) method.
It sets the configuration of analog input 0 to referenced single-ended,
the configuration of analog input 3 to referenced single-ended,
and the configuration of input 5 to differential.
C# | Copy Code |
---|
int [] channels = { 0, 3, 5 };
Hil.AnalogInputConfiguration [] configs = { Hil.AnalogInputConfiguration.RSE, Hil.AnalogInputConfiguration.RSE, Hil.AnalogInputConfiguration.DIFF };
board.SetAnalogInputConfiguration(channels, configs);
|
Visual Basic | Copy Code |
---|
Dim channels() As Integer = {0, 3, 5}
Dim configs() As Hil.AnalogInputConfiguration = { Hil.AnalogInputConfiguration.RSE, Hil.AnalogInputConfiguration.RSE, Hil.AnalogInputConfiguration.DIFF }
board.SetAnalogInputConfiguration(channels, configs);
|
Visual C++ | Copy Code |
---|
array<int>^ channels = { 0, 3, 5 };
array<Hil::AnalogInputConfiguration>^ configs = { Hil::AnalogInputConfiguration::RSE, Hil::AnalogInputConfiguration::RSE, Hil::AnalogInputConfiguration::DIFF };
board->SetAnalogInputConfiguration(channels, configs);
|
Exceptions
Exception | Condition |
---|
Quanser.Hardware..::.HilException |
If the input configurations cannot be configured then an exception is thrown. This situtation
typically arises if the card does not support programmable analog input ranges.
|
See Also