Closes an HIL board.

Namespace:  Quanser.Hardware
Assembly:  Quanser.Hardware.Hil (in Quanser.Hardware.Hil.dll)

Syntax

Visual Basic (Declaration)
Public Sub Close
C#
public void Close()
Visual C++
public:
void Close()
JavaScript
function close();

Remarks

The Close method closes the HIL board, stopping any running tasks associated with the board and releasing any allocated resources. Once the board has been closed, the Hil object is no longer valid and may not be used until it has been opened again using one of the Open methods. Note that while Close does delete any tasks associated with the board, it is better not to rely on this behavior. Use the Stop()()() method instead to properly shut down tasks.

Examples

This sample illustrates how to use the Close()()() method.
C# Copy Code
try {
    Hil card = new Hil("q8"); /* open first Q8 card in system */
    try {
        /* ... use card ... */

    } catch (Exception ex) {
        Console.WriteLine("Exception occurred accessing card. " + ex);
    }
    card.Close();
} catch (Exception ex) {
    Console.WriteLine("Exception occurred opening card. " + ex);
}
Visual Basic Copy Code
Try
    Dim card As New Hil("q8") ' open first Q8 card in system
    Try
        ' ... use card ...

    Catch ex As Exception
        Console.WriteLine("Exception occurred accessing card. " & ex.ToString())
    End Try
    card.Close()
Catch ex As Exception
    Console.WriteLine("Exception occurred opening card. " & ex.ToString())
End Try
Visual C++ Copy Code
try {
    Hil^ card = gcnew Hil(L"q8"); /* open first Q8 card in system */
    try {
        /* ... use card ... */

    } catch (Exception^ ex) {
        Console.WriteLine(L"Exception occurred accessing card. " + ex);
    }
    card->Close();
} catch (Exception^ ex) {
    Console.WriteLine(L"Exception occurred opening card. " + ex);
}

See Also