03-13-2017 09:04 AM - edited 03-13-2017 09:06 AM
Sorting a 1-D array is the theory as to what this person is trying to do. A huge VI with 1024 constants all explicitly created, the corresponding wires and a subVI. Really no way to display this, so look at the image relative to the navigation window.
The wire organization is pretty remarkable.
03-13-2017 10:08 AM
If it makes you feel any better I previously answered one of their questions about scripting an inplace element structure so the whole thing is likely scripted.
03-13-2017 10:40 AM
You must've done a good job answering that question because they must've put together a pretty good script.
If only their "logic" skills matched their scripting skills. (As in, is it logical to be doing something this way?)
03-14-2017 05:22 AM
Aah, Dark Star. Great film.
03-21-2017 10:06 PM - edited 03-21-2017 10:06 PM
User apparently never saw build array. Instead uses Initialize Array to create a 0 element 0 array (but proceeds to comment it saying it is a 1 element array ??). Then uses Insert Into Array to put new elements at the beginning of the empty array. And for good measure, let's just index out one of the elements we just put in.
03-21-2017 10:58 PM - edited 03-21-2017 10:59 PM
This person has heard of Build Array, but apparently only knows how to build onto the front of the array and stores it in a shift register. So they need to flip the 1-D array. Then take the i-th element of that flipped array, which would happen to be the same value the just put into the array.
Seen here. http://forums.ni.com/t5/LabVIEW/GPIB-to-RS-232-Transition/m-p/3600633/highlight/false#M1008961
04-06-2017 01:56 AM - edited 04-06-2017 01:57 AM
Haven't seen that in a while (seen here).
A picture tells 50%, but you can probably guess what's in the FALSE case ....
Yes, its a FALSE diagram constant, nothing else. 😄
I wonder what would happen of we would remove the entire case structure and just leave a plain boolean wire. The code would work exactly the same.
04-12-2017 12:21 AM - edited 04-12-2017 01:54 AM
The attached VI at the above link is a goldmine for Rube Goldberg code. Just study it an you'll get a "shakes head" moment every couple of seconds. 😄
Anyway, there are three inner while loops and all use the same stopping mechanism as follows. To process all rows (+1), we index into the 2D array using the iteration terminal and stop the loop if an empty array is returned as row because we have run out of rows. Here's a small fragment.
05-22-2017 06:01 PM
I found this interesting bit in some legacy code today. We have a bunch of this type of construct floating around, since this code was written before the event structure was introduced, but I don't remember seeing it used with one item, or without polling button presses.
The typical usage pattern is more like this.
05-23-2017 07:52 AM
That was THE way to do it prior to the event structure. "Catching" the button punch was actually a challenge. I actually had re-use code to support the button to state conversion. I re-used it once and then the Event Structure was introduced. Imagine polling the user interface...
We have come a long way baby.
Ben