Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

Smooth scrolling strip chart

I am using meas. studio for visual basic 6.0 and am trying to do the
following
a. Set a predefined stripchart width (x axis) ...5 minutes
b continuously acquire data and chart it with the ChartXvsY method.
c. when the data reaches the end of the chart, have the chart smoothly
scroll so that new data (on the right) pushes old
data (on the left) off of the screen.
d. the x axes refect a fixed width of (max-min)= 5 minutes, but changes
dynamically to scroll with the data.

I have been able to get close by the following
upon startup of the graph
CWGraph1.Plots(1).ClearData
CWGraph1.ChartLength = 1200
CWGraph1.Axes(1).AutoScale = False
CWGraph1.Axes(1).Minimum = 0
CWGraph1.Axes(1).Maximum = 5

then when the chart is running
:
If (currtime > 5 And CWGraph1.Axes(1).AutoScale = False)
Then
CWGraph1.Axes(1).AutoScale = True
CWGraph1.Axes(1).AutoScaleNow
End If
CWGraph1.Plots(1).ChartXvsY Xdata, Ydata

This doesn't exactly work, as the autoscaling extends the tail end of the
chart (left) beyond the last retained point so that the chart disapears in
the air. I would like it to clip AT the left margin so that it appears as
though the data is simply scrolling off screen.

Any Suggestions?
Thanks in advance!!
Steve S
0 Kudos
Message 1 of 3
(4,339 Views)
Hey Steve,
I think a possible solution here is to use the CWGraph ChartStyle of cwChartStrip. I think this will yield the result you are looking for. This will "roll" the graph in the same sense of a "sweep" setting of a strip chart in CVI. If this is not what you are looking for, post back to this listing. Thanks.
0 Kudos
Message 2 of 3
(4,338 Views)
Steve,

I had a similar requirement to provide smooth scrolling, and in the end I found the the best way was to just set the X Max, and then set the X Min to be X Max minus the graph width, and not use the auto scaling.

Doing it this way also means that you can retain a history by allowing the chart length to be longer than the number of displayed plots, which can be viewed just by changing the X min back to the first required plotted point.
0 Kudos
Message 3 of 3
(4,338 Views)