Assembly: Quanser.Hardware.Hil (in Quanser.Hardware.Hil.dll)
 Syntax
Syntax
| Visual Basic (Declaration) | 
|---|
| Function ReadInterrupt ( _ interruptBuffer As SByte() _ ) As Integer | 
| C# | 
|---|
| int ReadInterrupt( sbyte[] interruptBuffer ) | 
| Visual C++ | 
|---|
| int ReadInterrupt( array<signed char>^ interruptBuffer ) | 
| JavaScript | 
|---|
| function readInterrupt(interruptBuffer); | 
Parameters
- interruptBuffer
- Type: array<
            System..::.SByte
          >[]()[]
 An array for receiving the states of the interrupt sources. The array must contain numChannels elements, where numChannels is the number of channels specified when the monitor was created. The array is organized as a linear array, with each element corresponding to an interrupt source. For example, if interrupt sources 0, 1 and 3 are being monitored, than the buffer will contain a 0 or 1 in element 0 depending on whether interrupt source 0 occurred. Likewise, element 1 will correspond to interrupt source 1, and element 2 to interrupt source 3. 
Return Value
The return value is the number of interrupts being monitored that actually occurred. This value may be less than the number of interrupt sources if only some of the interrupts have occurred. The return value is only zero if the monitor was stopped. Remarks
Remarks
The ReadInterrupt method queries the state of the interrupt sources being monitored. The interrupt sources are selected when the monitor is created using the MonitorCreateInterruptReader(array<Int32>[]()[]) method. This blocking operation can be unblocked by calling the Stop()()() method from another thread.
Because this method blocks until at least one of the selected interrupts occurs, calling this method synchronizes the caller to the interrupt. Thus, the ReadInterrupt method may be used to implement asynchronous event handling.
 Examples
Examples
| C# |  Copy Code | 
|---|---|
| 
int [] channels = { 0, 1, 2, 3 };
sbyte [] buffer = new sbyte [channels.Length];
Hil.Monitor monitor;
monitor = card.MonitorCreateInterruptReader(channels);
monitor.Start();
monitor.ReadInterrupt(buffer);
monitor.Stop();
 | |
| Visual Basic |  Copy Code | 
|---|---|
| 
Dim channels() As Integer = {0, 1, 2, 3}
Dim buffer(channels.Length - 1) As SByte
Dim monitor As Hil.Monitor
monitor = card.MonitorCreateInterruptReader(channels)
monitor.Start()
monitor.ReadInterrupt(buffer)
monitor.Stop()
 | |
| Visual C++ |  Copy Code | 
|---|---|
| 
array<int>^ channels = { 0, 1, 2, 3 };
array<char>^ buffer = gcnew array<char>(channels->Length);
Hil::Monitor^ monitor;
monitor = card->MonitorCreateInterruptReader(channels);
monitor->Start();
monitor->ReadInterrupt(buffer);
monitor->Stop();
 | |
 Exceptions
Exceptions
| Exception | Condition | 
|---|---|
| Quanser.Hardware..::.HilException | If the read cannot be performed then an exception is thrown. | 
 
     
     
     
    