BreakPoint

cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Rube Goldberg Code

Highlighted

(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. ๐Ÿต

 

 Booooooleans.png

 


LabVIEW Champion. It all comes together in GCentral GCentral
Message 2061 of 2,119
(1,435 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. ๐Ÿ˜„

 

fract.png


LabVIEW Champion. It all comes together in GCentral GCentral
0 Kudos
Message 2062 of 2,119
(1,248 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,119
(1,099 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. It all comes together in GCentral GCentral
Message 2064 of 2,119
(1,017 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. It all comes together in GCentral GCentral
0 Kudos
Message 2065 of 2,119
(1,008 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. ๐Ÿ˜ง

 

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"! ๐Ÿ˜ฎ

 

Not sure how much additional information we can glean from it, though... ๐Ÿ˜„


LabVIEW Champion. It all comes together in GCentral GCentral
Message 2066 of 2,119
(813 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,119
(628 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

0 Kudos
Message 2068 of 2,119
(556 Views)

(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. It all comes together in GCentral GCentral
Message 2069 of 2,119
(296 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. It all comes together in GCentral GCentral
Message 2070 of 2,119
(245 Views)