LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dynamic control of waveform chart

I have a acquisition program where it's possible for user to add and remove channels acquired while program is running. I would like to have two graphs where in the first one I'd plot 1-3 channels (corresponding to three different signal sources/devices) in stacked waveform chart and in other one I'd plot 1-16 channels (corresponding to one 16 channel signal source where number of acquired channels varies) in the overlaid waveform chart. As a starting value only the stacked chart is visible filling the whole display area and showing one channel - the other chart is invisible. I've tried to update the chart properties with the property node, i.e. change the number of plots shown in the stacked graph by changing the "legend/plots shown" but this doesn't seem to work. Is it possible to change the chart properties while running the VI?

My other problem is that when i'd like to display the other chart, i'd need to divide the whole display area for two charts (i.e. half the size of the first one and make the other one visible and positioned to lower half). I've found difficult to get a grasp of how the position/size properties define the place and size for the charts - here changes seem to happen through property nodes in fly, though they don't happen the way i'd like. It seems that active plotting area also stops to go automatically with the total chart area. Does anyone have good examples or ideas how these things work? My purpose is to use VI properties to enable the interface to fit different resolution screens but i think i still need manually change the position/size to be able to resize the charts when devices are turned on/off.]

Thanks
Message 1 of 5
(3,065 Views)
Small update. I think i'll do the stacking along the lines of the DynamicStackPlots example available from developers zone. I'm just wondering if there's no cleaner way to do it and also why some of the chart properties can be changed in fly and others cannot.
0 Kudos
Message 2 of 5
(3,043 Views)
Hi CMX,

It's no problem to show and hide different plots programmatically. All you have to do is use the "Active Plot" property in conjunction with the "Plot.Visible" property. Remember that the Property Nodes execute the properties from top to bottom so you have to specify the active plot first before setting that active plots visibility to TRUE or FALSE. Please see the attached "ShowHidePlots.vi".

Yu are right about the behavior when resizing the plot area. You can't programmatically resize the size of the grab by itself, but only the plot. When resizing the plot, the rest of the graph indicator follows.

You should submit a Product Suggestion from the 'feedback' link on www.ni.com/contact. For now I hope you can use the workaround in the DynamicStackPlots example.
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
0 Kudos
Message 3 of 5
(3,028 Views)
Thanks. Yeah that's about how far i got with it. Problem with the dynamic stacking example is that i don't know how to assign properties for each chart in the array of clusters (as in the example, each cluster having chart). I thought i had individual elements from arrays by putting value to the index in the property node and then taking the reference of that element, which was a cluster. I couldn't find any entry from the cluster's property node that would have then given me the reference for the waveform chart inside it. I'd have liked to do this to assign correct labels for each of the stacked plots and possibly also control the scales independently. Is this possible to do?

At the moment i just ended up putting them back into overlaid plot and giving user possibility to set offset for each signal and scale the chart as he/she likes. It's not really the way i wanted it but i guess i have to do with it if there aren't other possibilities.
0 Kudos
Message 4 of 5
(3,025 Views)
Hi CMX,

The limitations that you are experiencing with the DynamicStackPlots.vi are caused by the fact that each Waveform Chart is simply representing an element (cluster) in the array sent to the front panel indicator. Since all elements in an array always share properties, you cannot choose different names, colors, scales, etc. for the different Charts.

Let me know if you have further questions, thanks.
- Philip Courtois, Thinkbot Solutions

Thinkbot Solutions
0 Kudos
Message 5 of 5
(3,005 Views)