PlotStripChart
int PlotStripChart (int panelHandle, int controlID, void *yArray, size_t numberOfPoints, int startingIndex, int skipCount, int yDataType);
Purpose
Adds one or more points to each trace in a strip chart control.
The right edge of the strip chart is considered a grid line. This grid line can contain a data point. To achieve the best results when repeatedly plotting arrays that exactly fill the width of the strip chart, arrange for the data point that is on the left edge of the strip chart before you plot to be on the right edge of the strip chart after you plot. This action synchronizes your plots with the grid lines. Set the ATTR_POINTS_PER_SCREEN attribute to one greater than the value you pass as numberOfPoints to PlotStripChart. For example, if you intend to add 100 points to the strip chart each time you call PlotStripChart, set ATTR_POINTS_PER_SCREEN to 101.
If you fail to do this and your strip chart is Continuous mode, the grid lines drift across the strip chart.
If you fail to do this and your strip chart is in Sweep mode or Block mode, gaps can arise from the right side of the strip chart. The following example illustrates the scenario:
You set ATTR_POINTS_PER_SCREEN to 100. You call PlotStripChart with 100 points. It plots from 0 to 99. You call PlotStripChart again with 100 points. It plots from 100 to 199. In this situation, LabWindows/CVI never draws the curve between 99 and 100.
Instead of calling SetCtrlAttribute to set ATTR_POINTS_PER_SCREEN, you can use the Points per screen option in the Edit Strip Chart dialog box of the User Interface Editor.
Supported Controls
You can use PlotStripChart with strip chart 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 yArray points to add to the strip chart. This value must be an integer multiple of the number traces in the strip chart. This value determines the number of points to plot even if the number of elements in yArray is greater than the numberOfPoints. The default value is 1. | ||||||||||||||||||||||||||||||
startingIndex | int | Index of the element in the yArray where the first block of data begins. This value is zero based and must be a positive integer. The default value is 0. | ||||||||||||||||||||||||||||||
skipCount | int | Number of yArray elements the function skips after plotting
each set of points. The default is 0. Suppose you have an array that contains four data sets (A,B,C,D) and you want to plot each A-B pair into a strip chart control. Consider the following example of element ordering: A B C D A B C D A B C D In the preceding example, entering a skipCount of 2 causes the function to skip each C-D pair before it plots the next A-B pair. |
||||||||||||||||||||||||||||||
yDataType | int | The data type of the y array. The following table lists the valid data types.
|
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 3.0 and later
Examples
Refer to the following examples that use the PlotStripChart function:
- apps\screenupdate\update.cws
Open example
- userint\autoscaling.cws
Open example
- userint\stripchart.cws
Open example
- userint\timer.cws
Open example
- utility\threading\ThreadSafeQueue\BuffNoDataLoss\BuffNoDataLoss.cws
Open example
- utility\threading\ThreadSafeQueue\DirectPtrAccess\DirectPtrAccess.cws
Open example