hil_task_stop_all
Stops all running tasks associated with a card.
Description
The hil_task_stop_all function stops all running tasks that are associated with the given card. Tasks may be stopped before they have processed all of their samples. Tasks may also be restarted using the hil_task_start function. This function is useful in exception handling where a specific task handle may be lost.
Prototype
t_error hil_task_stop_all(t_card card);
Parameters
t_card card
A handle to the board, as returned by hil_open.
Return value
The return value is the number of tasks that were stopped successfully. This
number may be less than the number of running tasks if not all tasks could be
stopped successfully. A negative error code may also be returned if the function
is not supported or the card handle is invalid.
Error codes are
defined in quanser_errors.h
. A suitable error message
may be retrieved using
msg_get_error_message.
Error codes
QERR_HIL_TASK_STOP_NOT_SUPPORTED
This function is not supported by the board-specific HIL driver for this board type.
QERR_INVALID_CARD_HANDLE
An invalid card handle was passed as an argument. Once a card has been closed using hil_close the card handle is invalid.
Requirements
Include Files |
Libraries |
---|---|
hil.h |
hil.lib;quanser_runtime.lib;quanser_common.lib |
Examples
try { /* Start multiple tasks */ ... } catch (...) { hil_task_stop_all(board); }
Copyright ©2024 Quanser Inc. This page was generated 2024-10-17. Submit feedback to Quanser about this page.