PlotWaveform
int PlotWaveform (int panelHandle, int controlID, void *yArray, size_t numberOfPoints, int yDataType, double yGain, double yOffset, double initialX, double xIncrement, int plotStyle, int pointStyle, int lineStyle, int pointFrequency, int color);
Purpose
Plots a waveform onto a graph control.
PlotWaveform scales the values in yArray according to yGain and yOffset. The function scales the x-axis timebase according to initialX and xIncrement. PlotWaveform computes each point in the plot as follows:
xi = (i × xIncrement) + initialX
yi = (wfmi × yGain) + yOffset
where i is the index of the point in the waveform array.
Supported Controls
You can use PlotWaveform with 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. | ||||||||||||||||||||||||||||||||||||||||||||||||||
yArray | void * | Array that contains the values to plot along the y-axis. The data type must be of the type specified by yDataType. | ||||||||||||||||||||||||||||||||||||||||||||||||||
numberOfPoints | size_t | Number of points to plot. This value controls the number of points to plot even if the number of elements in xArray is greater than the numberOfPoints. numberOfPoints must be greater than zero and not greater than INT_MAX. |
||||||||||||||||||||||||||||||||||||||||||||||||||
yDataType | int | The data type of the y array. The following table lists the valid data types.
|
||||||||||||||||||||||||||||||||||||||||||||||||||
yGain | double | The gain to apply to the waveform (yArray) data. The default value is 1.0. |
||||||||||||||||||||||||||||||||||||||||||||||||||
yOffset | double | A constant offset to add to the waveform (yArray) data. The default value is 0.0. |
||||||||||||||||||||||||||||||||||||||||||||||||||
initialX | double | The initial value for the x-axis. The default value is 0.0. |
||||||||||||||||||||||||||||||||||||||||||||||||||
xIncrement | double | The increment along the x-axis for each new point. The default value is 1.0. |
||||||||||||||||||||||||||||||||||||||||||||||||||
plotStyle | int | Curve style to use when plotting the data points. The default value is VAL_THIN_LINE. The following table lists valid styles.
|
||||||||||||||||||||||||||||||||||||||||||||||||||
pointStyle | int | Point style to use when plotting the array. The point style determines the type of marker to draw when the plot style is VAL_CONNECTED_POINTS or VAL_SCATTER. The default value is VAL_EMPTY_SQUARE.
|
||||||||||||||||||||||||||||||||||||||||||||||||||
lineStyle | int | The line style.
|
||||||||||||||||||||||||||||||||||||||||||||||||||
pointFrequency | int | The point interval at which to draw marker symbols when the curve style is VAL_CONNECTED_POINTS or VAL_SCATTER. The default value is 1 and can be as large as the number of points in the plot. | ||||||||||||||||||||||||||||||||||||||||||||||||||
color | int | Specifies the color of the data to plot. An RGB value is a 4-byte integer with the hexadecimal format 0x00RRGGBB. RR, GG, and BB are the respective red, green, and blue components of the color value. The first sixteen colors in the table are the sixteen standard colors.
You also can use the User Interface Library function, MakeColor, to create an RGB value from red, green, and blue color components. To enter user-defined color values, select Options»Toggle Control Style in the function panel and manually enter the color value. |
Return Value
Name | Type | Description | ||
plotHandle | int | The handle of the new plot that you can use in subsequent function calls to reference the plot. If the handle is positive, the new plot was successfully added to the graph. Negative values indicate that an error occurred.
|
Additional Information
Library: User Interface Library
Include file: userint.h
LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later