flex_get_motion_board_name |
Get Motion Board Name
Usage
status = flex_get_motion_board_name(u8 boardID, i8* charArray, u32* sizeOfArray);
Purpose
Gets the motion controller name as an ASCII character array.
Parameters
Name | Type | Description |
---|---|---|
boardID | u8 | assigned by Measurement & Automation Explorer (MAX) |
charArray | [i8]* | character array |
sizeOfArray | u32* | size of character array |
Parameter Discussion
sizeOfArray is the number of characters in the controller name plus one for the NULL string terminator. As an input, this I/O parameter specifies the size of the allocated array. If sizeOfArray is insufficient, a NIMC_insufficientSizeError is returned as the status of the function, and the required character array size (including space for the NULL terminator) is returned in the sizeOfArray parameter. If sizeOfArray is sufficient, a NIMC_noError is returned as the status of the function, the name is copied into the character array, and the number of bytes copied (plus one for the NULL terminator) is returned in the sizeOfArray parameter.
charArray is an array of ASCII characters containing the name of the controller. The NI-Motion software places the name of the controller, referenced by boardID, in the character array, if there is sufficient space. You must allocate space for this array before calling this function.
Using This Function
This function returns the name of the motion controller as an ASCII character array. You must allocate space for this array on the host computer before calling this function.
If NULL (or 0) is passed in the charArray parameter, the size of a character array required to hold the controller name is returned in the sizeOfArray parameter. You can use this feature when you want to allocate only the memory necessary to hold the controller name. This function is then called twice: one time to get the required array size, and again to actually retrieve the name.
The number of characters required for the character array is always one more than the actual number of characters in the controller name due to the NULL terminator at the end of the string. For example, the controller name PXI-7344 is eight characters long, so you must provide a 9-byte character array to hold this name. sizeOfArray must be nine or greater as an input, and upon successful copy of the controller name, a value of nine is placed in sizeOfArray.