ncDisconnectTerminals

NI-CAN

ncDisconnectTerminals

Purpose

Disconnect terminals in the CAN or LIN hardware.

Format

NCTYPE_STATUS ncDisconnectTerminals(
NCTYPE_OBJH ObjectHandle,
NCTYPE_UINT32 SourceTerminal,
NCTYPE_UINT32 DestinationTerminal,
NCTYPE_UINT32 Modifiers);

Inputs

ObjectHandle

The object handle from the previous NI-CAN function. The ObjHandle is originally returned from ncOpenObject.

SourceTerminal

Specifies the source of the connection.

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

DestinationTerminal

Specifies the destination of the connection.

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

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.

Description

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

When the final CAN object for a given port is cleared with ncCloseObject, NI-CAN disconnects all terminal connections for that port. Therefore, the ncDisconnectTerminals function is not required for most applications. You typically use this function to change RTSI connections dynamically while the application is running. First use ncAction with the NC_OP_STOP opcode to stop all CAN Objects for the port, then use ncDisconnectTerminals and ncConnectTerminals to adjust RTSI connections, then use ncAction with the NC_OP_START opcode to start the network interface and restart sampling.