Frame API for C

NI-CAN

Frame API for C

This topic lists the NI-CAN functions and describes the format, purpose and parameters.

Unless otherwise stated, each NI-CAN function suspends execution of the calling thread until it completes. The functions in this topic are listed alphabetically.

Section Headings

The following are section headings found in the Frame API for C functions.

Purpose

Each function description includes a brief statement of the purpose of the function.

Format

The format section describes the format of each function for the C programming language.

Input and Output

The input and output parameters for each function are listed.

Description

The description section gives details about the purpose and effect of each function.

Network Interface Object

The Network Interface Object section gives details about using the function with the Network Interface Object.

CAN Object

The CAN Object section gives details about using the function with the CAN Object.

Data Types

The following data types are used with functions of the NI-CAN Frame API for C.

Data Type Purpose
NCTYPE_INT8 8-bit signed integer
NCTYPE_INT16 16-bit signed integer
NCTYPE_INT32 32-bit signed integer
NCTYPE_UINT8 8-bit unsigned integer
NCTYPE_UINT16 16-bit unsigned integer
NCTYPE_UINT32 32-bit unsigned integer
NCTYPE_BOOL Boolean value. Constants NC_True (1) and NC_False (0) are used for comparisons.
NCTYPE_STRING ASCII string represented as an array of characters terminated by null character (`\0' ).
NCTYPE_type_P Pointer to a variable of type.
NCTYPE_ANY_P Pointer to a variable of any type, used in cases where actual data type can vary depending on the object in use.
NCTYPE_OBJH 32-bit unsigned integer used to reference an open object in the Frame API.
NCTYPE_ATTRID Attribute identifier. Uses constants with prefix NC_ATTR_.
NCTYPE_OPCODE Operation code for ncAction function. Uses constants with prefix NC_OP_.
NCTYPE_STATE Object states, encoded as a 32-bit mask, one bit for each state. Refer to ncWaitForState for more information.
NCTYPE_STATUS Status returned from NI-CAN functions. Refer to ncStatusToString for more information.
NCTYPE_CAN_ARBID CAN arbitration ID. The 30h bit is accessed using bitmask NC_FL_CAN_ARBID_XTD (2000000 hex). If this bit is clear, the CAN arbitration ID is standard (11-bit). If this bit is set, the CAN arbitration ID is extended (29-bit). Special constant NC_CAN_ARBID_NONE (CFFFFFFF hex) indicates no CAN arbitration ID, and is used to set the comparator attribute of the CAN Network Interface. Refer to ncConfig for more information.

List of Functions

The following table contains an alphabetical list of the NI-CAN Frame API for C functions.

Function Purpose
ncAction Perform an action on an object.
ncCloseObject Close an object.
ncConfig Configure an object before using it.
ncConnectTerminals Connect terminals in the CAN hardware.
ncCreateNotification Create a notification call back for an object.
ncDisconnectTerminals Disconnect terminals in the CAN hardware.
ncGetAttribute Get the value of an object attribute.
ncGetHardwareInfo Get NI-CAN hardware information.
ncOpen Open an object.
ncRead Read the data value of an object.
ncReadMult Read multiple data values from the queue of an object.
ncSetAttribute Set the value of an object attribute.
ncStatusToString Convert status code into a descriptive string.
ncWaitForState Wait for one or more states to occur in an object.
ncWrite Write the data value of an object.
ncWriteMult Write multiple frames to a CAN Network Interface Object.