02-09-2008 01:33 PM
02-09-2008 01:43 PM
California wrote:As a corollary, is there a way to keep the x-axis waveform chart scale from updating each time I run the VI? In other words, I want it to stay at 1 to 100, rather than incrementing to 100 to 199, then 200 to 299, etc, each time I run the VI.
02-09-2008 02:22 PM
02-09-2008 03:26 PM
Hi California,
if you want that the chart every time you run the vi, starts with 0 you have to clear the history first. To do that, create a property node of the chart, select "History Data" and connect an empty array to it. Arrange it in this way, that it runs before you write new data to the chart.
Is it what you want?
Mike
02-10-2008 08:35 PM
02-20-2008 02:43 PM
All right, in the absence of any other suggestions, I found a way to put 100 test readings neatly on a one-page front panel. This is how I did it: I put five 1D numeric indicator arrays on the front panel. I used a case structure and some numeric comparison functions to monitor and sort the iteration count of the for loop on the block diagram. So iteration numbers 0 thru 19 went to the first indicator array, 20 thru 39 went to the second, etc. Then, I used the scroll bar in each of the front panel indicators to scroll to the 20 active cells in each one, and then hid the scroll bars.
I took it a step further and created a numeric constant array to assign target values for each reading. Then I added a couple of controls to allow an adjustable amount of deviation up or down from the ideal curve. I compare each test reading with the min/max limits, and another case structure sorts results into columns using the iteration count. So now, the front panel displays a graph with three plots: actual, high limit, and low limit. It also displays five columns of 20 readings, and five more adjacent columns that say OK, LOW, or HIGH, and a PASS or FAIL indicator that simply indicates whether any readings are out of spec.
02-20-2008 02:56 PM
Why don't you attach your VI instead of long paragraphs of descriptions. 😉 It is much eaier to make suggestions if we can look at something.
I would use a graph instead of a chart, it is more leightweight. Use an array fixed at 100 elements. Fill it with NaN to clear the graph and replace elements with real data as it arrives, keeping track of the insert index. This ensures that everything happens "in place" in memory.
To display a long 1D array, you can reshape it to a 2D array (optinally transpose it) and display it either directly or as a table. No need for all that song and dance with multiple indicators and scroll positions.
02-20-2008 04:57 PM
02-25-2008 06:07 PM
Thanks for the feedback. I didn't know attachments were OK but it makes sense that they are. Unfortunately the latest revision of my VI has three subs, so I'll attach those in a follow up post. Here's the main VI. The front panel has the look I need, but it wouldn't surprise me at all if the block diagram is a convoluted mess. One trouble I've had with 2D arrays generated from nested for loops is that then chart ends up with five plots from 0 to 19 instead of one plot from 0 to 99.
02-25-2008 06:08 PM