LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Stripchart scrolling labels

Hello,
I have searched around for quite a bit and was unable to find a way to do this. My client specifically asked for scrolling values on the time-domain (x) axis on my strip charts. The stripchart does not move very fast, but I have it set to continuous scrolling mode. It displays 5 minutes worth of data at once, so it will not be moving very fast. I understand there is added functionality to stripcharts in CVI 8.5, but I am using CVI 8.1.1. If you have any possible solutions, please let me know.
Thanks in advance,
Alex
0 Kudos
Message 1 of 7
(3,762 Views)

Hi Baselerd,

Are you simply trying to get the stripchart to scroll as soon as the points reach the end of the current maximum of the x axis?
If so, it should be doing this by default...

Or am I misunderstanding what you are trying to do?

Jervin Justin
NI TestStand Product Manager
0 Kudos
Message 2 of 7
(3,725 Views)
Jervin,
It already does that. However, the actual numerical indicators are only located at the origin and far right of the graph. They update every second, but their position remains at the edges of the graph. I am trying to get them to move from the right of the graph to the left and stay with their gridlines.
 
Currently I have real time data being shown on the stripchart with absolute time as the x-axis. It doesnt mean that much to my clients when the origina keeps updating (4:53:32 PM for example) and the far right will be 4:58:32PM - 5 minutes later. If I have 5 x-divisions on my graph, I would like them to stay with the scrolling graph lines so I can see the minutes associated with each graph line.
0 Kudos
Message 3 of 7
(3,720 Views)
Hi Baselerd,

Unfortunately that won't work in 8.1. You need to use 8.5 in order to have the x-axis labels to automatically track the gridlines.

You do have one possible workaround, although it's a bit clunky. In the UI editor, you can set the "enable label strings" option in the axis settings, and then add a few labels spanning the width of the axis (click the "Generate Values" button in order to distribute the labels uniformly). You can enter a time formatting string as each label (for example, "%X").

Then, as you plot, you can track how many points you've added, and every few points, you'll have to add a new label (and remove an old label). For example, the following code should work:

            GetCtrlAttribute (panel, PANEL_CHART, ATTR_POINTS_PER_SCREEN, &pps);
            if (counter >= pps && counter % (pps / NUM_LABELS) == 0)
            {
                DeleteAxisItem (panel, PANEL_CHART, VAL_BOTTOM_XAXIS, 0, 1);
                InsertAxisItem (panel, PANEL_CHART, VAL_BOTTOM_XAXIS, -1, "%X", counter);
            }
            PlotStripChart (panel, PANEL_CHART, data, 1, 0, 0, VAL_DOUBLE);
            counter++;

'counter' is a variable that tracks the number of points you've plotter. The code above plots one point at a time, but you could probably adjust easily it if you plot more than one point. 'NUM_LABELS' refers to the number of labels you want to show at any one time.

Luis
0 Kudos
Message 4 of 7
(3,705 Views)

Luis,

Thank you. That works perfectly.

Alex

0 Kudos
Message 5 of 7
(3,677 Views)
Actually,
It doesnt work perfectly. It sounds like it is exactly what I need, but for some reason, my graph is not showing the values. I have the ATTR_XUSE_LABEL_STRINGS attribute set to 1. The value pairs show in the GUI editor, but when I run my app, the values are missing. I have tried every combination of selecting "Show Labels" and "Use Axis Labels"Any suggestions?
Thanks,
Alex
0 Kudos
Message 6 of 7
(3,668 Views)

I figured out my problem. It was pretty simple. I was using absolute time, so the offset I used invalidated that loop with the counter starting at 0. Silly mistake =S

Thanks for all the help.

0 Kudos
Message 7 of 7
(3,651 Views)