01-02-2014 11:20 AM
Sometimes the "Make Current Values Default" causes a lot of unecessary data to be stored on the front panel. This shortcut makes it easier to empty arrays, saving lots of tedious clicking and context menu searching.
Alternatively, you can hold down shift, and all front panel arrays will be cleared. There is also the option to select array constants on the block diagram for clearing (but no clear all on the block diagram.... that's dangerous)
The shortuct is saved in LabVIEW 2011.
04-01-2014 02:18 PM
Great function, but it only works on 1D arrays. Is there going to be an update to handle multi-dimension arrays?
04-01-2014 03:21 PM
I updated the shortcut to work for arrays of multiple dimensions.
04-01-2014 03:28 PM
Ah, beat me to the punch. Fortunately you implemented the exact same way I was going to.
Thanks
04-01-2014 03:29 PM
Alex5 wrote:
Fortunately you implemented the exact same way I was going to.
Yeah, I tried to come up with a more generic clever way to generate the arrays of empty (default) values, but ended up going with the simple brute force approach.
04-02-2014 01:53 AM
I didn't check it on the shortcut, but this code seems to return the default value for the data type and I would say you can't get much more generic:
Of course, you have to clear or ignore the error.
04-02-2014 02:09 AM
Actually, I should probably have checked it before posting. It looks like it just returns an empty variant. Here's something that does work:
I'm not 100% sure that dimensions of size 0 are the same as empty in this context, but I'm assuming it is. Maybe someone can check that.
04-02-2014 11:11 AM
Nice one, Yair. This is the approach I thought about taking, but then I was worried about using a non-default value from the original array. But then this morning (before I saw your post), I remembered that the VariantDataType VIs wipe out value information as they parse and set type info in the variant, so the approach would work after all.
Re: the Size value, I'm pretty sure that if the Type enum for a given Array Length is "Variable", then the Size value is ignored. The Size value only applies if you're setting an Array Length to be "Fixed" or "Bounded".
06-17-2014 11:44 AM
Now works by traversing the selected obect for all arrays, so you can select a cluster of arrays for instance, and it will clear all the arrays inside.