nctDisconnectTerminals

NI-CAN

nctDisconnectTerminals

Purpose

Disconnects terminals in the CAN hardware.

Format

nctTypeStatus nctDisconnectTerminals(
nctTypeTaskRef TaskRef,
u32 SourceTerminal,
u32 DestinationTerminal,
u32 Modifiers);

Inputs

TaskRef

Task reference from the previous NI-CAN function. The task reference is originally returned from nctInitStart, nctInitialize, or nctCreateMessage.

SourceTerminal

Specifies the source of the connection.

For a description of values for SourceTerminal, refer to nctConnectTerminals.

DestinationTerminal

Specifies the destination of the connection.

For a description of values for DestinationTerminal, refer to nctConnectTerminals.

Modifiers

Provides optional connection information for certain source/destination pairs. The current release of NI-CAN does not use this information for any source/destination pair, so you must pass Modifiers as zero.

Outputs

Return Value

The return value indicates the status of the function call as a signed 32-bit integer. Zero means the function executed successfully. A negative value specifies an error, which means the function did not perform the expected behavior. A positive value specifies a warning, which means the function performed as expected, but a condition arose that may require attention.

Use the ncStatusToString function of the Frame API to obtain a descriptive string for the return value. The ncStatusToString and ncGetHardwareInfo functions are the only Frame API functions that can be called within a Channel API application.

Description

This function disconnects a specific pair of source/destination terminals you previously connected with nctConnectTerminals.

When the final task for a given interface is cleared with nctClear, NI-CAN disconnects all terminal connections for that interface. Therefore, the nctDisconnectTerminals function is not required for most applications. You typically use this function to change RTSI connections dynamically while the application is running. First use nctStop to stop all tasks for the interface, then use nctDisconnectTerminals and nctConnectTerminals to adjust RTSI connections, then nctStart to restart sampling.