From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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. 🐵

 

 Booooooleans.png

 

Message 2061 of 2,571
(12,103 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

0 Kudos
Message 2062 of 2,571
(11,916 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,571
(11,767 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

Message 2064 of 2,571
(11,685 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

0 Kudos
Message 2065 of 2,571
(11,676 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... 😄

Message 2066 of 2,571
(11,481 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! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 2067 of 2,571
(11,296 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


"Should be" isn't "Is" -Jay
0 Kudos
Message 2068 of 2,571
(11,224 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

 

Message 2069 of 2,571
(10,964 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

Message 2070 of 2,571
(10,913 Views)