hil_close hil_set_analog_input_configuration navigation bar

Table of Contents

hil_close_all

Closes all HIL boards opened by the current process.

Description

The hil_close_all function closes all HIL boards opened by the current process. This function is useful in exception handling. Running tasks associated with each board are stopped and allocated resources are released. Once the boards have been closed, the board handles are no longer valid and may not be used. Note that while hil_close_all does delete any tasks associated each board, it is better not to rely on this behavior. Use hil_task_stop and hil_task_delete to properly shut down tasks.

Prototype

t_error
hil_close_all(void);
    

Parameters

This function has no parameters.

Return value

The return value is 0 if the boards are closed successfully. Otherwise a negative error code is returned. Error codes are defined in quanser_errors.h. A suitable error message may be retrieved using msg_get_error_message.

Error codes

QERR_UNABLE_TO_LOCK_CARDS

It was not possible to gain access to the database of open boards. A thread may continue to hold the lock or the system may be low on memory.

QERR_OUT_OF_MEMORY

There is not enough memory to complete the operation.

Requirements

Include Files

Libraries

hil.h

hil.lib;quanser_runtime.lib;quanser_common.lib

Examples

hil_close_all();
    

See Also

 

navigation bar