Stops all running tasks associated with a card.
Namespace:
Quanser.HardwareAssembly: Quanser.Hardware.Hil (in Quanser.Hardware.Hil.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Function TaskStopAll As Integer |
C# |
---|
public int TaskStopAll() |
Visual C++ |
---|
public: int TaskStopAll() |
JavaScript |
---|
function taskStopAll(); |
Return Value
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.Remarks
The TaskStopAll method 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 Start(Hil..::.Clock, Double, Int32) method. The TaskStopAll method is useful in exception handling where a specific task interface may be lost.
Examples
This example illustrates how to stop all tasks associated with a board.
Exceptions are ignored for simplicity.
C# | Copy Code |
---|---|
try { /* ... start multiple tasks ... */ } catch (Exception ex) { card.TaskStopAll(); } |
Visual Basic | Copy Code |
---|---|
Try ' ... start multiple tasks ... Catch ex As Exception card.TaskStopAll() End Try |
Visual C++ | Copy Code |
---|---|
try { /* ... start multiple tasks ... */ } catch (Exception^ ex) { card->TaskStopAll(); } |
Exceptions
Exception | Condition |
---|---|
Quanser.Hardware..::.HilException | If this operation is not supported or an error occurs then an exception is thrown. |