NI-DNET Data Types
This topic describes the data types used by NI-DNET functions and objects.
The NI-DNET data types provide consistency for various programming environments and facilitate access to the DeviceNet network. In general, all NI-DNET data types begin with NCTYPE_.
The following table lists each NI-DNET data type, its equivalent data type in ANSI C, LabVIEW, and DeviceNet, and a brief description.
NI-DNET Data Types
NI-DNET Data Type | ANSI C | LabVIEW | DeviceNet | Description |
---|---|---|---|---|
NCTYPE_type_P | NCTYPE_type * | N/A | N/A | Pointer to a variable with type type |
NCTYPE_INT8 | signed char | I8 | SINT | 8-bit signed integer |
NCTYPE_INT16 | signed short | I16 | INT | 16-bit signed integer |
NCTYPE_INT32 | signed long | I32 | DINT | 32-bit signed integer |
NCTYPE_UINT8 | unsigned char | U8 | USINT | 8-bit unsigned integer |
NCTYPE_UINT16 | unsigned short | U16 | UINT | 16-bit unsigned integer |
NCTYPE_UINT32 | unsigned long | U32 | UDINT | 32-bit unsigned integer |
NCTYPE_BOOL | unsigned char | TF (Boolean) | BOOL | Boolean value. In ANSI C, constants NC_TRUE (1) and NC_FALSE (0) are used for comparisons |
NCTYPE_STRING | char *, array of characters terminated by null character \0 | abc (string) | STRING | ASCII character string |
NCTYPE_REAL | float | SGL | REAL | 32-bit floating point |
NCTYPE_LREAL | double | DBL | LREAL | 64-bit floating point |
NCTYPE_ANY_P | void * | N/A | N/A | Reference to variable of unknown type, used in cases where actual data type can vary depending on particular context. |
NCTYPE_OBJH | unsigned long | Type definition ncObjHandle.ctl (U32) | N/A | Handle referring to an NI-DNET object. Refer to ncOpenDnetExplMsg, ncOpenDnetIntf, and ncOpenDnetIO. |
NCTYPE_VERSION | unsigned long | U32 | N/A | Version number. Major, minor, subminor, and beta version numbers are encoded in unsigned 32-bit integer from high byte to low byte. Letters are encoded as numeric equivalents ('A' is 1, 'Z' is 26, and so on). Version 2.0B would be hexadecimal 02000200, and Beta version 1.4.2 beta 7 would be hex 01040207. |
NCTYPE_DURATION | unsigned long | U32 | N/A | Time duration indicating elapsed time between two events. Time is expressed in 1 ms increments. (For example, 10 s is 10,000.) Special constant NC_DURATION_NONE (0) is used for zero duration, and NC_DURATION_ INFINITE (FFFFFFFF hex) is used for infinite duration. |
NCTYPE_ATTRID | unsigned long | U32 | N/A | Identifier used to access internal attributes in the NI-DNET device driver (not attributes in DeviceNet devices). Refer to NI-DNET Objects. |
NCTYPE_OPCODE | unsigned long | U32 | N/A | Operation code used with ncOperateDnetIntf function. |
NCTYPE_STATE | unsigned long | U32 | N/A | Object states, encoded as 32-bit mask (one bit for each state). For information, refer to ncWaitForState. |
NCTYPE_STATUS | signed long | I32 | N/A | For ANSI C, this represents the status returned from NI-DNET functions. Refer to ncStatusToString for more information. For LabVIEW, NI-DNET functions use the standard error clusters for status information. |