LabVIEW Developers Feature Brainstorming

cancel
Showing results for 
Search instead for 
Did you mean: 

Now available for download: "Randomize 1D Array.vi" that accepts any array type

Highlighted

Attached to this post is "Randomize 1D Array.vi". You can wire any array type to the input and get that array type from the output, just like you can with the built-in Sort 1D Array function. The randomized order is guaranteed to be uniform distribution. The VI is saved in LV 2009, though the VI may have problems in a Built Application unless you have LV 2009 SP1.

I generated this VI after seeing this Idea Exchange request for such functionality.

This VI may excite those of you who have long wanted to "write a VI once for type A and have it just work for types B, C, D, etc." This is an experimental tech in R&D, and this post marks the first time a VI with this ability is generally in the wild. Unfortunately, the ability to build VIs of this type appears to be a long ways off -- it's a hard problem, especially once subVIs start getting involved. But the "Randomize 1D Array.vi" is a simple enough VI (with no subVIs) that I was able to generate it with our in-house tools. And I'm sorry to disappoint everyone -- the VI is password protected.

At the moment, we call this kind of VI a "generic VI", because the terms "template VI" and "polymorphic VI" are already taken by other features. "Generic" doesn't really say anything about what this kind of VI actually does, so if anyone has a better suggestion for these types of VIs, post them here. Keep in mind: it will be multiple versions of LV before this feature sees the light of day.

 

Note: This beta test is finished; the VIs are no longer available for download because instabilities have been identified.

Message 1 of 28
(11,623 Views)

Chameleon VI

Wirebird Labs: Expert Toolkits for LabVIEWDeploy, by Wirebird Labs: Expert Toolkits for LabVIEW
0 Kudos
Message 2 of 28
(11,621 Views)

Shapeshifter VI

Wirebird Labs: Expert Toolkits for LabVIEWDeploy, by Wirebird Labs: Expert Toolkits for LabVIEW
0 Kudos
Message 3 of 28
(11,619 Views)

Fantastic!  Not so much for the routine itself (which I'd rarely use) but for the technology.  Does this ability extend to transparently accepting arrays of multiple dimensions?

 

However, given that you're being such a tease about it all (the candy is just out of reach for several YEARS...) I wonder if you'll take other simple, no-subVI, suggestions and create "generic" VIs for them?  Most (or all) of the OpenG array VIs would fit this category, as would this routine I wrote for resampling a 1D array:

 

17383i871CCAADC89A0B0D

0 Kudos
Message 4 of 28
(11,609 Views)

I want it!!!! Smiley Happy

JKI Blog
0 Kudos
Message 5 of 28
(11,606 Views)

Agreed, the random array, whoop-de-doo, but a Chameleon VI? That's stellar.

 

Spoiler
I'll admit, as soon as I downloaded the VI, I did a search for "VI password crack".... Smiley Surprised ...but to no avail. I'm sure AQ is smarter than releasing "into the wild" with a 3 character brute-force-approved password Smiley Sad Smiley Tongue 

Wirebird Labs: Expert Toolkits for LabVIEWDeploy, by Wirebird Labs: Expert Toolkits for LabVIEW
0 Kudos
Message 6 of 28
(11,595 Views)

I may or may not speak for others when I say, "Screw SubVIs".  If I could do this for even simple VIs I'd be very excited.  I'll wait years for the full-blown version, but this is too good to sit on for that long.

0 Kudos
Message 7 of 28
(11,594 Views)

I poked around...  If you look in the LabVIEW Data folder, you'll find an lvgen file for Randomize 1D Array.  This file can be opened in the LLB browser and shows all of the instance VIs.  It appears that the LabVIEW editor is creating a copy of the original VI for every type wired in (and keeping them in this LLB).  The hash in the instance name is probably an MD5 of the type descriptors, or similar.

JKI Blog
Message 8 of 28
(11,591 Views)

I am unable to post the VI, but here are the results from a validation I performed on the probability distribution of the randomness. Apparently, the function is very sensitive to order, and certain starting element indices have strong tendencies to appear or not appear in a given resultant index. See below:

 

17389iEB7BF18436D63219

And here are the results:

 

17391i39AF232DF6B9576A

 

Breakdown: First result shows the last element in original array is extremely likely to end up in the first index, the middle graph is a representative that all three middle indices will never end up in the first index of the result, and the final graph shows that the first element properly will randomly appear in any one of the five resultant indices.

Wirebird Labs: Expert Toolkits for LabVIEWDeploy, by Wirebird Labs: Expert Toolkits for LabVIEW
Message 9 of 28
(11,579 Views)

Typeshifter VI

Adapt-to-Type VI

Type-adapting VI

Type-adopting VI

Type-altering VI

Type-assuming VI

Type-assimilating VI

Type-absorbing VI

 

...and the like.

Wirebird Labs: Expert Toolkits for LabVIEWDeploy, by Wirebird Labs: Expert Toolkits for LabVIEW
0 Kudos
Message 10 of 28
(11,576 Views)