Queries the state of the interrupt sources immediately. It does not block.
Namespace:
Quanser.Hardware
Assembly:
Quanser.Hardware.Hil (in Quanser.Hardware.Hil.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Function PollInterrupt ( _
channels As Integer(), _
states As SByte() _
) As Integer |
C# |
---|
public int PollInterrupt(
int[] channels,
sbyte[] states
) |
Visual C++ |
---|
public:
int PollInterrupt(
array<int>^ channels,
array<signed char>^ states
) |
JavaScript |
---|
function pollInterrupt(channels, states); |
Parameters
- channels
- Type: array<
System..::.Int32
>[]()[]
An array containing the numbers of the interrupt sources to be polled.
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:
.
- states
- Type: array<
System..::.SByte
>[]()[]
An array for receiving the states of the interrupt sources. Each element in
the states array corresponds to the same element in the channels array.
Hence, there must be as many elements in the states array as there are channels. An
element will be true if an interrupt has occurred and false otherwise.
The PollInterrupt method acknowledges any interrupts that have occurred. Hence, a second call
to PollInterrupt immediately after the first call will show that no interrupts have occurred
unless one happens to occur in the brief interval between the two invocations.
Return Value
The number of interrupts that occurred since the last time this method was called. May be zero.
Remarks
Examples
This example illustrates how to poll interrupt sources. It queries interrupt sources 0-3.
Exceptions are ignored for simplicity.
C# | Copy Code |
---|
int [] channels = { 0, 1, 2, 3 };
sbyte [] buffer = new sbyte [channels.Length];
card.PollInterrupt(channels, buffer);
|
Visual Basic | Copy Code |
---|
Dim channels() As Integer = {0, 1, 2, 3}
Dim buffer(channels.Length - 1) As SByte
card.PollInterrupt(channels, buffer)
|
Visual C++ | Copy Code |
---|
array<int>^ channels = { 0, 1, 2, 3 };
array<char>^ buffer = gcnew array<char>(channels->Length);
card->PollInterrupt(channels, buffer);
|
Exceptions
Exception | Condition |
---|
Quanser.Hardware..::.HilException |
If the poll cannot be performed then an exception is thrown. This situtation
typically arises if the board does not support interrupt sources or the hardware
resources required are in use by a monitor.
|
See Also