BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code

I have the gut feeling that this can be simplified significantly 😄

 

 

(seen here)

Message 991 of 2,571
(11,711 Views)

I may as well start posting the Rubes that I've been fixing along the way.  Imagine spending each day for the past month fixing Rubes and other non-sense.  I'm at the point where I think the enhanced code has Rubes of its own... 😛

 

This one concatenates the bits to create a word which is written to a register.  Hundreds of variations of this one.  There's a few which had these values concatenated to each other by passing the value (output) to param1.  Imagine this sub-vi creating a 16-bit word where is concatenates 2 bits at a time!

 

The top right solution circled in red replaced the rest of the code.

 

 

0 Kudos
Message 992 of 2,571
(11,643 Views)

The funny part is that this one is a sub vi where the person goes to the trouble of selecting 1 out of 4 constant strings and converts it into 4 ASCII parts only to recombine into a U8 array.

 

There's an app for that..  It's called "String to Byte Array". 

 

Code is full of things like this.  I could spend my days posting RG's...  Even retire by doing so..  but I'm sure there's better things to do upon retirement than posting RG's.  😉

 

 

 

 

0 Kudos
Message 993 of 2,571
(11,634 Views)

@Ray.R wrote:

The funny part is that this one is a sub vi where the person goes to the trouble of selecting 1 out of 4 constant strings and converts it into 4 ASCII parts only to recombine into a U8 array.



Well, the lower part might be 4x faster on a quad CPU, because all four conversions can execute in parallel. 😄 (Just kidding!)

0 Kudos
Message 994 of 2,571
(11,625 Views)

I can imagine that one didn't notice that there was allready something for that...   

What I don't understand is why people don't make a vi when they create the same code multiple times.  I allready do that when I would use code twice!

0 Kudos
Message 995 of 2,571
(11,617 Views)

Example_VI_BD.png

 

I don't get the thing with the array at all. It could be something left over from a code-n-fix spree.

=====================
LabVIEW 2012


0 Kudos
Message 996 of 2,571
(11,541 Views)

@Steve Chandler wrote:

Example_VI_BD.png

 

I don't get the thing with the array at all. It could be something left over from a code-n-fix spree.


I do that sometimes, to make the wire thicker so it can carry more current. You normally see this on longer wire lengths than the one shown. Highy recommnded for the green wires (ground). 

Richard






Message 997 of 2,571
(11,535 Views)

@broken Arrow wrote:

@Steve Chandler wrote:

Example_VI_BD.png

 

I don't get the thing with the array at all. It could be something left over from a code-n-fix spree.


I do that sometimes, to make the wire thicker so it can carry more current. You normally see this on longer wire lengths than the one shown. Highy recommnded for the green wires (ground). 


 

But don't you run the risk of creating ground loops?

Message 998 of 2,571
(11,522 Views)

smercurio_fc wrote:

But don't you run the risk of creating ground loops?


Did you even bother to read the manual? Ground Loops are the loops placed toward the bottom of the wiring diagram.
For my next Micro-Nugget, I'll be discussing using multiple Not gates in parallel to boost power in Boolean wires.

 

Richard






Message 999 of 2,571
(11,517 Views)

To take the average for each column of a 2D array apparently needs a huge scaffold of arrays and complicated integer operations that always result in a plain zero (Top of image). A possible code alternative is shown below it.

 

(seen here

 

 

Message 1000 of 2,571
(11,509 Views)