LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Graph differ in CVI 6.0 and 7.0

The attached project does not plot the graphs the same way if run with CVI 6.0 and CVI 7.0
In CVI 6.0, a persistance is done and not with 7.0 where the graph is clear when a new trace is plotted.
How to obtain a persistance with CVI 7.0?

Regards,
Yannick Willener
0 Kudos
Message 1 of 6
(3,151 Views)
I'm not sure why the move from 6.0 to 7.0 is causing this for you, but this code should clear the graph in both versions because you are setting the the graph to Data Mode of Discard.

If you set the data mode of the graph to Discard, it will remove the former plots with each new plot function call. If you set the data mode to Retain, it will retain the previously plotted data. Since you put the line:

SetCtrlAttribute (panelHandle, PANEL_GRAPH, ATTR_DATA_MODE, VAL_DISCARD);

in your code, then your graph is discarding plots, not retaining them on each new plot.

Best Regards,

Chris Matthews
National
0 Kudos
Message 2 of 6
(3,151 Views)
Hello Chris,

The documentation say:

ATTR_DATA_MODE
Description: Specifies whether plot data is retained after the plot is drawn. Discarding the data can save memory (especially when plotting multiple plots), but it causes the plots to disappear when the graph is rescaled or when ATTR_SMOOTH_UPDATE is FALSE and the graph is redrawn.

As I have understanding it, ATTR_DATA_MODE does not affect the drawing of the trace until the control is resized. In my application, I can plot an infinity of trace on the same graph, and I don't want to keep in memory all the points of the traces. I just want to keep the pixels on the screen, not all the data set.

Whith CVI 6, the result is what I expected, but not with CVI 7. I have try this on multiple station
and the difference is the same on each station.

Could you give me a way to do the persistance with CVI 7 without keeping all the points in memory?

Regards,
Yannick Willener
0 Kudos
Message 3 of 6
(3,151 Views)
I understand what you are wanting, but no, there isn't a way. You could decimate the data yourself before plotting it based on the size of the graph, but it will keep the data in RETAIN mode which it did in CVI 6.0 as well. If your window was moved slightly, or another window covered the graph, we would have to have the data to redraw. I'm not sure why you are seeing the data persist in 6.0. That doesn't happen for me. If I set the DATA_MODE to discard, then the plot data is cleared every time I call a plot function.

Chris
0 Kudos
Message 4 of 6
(3,151 Views)
Yannick,

You are correct in your interpretation of this attribute. There actually is a bug in 7.0 that is causing the graph to needlessly refresh its plots under some conditions. Normally that would be unnoticeable (although it would slow down plotting), but if you use VAL_DISCARD, then you would see this behavior.

If you want to continue using VAL_DISCARD, there is a workaround you can use until the problem is fixed: make sure that your *top* x-axis has autoscaling turned off. You can do this in the UI Editor, or you can do it programmatically, using the following code:

SetAxisScalingMode (panel, control, VAL_TOP_XAXIS, VAL_LOCK, 0, 0);

Sorry about the inconvenience.

Luis Gomes
NI
0 Kudos
Message 5 of 6
(3,151 Views)
Thank you, it is exactly what I was looking for.

Yannick Willener
0 Kudos
Message 6 of 6
(3,151 Views)