03-18-2013 07:39 AM
Hi,
I am trying to create a vi that will get an excel input file and will plot it to a graph as a stack plot were I can chose the number of channels I want to display but there X axy scroll bar would be the same for all graphs
have lab View 12
excel file attached - X axy is time and is the first column every other column is a different measured channel
I want to dynamically be able to stack plot lets say 5 or 6 chances- meaning set 1st plot to be ch4 and 2nd plot be ch7 ....
I thought of doing it with mixed signal but it just overlayes 1 on the other
thanks,
Assaf
03-18-2013 04:41 PM
I think the best option for something like this would be to use multiple controls, where the X scale is hidden. You can draw the X scale on the bottom graph or in a separate graph which will be hidden behind the bottom graph or in a picture control (there are shipping VIs for drawing scales). If your Y scales can be identical, you can use an array of XY graphs. If not, you can create "enough" and hide the ones you don't need.
This sounds like a nice candidate for an XControl, but you should be aware that there can be numerous complications with getting it to work properly. All in all, an interesting challenge, but one which I predict will require some work to properly work out all the kinks.
03-18-2013 06:31 PM
Can you explain what you mean by "stacked plots"? SInce the time points seem to be spaced equally, all you need is a waveform graph. Loop through each plot and add an increment so they stack.
03-18-2013 06:47 PM
I think the point is that the plots are placed one above the other, each in its own plot area, with no overlap. That would also explain the attempt to use the mixed signal graph, which has separate plot areas. I gave it a quick look, but didn't see a way to dynamically add plot areas to it.
03-19-2013 01:44 AM
the idea is to have somthing looking like this (attched) that i can add and remove (display) chanels as pleased
03-19-2013 07:52 AM
I can think of three basic options:
Like I said, I think that in any case it would require some work to get everything to work properly.
03-20-2013 01:50 AM
I sew that the waveform chart has in its properties "# plot shown" I was thinking if I can have it as an external knob I then can do the fooling:
1) load results file
2) configure number of channels I want to display
3) loop execute the wave form chat to draw the graphs
I sew in one of the LV examples that if I add take channels and cluster them and then driving them to a wave before it will add the display but I couldnt figure how to make it automatically - and it was working with a sin/cos wave signal generator
any ideas ?
03-21-2013 05:01 AM
I see what you're talking about. The example called Charts does show a chart with stacked plots. Looking at it, it looks like you can set up charts (but not graphs) to stack plots instead of overlaying them by right clicking it. The difference between a chart and a graph is that in a chart you input a single value each time and the chart maintains its history on its own, so in your case you would simply modify the example by updating the chart in a for loop - one iteration for each value.
One problem with this is that it looks like this can only be set at edit time. While the chart does have a Lenged:Number of Rows property, that only seems to actually work in overlay mode.
One option you can try for this is creating N chart controls, each with a different number of visible plots and then only displaying the one you want based on the number of plots and updating it.
Another option is a modification of option 1 I suggested earlier which should require a bit less work - statically create N scales on the graph and hide them. Link each plot to a separate scale and then get the Max and Min of the data for each plot, decide what its scale should be and where it should go in the display and then modify the scale values. For example, if you have 5 plots and the second plot has values of 0-100, then you set its scale to be -100 to 400, which will put the 0-100 values in the 20-40% area.
12-16-2014 12:38 AM
yo u can set number of plot areas while code development let say 10 plots , and programatically you can index the y scales
01-13-2015 10:18 PM
can i get example like this using lab view 2012 sp1??