11-13-2014 01:28 PM - edited 11-13-2014 01:31 PM
Hi Jeff,
I can't open your attachments. It says 'file version is later than the current labview version'. I'm using Labview 2012.
I fixed it using altenbach's suggestion but I'd still like to see what you did.
Thanks.
11-13-2014 01:29 PM - edited 11-13-2014 01:32 PM
Why don't you just use the Plot Visibility Checkbox for the plots? Right-click on the chart's legend and select Visible Items->Plot Visibility Checkbox. That will elminate the need for the clusters and the last set of FOR loops.
Since you are only plotting a set run, use a graph instead of a chart. A chart is meant to keep a history in its display. If you just want to show the data from this file, then use a graph.
You can get really far with a few Array Subsets and (possible) Transpose 2D Array instead of the Index Array with FOR loops and Build Arrays.
And since you are just reading the file once, there is no need for that huge While loop.
11-13-2014 01:35 PM - edited 11-13-2014 01:39 PM
Back Saved for 2012 (Sorry about that)
No option to stack plots in a graph. Or I would have gone there myself
Do pay attention to the chart's "Transpose" property and note the index array can slice columns or rows
11-13-2014 01:38 PM - edited 11-13-2014 01:52 PM
@crossrulz: I can definitely see the advantage of using the plot visibility checkbox. It'll simplify my code but after trying it I remember why I'm using buttons. When you use the plot visibility checkbox feature, the entire plot disappears when you uncheck a box but with buttons, the plot continues but new data stops going to the chart so you could click and unclick the buttons and it would show those gaps on the graph. The reason I'm using a chart is because I'm using dummy data at the moment. This VI is actually going to be used with real-time data so I think a chart would be better for that, right? Also, I was using transpose 2D array before but altenbach suggesetd that I use autoindexing for loops around my build array nodes which simplied the code.
Also, the reason for the while loop is because I want to continuously check for new data. I want it to refresh and show new data every half second or so.
11-13-2014 01:40 PM
Thanks Jeff but I don't understand why you're using the history property. How is that better than sending the data to a chart? Can you please explain what you did?
11-13-2014 01:40 PM - edited 11-13-2014 01:51 PM
@rhupd wrote:
Also, I was using transpose 2D array before but altenbach suggeseted that I use autoindexing for loops around my build array nodes which simplied the code.
You must have misread something!
For the constant data wiring the chart history simplifies validating the code- switch it back when you have live data.
11-13-2014 01:43 PM
Sorry, I think was using transpose for a matrix, not the one for arrays. Maybe I misunderstood what he said....I have to go back and read it again. It was helpful though; helped me tidy things up.
11-13-2014 02:10 PM
@JÞB wrote:
@rhupd wrote:
Also, I was using transpose 2D array before but altenbach suggeseted that I use autoindexing for loops around my build array nodes which simplied the code.
You must have misread something!
For the constant data wiring the chart history simplifies validating the code- switch it back when you have live data.
It depends if you want to merge the original arrays as columns or rows when building the 2D array. In the scenario here, a FOR loop around "built array" is equivalent to using a plain build array followed by a transpose. No matter how we process it later, we need the correct arrangement.
I don't understand your chart history stuff either. How would that help validating?
11-13-2014 02:26 PM - edited 11-13-2014 02:26 PM
Of course everything can be done in one loop stack (note that the boolean array autoindexins on the inner loop).
For exampe this code fragment works just fine.
11-13-2014 02:42 PM