LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding points to several traces in a stripchart

Hi,

can anybody tell me, how it is possible to add new points to one trace in a stripchart if I want to plot several traces in one stripchart?

If there is only one trace I can add a single point as follows:
PlotStripChartPoint (panelHandle, PANEL_STRIPCHART_CURRENT, current_value);

But how can I specify that this point is part of the second or third trace? With SetTraceAttribute I can set the attributes of several traces, but that doesn't make any sense if a stripchart can only display one trace...

Another possibility would be to use a graph instead of a stripchart, but than I have to reorganize the array which contains the Y-values every time I want to plot the graph, so that the oldest value is displayed on the left and the newest value is diplayed on the right side of the graph...
But the sorting of the array causes wasted computing time, so is there any possibility to add the newest value to an existing trace in a stripchart?

0 Kudos
Message 1 of 5
(4,517 Views)
The PlotStripChartPoint function is a very simplified form of the PlotStripChart function, which is what you should be using. PlotStripChart allows you to plot multiple data points at a time, and these points are appended to however many traces you have. So, for example, if you have 3 traces, and you pass 7 points to PlotStripChart, 2 points are added to each trace (and note that the last point isn't used at all, since 7 is not divisible by 3).

Luis
0 Kudos
Message 2 of 5
(4,510 Views)
Thanks for your hints, I checked them out but nevertheless it doesn't work...  😞

I think my problem is, how do I "activate" a new trace respectively more than one trace?

According to your example, if I have an array with three different values, each representing a actual value of a series of measurement and I want to plot each of them in a different trace, PlotStripChart adds all values in one trace and not every one in it's own trace...
So what do I have to do?

0 Kudos
Message 3 of 5
(4,475 Views)

Have you checked out the CVI Help for the PlotStripChart() function? It goes into great detail and I'm sure it has all the information you need.

JR

0 Kudos
Message 4 of 5
(4,470 Views)
Hello flashback,

I might not have been very clear in my example. The way it works is: if you have three traces, and you plot an array of three values, one value is appended to each trace. I assume this is what you want. It is not the case that all three values are appended to only one of the traces.

Also, keep in mind that before you plot, you must configure the number of traces in the strip chart. You do this either in the User Interface Editor, or programmatically, using SetCtrlAttribute with ATTR_NUM_TRACES.

You say that PlotStripChart isn't working for you. Can you describe in some detail what it is that you are seeing. And, like JR suggested, I also recommend that you read the help for the PlotStripChart function carefully.

Luis

0 Kudos
Message 5 of 5
(4,454 Views)