BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code


@altenbach wrote:

 


SteveChandler wrote:

Capture.PNG


My mama always said you should also add a "quit LabVIEW" primitive to make triple sure things come to an end.

 


 

Especially in a subVI or FGV!!!Smiley Very Happy

 

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 791 of 2,571
(11,208 Views)

A simple question about boolean logic brings the monsters out of the woodwork!!! 😮

 

Have a look at this answer.

 

Do we really need:

 

  • code the size of a postcard
  • two boolean to 0,1
  • a five line formula node
  • a case structure with three cases
  • four boolean diagram constants (The max you ever need on a single diagram is two! ;))
  • two local variables
  • to leave out a wait to make sure it runs really, really fast.
(A possible code alternative is shown in the inset. It is an alternative for the code shown here, not to answer the original question of the other thread, of course.)

 

 

Message 792 of 2,571
(11,151 Views)

Dennis finds a way of simplyfing a basic string parsing task.

 

From this

 

 

to this

 

 

 

Spotted here: http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/Parsing-data-from-a-serial-string/td-p/142365...

Message 793 of 2,571
(11,086 Views)

 


SteveChandler wrote:

Capture.PNG



You mean this come actually came out of something that was posted in the forum?

 

0 Kudos
Message 794 of 2,571
(11,069 Views)

 


@Ray.R wrote:
You mean this come actually came out of something that was posted in the forum?

 


 

 

It was not found in the wild.

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


0 Kudos
Message 795 of 2,571
(11,023 Views)

I'm speechless

0 Kudos
Message 796 of 2,571
(11,018 Views)

"Fourier extrapolation" sounds soo cool :o!

 

Let's look at the self accepted solution that does it!!

 

Of course it does not add anything useful over a simple repertitive append of the same data.

 

The rube goldberg construct is on top in red, a possible simple alternative is shown in green below. Anything else being equal, I'd probably go with the bottom solution. 😄

 

Message 797 of 2,571
(11,003 Views)

My brain is not working efficiently this morning.  I know there's a more elegant way of doing the Rube code below, but I just can't see it.  I thought of converting it into an array, but could not see it being any better than the code below.  I also thought of converting to bytes and then converting the endian, but that would flip each character, which is not what I want.

 

Okay.. here's the deal.  I want to flip every 2 character within a string, similar to converting little to big endian.  The string can vary in length as a multiple of 2.  There are no spaces in the string.. AND when converting the string, it needs to respect / maintain double-zeros '00'.

 

I did try the Scan Value function and converted it to U8, to an array and back to string, but then there are white spaces between the characters and zeros become single zeros...  So nothing yet more elegant...  I'm not going to show the messy other attempts 😉

 

 

Message 798 of 2,571
(10,931 Views)

Regex, regex, regex...

 

RayRString.png

Message 799 of 2,571
(10,922 Views)

Capture.PNG

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


Message 800 of 2,571
(10,904 Views)