LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Refresh Graph with user-defined range and scale

I tried to read the input data from the panel and refresh the plot but met a strange problem: it can only response correctly when the input numbers starting from "1". Here is a test,

step1: "start=1000,stop=100000"  shown correctly
step2: "start=2000,stop=50000" stays the same, no change
step3: "start=10000,stop=1000000" updated correctly

Is it possible that I forgot to set some attribute in the following codes?

        GetCtrlVal(figure_handle,FIGURE_START,&start);
        GetCtrlVal(figure_handle,FIGURE_STOP,&stop);
        SetAxisScalingMode(figure_handle,FIGURE_POWERGRAPH,VAL_BOTTOM_XAXIS,VAL_MANUAL,start,stop);
        GetCtrlVal(figure_handle,FIGURE_SCALE,&i);
        switch(i)
                {
        case 0:
            SetCtrlAttribute (figure_handle, FIGURE_POWERGRAPH,ATTR_XMAP_MODE, VAL_LOG);
            break;
        case 1 :
            SetCtrlAttribute (figure_handle, FIGURE_POWERGRAPH,ATTR_XMAP_MODE, VAL_LINEAR);
            break;
            }

Thanks for your help,
wmf
Message 1 of 2
(2,925 Views)
If you are using log scales, then yes, CVI only supports powers of 10 for the maximum and minimum of the axes (it is a base-10 logarithm). When you try to set the range to something else, the graph will coerce the values to the nearest powers of 10.

Luis
0 Kudos
Message 2 of 2
(2,917 Views)