Set Fault VI

Owning Palette: Faults VIs

Requires: Base Development System (Real-Time, Windows)

Creates a fault. When the major fault input is TRUE, this VI triggers fault mode. Use the code element of the error in (user fault) input cluster to specify the fault code.

Details  Example

 Add to the block diagram  Find on the palette
major fault specifies whether the fault is major (TRUE) or minor (FALSE).
error in (user fault) specifies the fault code. If you do not specify a fault code, the fault code defaults to −66480.
status indicates whether code corresponds to an error or a warning. This VI triggers a fault based on the presence of a non-zero error code, regardless of the value of status.
code is the fault code.
source specifies the source of the fault. This is an optional parameter that you can use to provide information about the fault.
error adding fault contains error information related to the creation of the fault. Fault creation can fail if the NI Scan Engine is not installed on the target or if the target has already reached the maximum number of active faults (100). Right-click the error out front panel indicator and select Explain Error from the shortcut menu for more information about the error.
status indicates whether an error occurred while this VI ran.
code is the fault code.
source indicates the origin of the error. The default is an empty string.
error out returns error in (user fault).

Set Fault Details

This VI does not allocate memory, so you can use this VI in a time-critical section of an application without significantly affecting determinism.

This VI must run on a target with the NI Scan Engine installed.

Example

Refer to the Scan Engine.lvproj in the labview\examples\Scan Engine directory for an example of using the Set Fault VI.

 Open example  Find related examples