Sets the filter frequency 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 SetEncoderFilterFrequency ( _
channels As Integer(), _
frequency As Double() _
) |
C# |
---|
public void SetEncoderFilterFrequency(
int[] channels,
double[] frequency
) |
Visual C++ |
---|
public:
void SetEncoderFilterFrequency(
array<int>^ channels,
array<double>^ frequency
) |
JavaScript |
---|
function setEncoderFilterFrequency(channels, frequency); |
Parameters
- channels
- Type: array<
System..::.Int32
>[]()[]
An array containing the numbers of the encoder channels whose filter frequencies 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:
.
- frequency
- Type: array<
System..::.Double
>[]()[]
An array of doubles containing the new encoder
filter frequency for each channel in Hertz. Each element in
the frequency array corresponds to the same
element in the channels array.
Hence, there must be as many elements in the frequency
array as there are channels.
Remarks
Examples
This sample illustrates how to use the
SetEncoderFilterFrequency(array<Int32>[]()[], array<Double>[]()[]) method.
It sets the filter frequencies of channels 0 and 4 to 8.33 MHz and
sets channel 2 to 4.17 MHz. An expression is used for these filter frequencies
that yields the exact frequencies that may be used by the Quanser Q8 card. See the documentation
for the data acquisition card used for details.
C# | Copy Code |
---|
int [] channels = { 0, 2, 4 };
double [] frequencies = { 1 /(120e-9 * 1), 1 /(120e-9 * 2), 1 /(120e-9 * 1) };
board.SetEncoderFilterFrequency(channels, frequencies);
|
Visual Basic | Copy Code |
---|
Dim channels() As Integer = {0, 2, 4}
Dim frequencies() As Double = {1 / (0.00000012 * 1), 1 / (0.00000012 * 2), 1 / (0.00000012 * 1)}
board.SetEncoderFilterFrequency(channels, frequencies)
|
Visual C++ | Copy Code |
---|
array<int>^ channels = { 0, 2, 4 };
array<double>^ frequencies = { 1 /(120e-9 * 1), 1 /(120e-9 * 2), 1 /(120e-9 * 1) };
board->SetEncoderFilterFrequency(channels, frequencies);
|
Exceptions
Exception | Condition |
---|
Quanser.Hardware..::.HilException |
If the encoder filter frequencies cannot be set then an exception is thrown. This situtation
typically arises when given filter frequencies are out of range or the card does not support
programmable filter frequencies for its encoders.
|
See Also