Admin Production ni-theme
Current Publication

CNVGetArrayDataValue

LabWindows/CVI

CNVGetArrayDataValue

int CNVGetArrayDataValue (CNVData data, CNVDataType type, void *buffer, size_t numberOfElements);

Purpose

Copies the elements of the array data to the buffer argument.

Note that different programming environments may interpret multidimensional arrays in different formats. For example, two-dimensional arrays can be interpreted in row-major or column-major formats. This can affect the dimensions and data of multidimensional arrays communicated between different programming environments.

Parameters

Input
Name Type Description
data CNVData The handle that identifies the network variable data.
type CNVDataType The type of the specified network variable data. Note that CNVBool refers to a 1-byte boolean type (char or unsigned char), and CNVString refers to a C-style NUL-terminated string.
numberOfElements size_t The total number of elements in the network variable array data. For multidimensional arrays, you can calculate the total number of elements by multiplying all the dimensions of the array data.
Output
Name Type Description
buffer void * The value of the network variable array data. The length of the array passed must be greater than or equal to the value of the numberOfElements parameter. The Network Variable Library treats this parameter as a flat, contiguous block of memory and writes the elements in row-major order. The Network Variable Library allocates returned string elements. You must free these elements by calling CNVFreeMemory.

Return Value

Name Type Description
status int Return value indicating whether the function was successful. One indicates that a next item was found, zero indicates that a next item was not found, and a negative number indicates that an error occurred.

You can call CNVGetErrorDescription to obtain a string that describes the error.

Additional Information

Library: Network Variable Library

Include file: cvinetv.h

LabWindows/CVI compatibility: LabWindows/CVI 8.1 and later

Example

Refer to networkvariable\3DSim\NV3DSim.cws for an example of using the CNVGetArrayDataValue function.