Sets the quadrature mode of the encoder inputs on the card.
Namespace:
Quanser.Hardware
Assembly:
Quanser.Hardware.Hil (in Quanser.Hardware.Hil.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Sub SetEncoderQuadrature ( _
channels As Integer(), _
mode As Hil..::.Quadrature() _
) |
Visual C++ |
---|
public:
void SetEncoderQuadrature(
array<int>^ channels,
array<Hil..::.Quadrature>^ mode
) |
JavaScript |
---|
function setEncoderQuadrature(channels, mode); |
Parameters
- channels
- Type: array<
System..::.Int32
>[]()[]
An array containing the numbers of the encoder channels whose quadrature modes will be set.
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:
.
- mode
- Type: array<
Quanser.Hardware..::.Hil..::.Quadrature
>[]()[]
An array of quadrature modes containing the new encoder quadrature mode for each channel. Each element in
the mode array corresponds to the same element in the channels array.
Hence, there must be as many elements in the mode array as there are channels.
Remarks
Examples
This sample illustrates how to use the
SetEncoderQuadrature(array<Int32>[]()[], array<Hil..::.Quadrature>[]()[]) method.
It sets the quadrature mode of channels 0 and 2 to 4X quadrature and
set channel 1 to non-quadrature mode.
C# | Copy Code |
---|
int [] channels = { 0, 1, 2 };
Hil.Quadrature [] modes = { Hil.Quadrature.X4, Hil.Quadrature.None, Hil.Quadrature.X4 };
board.SetEncoderQuadrature(channels, modes);
|
Visual Basic | Copy Code |
---|
Dim channels() As Integer = {0, 1, 2}
Dim modes() As Hil.Quadrature = {Hil.Quadrature.X4, Hil.Quadrature.None, Hil.Quadrature.X4}
board.SetEncoderQuadrature(channels, modes)
|
Visual C++ | Copy Code |
---|
array<int>^ channels = { 0, 1, 2 };
array<Hil::Quadrature>^ modes = { Hil::Quadrature::X4, Hil::Quadrature::None, Hil::Quadrature::X4 };
board->SetEncoderQuadrature(channels, modes);
|
Exceptions
Exception | Condition |
---|
Quanser.Hardware..::.HilException |
If the encoder quadrature modes cannot be set then an exception is thrown. This situtation
typically arises when the card does not support one of the quadrature modes specified.
|
See Also