BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code

(seen here)

 

If the programming technique is to add more and more code (and never delete anything) until the output is as expected, we would get something like that:

 

(Six scalar booleans to six arrays with one element each to six dynamic data wires, joined into one dynamic data wire and transformed back to a boolean array with six elements. Smiley Surprised)

 

 Booooooleans.png

 


LabVIEW Champion Do more with less code and in less time
Message 2061 of 2,070
(1,235 Views)

(Seen here)

 

A circuitous odyssey from "array of DBL" to "array of strings" via one long string and some meaningless second format statement:

Capture3.PNG

 

Could be replaced by a single primitive. Smiley Very Happy

 

fract.png


LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 2062 of 2,070
(1,048 Views)

Worse than the classic bundle cluster to array dance because it is an index array, to bundle cluster, back to array Cha-Cha.

Also, just before this some extra code to take any incoming waveform array and delete is all, so that you can be sure to append new arrays to an empty array.

 

Seen here.

 

PowerMonitoring-1_BD    PowerMonitoring_BD

 

0 Kudos
Message 2063 of 2,070
(899 Views)

If two functions are near each other (GCD here), it is likely that they can be combined into a single instance. Always worth looking for that possibility:

 

smallerGCD.png


LabVIEW Champion Do more with less code and in less time
Message 2064 of 2,070
(817 Views)

Having a boolean labeled "Start Stop" and some loop termination depending on it set to "stop if true", some set to "continue if true" and some having a "not function" in the wire right before the condition certainly does not result in code that can easily be understood.

 

(seen here)

 

parallel while loop.jpg


LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 2065 of 2,070
(808 Views)

(seen here)

 

One might argue that the VI is perfectly fine, no broken run arrow, no race condition, no excessively complicated code, but for lack of a better place I'll discuss it here anyway. D:

 

Quote: It's an assignment for my final project, so I am not allowed to share the VI. Hope someone can help anyway."

 

... and thus I am attaching a completely empty VI and even name it "empty.vi"! Smiley Surprised

 

Not sure how much additional information we can glean from it, though... Smiley Very Happy


LabVIEW Champion Do more with less code and in less time
Message 2066 of 2,070
(613 Views)

Quite a roundabout way to connect a boolean to a case. Seen here:

https://forums.ni.com/t5/LabVIEW/Save-data-continuously-from-loop/m-p/3939645/highlight/false#M11200...

Boolean Rube.png

/Y

G# - Award winning reference based OOP for LV, for free! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
Message 2067 of 2,070
(428 Views)

@Yamaeda wrote:

Quite a roundabout way to connect a boolean to a case. Seen here:

https://forums.ni.com/t5/LabVIEW/Save-data-continuously-from-loop/m-p/3939645/highlight/false#M11200...

Boolean Rube.png

/Y


It's an If Than else!  The construct was once proposed as a new structure years ago... that got shot down.  It does not happily work in a dataflow paradigm...... unless you have a vim

Always maintain an accurate count of deployed mousetraps.
0 Kudos
Message 2068 of 2,070
(356 Views)
Highlighted

(seen here)

 

With the belief that the more code you add, the more correct it gets, her's how that'll turn out:

 

detour.png

 


LabVIEW Champion Do more with less code and in less time
Message 2069 of 2,070
(96 Views)

If you really want to avoid as many wires and shift registers as you can, a few value property nodes and sequence frames might fit your need. Ouch! (seen here)

 

 

AlmostNoWires.png


LabVIEW Champion Do more with less code and in less time
0 Kudos
Message 2070 of 2,070
(44 Views)