Admin Production ni-theme
Current Publication

PlotPackedDigitalLines

LabWindows/CVI

PlotPackedDigitalLines

int PlotPackedDigitalLines (int panelHandle, int controlID, void *dataArray, size_t numberOfElements, int dataType, void *mask);

Purpose

Plots packed data from a single bus to a digital graph. To plot packed data from multiple buses, call PlotPackedDigitalLinesMultiBus.

The data you send to PlotPackedDigitalLines is packed, which means you can send data samples for more than one digital line per dataArray element. Each dataArray element corresponds to one data sample. The individual bits in each dataArray element correspond to data samples for individual lines. Use the mask parameter to specify which bits in the dataArray element refer to valid lines.

If you use NI-DAQmx to acquire the data you plot with PlotPackedDigitalLines, you must call DAQmxReadDigU8 as the read function.

Supported Controls

You can use PlotPackedDigitalLines with digital graph controls.

Parameters

Input
Name Type Description
panelHandle int Specifier for a particular panel that is currently in memory. You can obtain this handle from functions such as LoadPanel and NewPanel.
controlID int The defined constant, located in the .uir header file, that you assigned to the control in the User Interface Editor, or the ID returned by functions such as NewCtrl and DuplicateCtrl.
dataArray void * Array that contains the values to plot on the digital graph. The data type must be of the type specified by dataType. Each element in the dataArray corresponds to one sample. Each bit within the dataArray element corresponds to a data value for a line within the bus. Use the mask parameter to specify which lines to plot on the digital graph.

numberOfElements size_t Number of dataArray elements to plot. This value controls the number of elements to plot even if the total number of elements in dataArray is greater than numElements.

numElements must be greater than zero and not greater than INT_MAX.
dataType int The data type of dataArray. The data must be one of the following valid integer data types:

VAL_CHAR A single byte character
VAL_INTEGER A 4 byte integer
VAL_SHORT_INTEGER A 2 byte integer
VAL_UNSIGNED_CHAR An unsigned single byte character
VAL_UNSIGNED_INTEGER An unsigned 4 byte integer
VAL_UNSIGNED_SHORT_INTEGER An unsigned 2 byte integer
mask void * Pass a pointer to the mask. The mask itself must be of the type specified in dataType.

The mask specifies which bits in each data element are valid lines. The digital graph displays the result of a bitwise AND on mask and dataArray. For example, the dataArray you pass in to PlotPackedDigitalLines is of type VAL_SHORT_INTEGER. A mask referencing a value of 0x00F8 specifies that only lines three through seven are valid for the bus.

If you pass in VAL_SINGLE_LINE for the mask, then PlotPackedDigitalLines plots only one line. LabWindows/CVI plots the data in the least significant bit of the dataArray element. This is equivalent to passing in a pointer to a value of 0x0001 for the mask.

Return Value

Name Type Description
status int Return value indicating whether the function was successful. A negative number indicates that an error occurred.

Additional Information

Library: User Interface Library

Include file: userint.h

LabWindows/CVI compatibility: LabWindows/CVI 7.1 and later

Example

Refer to userint\DigGraphDAQmx.cws for an example of using the PlotPackedDigitalLines function.