LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

StripChart contol and set y-axis coorinates

I have a number of data which is in different channel. I hope the center of y-axis scale is the real value of each channel. For example, in channel 1, the value is about 5000.0; in channel 2, the value is about 7000.0; ... When i select channel 1, i want 5000.0 is the center of the y-axis,...

so my code is:
yValue = ...//get the value of y-axis
SetAxisScalingMode (mainPanel, MAIN_PANEL_CHART, VAL_LEFT_YAXIS, VAL_MANUAL, yValue-10, yValue+10);
PlotStripChartPoint (mainPanel, MAIN_PANEL_CHART, yValue);

the problem is the y-axis changed every time with the change of yValue, and there is no curve on the strip chart? How to solve the problem?

Any help would be great.
0 Kudos
Message 1 of 5
(3,358 Views)
well,
I don't think there is solution like you wish.
what I do in this case, is setting a reasonable y-scaling beforehand and then only change y-scaling when the actual data goes out of
that range.
of course, this will only fit if all data values are in a comparable range
(you won't se much on a chart with curve #1 in 5000+-10 range and curve #2 1000+-20 :).
a solution to this would be individual y-scaling for each curve - but that is not implemented
(maybe one should file this as a wish-list item ?)
--
Once the game is over, the king and the pawn go back into the same box.
0 Kudos
Message 2 of 5
(3,346 Views)
Thanks josswern. But the problem is still exist.

when I used
SetAxisScalingMode (mainPanel, MAIN_PANEL_CHART, VAL_LEFT_YAXIS, VAL_MANUAL, 5000-10, 5000+10);
PlotStripChartPoint (mainPanel, MAIN_PANEL_CHART, yValue);
There is still no curve on the strip chart? I have no idea about which function can alter the y-axis scale.
When I note the SetAxisScalingMode(), the curve can show on the strip chart. why?
0 Kudos
Message 3 of 5
(3,338 Views)
jinn,
each time you call SetAxisScalingMode(),
the stripchart is reset and begins to grow from the origin again.
so you will never see a plot when calling SetAxisScalingMode before plotting.
my proposal was, to just call SetAxisScalingMode if the actual data has changed so much that it doesn't fit
anymore to the preset scale.
at least, that's what works for me.
--
Once the game is over, the king and the pawn go back into the same box.
0 Kudos
Message 4 of 5
(3,332 Views)
josswern,
Thank you very much. I have settled the problem according to you proposal.
0 Kudos
Message 5 of 5
(3,318 Views)