CAN Clear.vi

NI-CAN

CAN Clear.vi

Purpose

Stop communication for the task and then clear the configuration.

Format

Inputs

task reference in is the task reference from the previous NI-CAN VI. The task reference is originally returned from CAN Init Start.vi, CAN Initialize.vi, or CAN Create Message.vi, and then wired through subsequent VIs.
Error in describes error conditions occurring before the VI executes. If an error has already occurred, the VI returns the value of the Error in cluster in Error out.
status is True if an error occurred. Unlike other VIs, this VI will execute when status is True.
code is the error code number identifying an error. A value of 0 means success. A negative value means error: VI did not execute the intended operation. A positive value means warning: VI executed intended operation, but an informational warning is returned. For a description of the code, wire the error cluster to a LabVIEW error-handling VI, such as the Simple Error Handler.
source identifies the VI where the error occurred.

Outputs

Error out describes error conditions. If the Error in cluster indicated an error, the Error out cluster contains the same information. Otherwise, Error out describes the error status of this VI.
status is True if an error occurred.
code is the error code number identifying an error. A value of 0 means success. A negative value means error: VI did not execute the intended operation. A positive value means warning: VI executed intended operation, but an informational warning is returned. For a description of the code, wire the error cluster to a LabVIEW error-handling VI, such as the Simple Error Handler.
source identifies the VI where the error occurred.

Description

The CAN Clear VI must always be the final NI-CAN VI called for each task. If you do not use the CAN Clear VI, the remaining task configurations can cause problems in execution of subsequent NI-CAN applications.

If the cleared task is the last running task for the initialized interface (refer to CAN Init Start.vi), the CAN Clear VI also stops communication on the CAN controller of the interface and disconnects all terminal connections for that interface.

Unlike other VIs, this VI will execute when status is True in Error in.

Because this VI clears the task, the task reference is not wired as an output. To change properties of a running task, use CAN Stop.vi to stop the task, CAN Set Property.vi to change the desired property, and then CAN Start.vi to restart the task.