BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code

Seen here:

https://decibel.ni.com/content/docs/DOC-13641

 

image_png.png

 

Is it really too much to ask that the NI developers writing these functions actually LOOK at the comparisson palette when they open it?

 

notequal.png

Come on - really!! - makes you wonder what the dll is like inside doesn't it?

 

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
Message 901 of 2,571
(11,021 Views)

What would possess somebody to take a simple scalar, turn it into an array with a single element, integrate the single element array using simpsons rule, then index out the single element at the end???

 

 

 

(Seen here)

0 Kudos
Message 902 of 2,571
(10,929 Views)

I don't know what the top code does, but multiplying by 2 and then dividing by 30 also seems Rube'd... 😉


___________________
Try to take over the world!
Message 903 of 2,571
(10,916 Views)

You got me there! I simply did not want to multiply by typing  0.06666666666666666666666666666666666666666666666666... . 😄

 

(of course I could have divided by 15 instead).

 

(The weird simpson scaling is not appropriate for an array with a single element. A multiplication by 0.1 is probably what's really needed here)

0 Kudos
Message 904 of 2,571
(10,912 Views)

Did I create a Rube Goldberg, or is there a better way of doing the following?

I want to extract the lower 16 bits of a number. 

 

Ignore the extra indicator in the code snippet.  It is the residue of a probe while converting to snippet.

 

 

 

I am replacing the lower 16 bits with zeros and then taking the difference.  The result are the lower 16 bits.

It's been an extremely long week and my brain has slowed down.  I seem to recall that there was an easier way of doing this, but I just can't access those braincells.

Message 905 of 2,571
(10,868 Views)

@Ray.R wrote:

Did I create a Rube Goldberg, or is there a better way of doing the following?

I want to extract the lower 16 bits of a number. 

 

Ignore the extra indicator in the code snippet.  It is the residue of a probe while converting to snippet.

 

 

 

I am replacing the lower 16 bits with zeros and then taking the difference.  The result are the lower 16 bits.

It's been an extremely long week and my brain has slowed down.  I seem to recall that there was an easier way of doing this, but I just can't access those braincells.


yes, you did  RG

Yes rube.png


"Should be" isn't "Is" -Jay
0 Kudos
Message 906 of 2,571
(10,857 Views)

You could also use the To Unsigned Word Integer (U16). You'd get a coercion dot to move up to I32, but in this case who cares.

Message 907 of 2,571
(10,851 Views)

a few ways to skin the cat

Yes rube.png


"Should be" isn't "Is" -Jay
Message 908 of 2,571
(10,844 Views)

@Jeff Bohrer wrote:

a few ways to skin the cat


Yeah. I just assumed there was a reason for the indicator being an I32.

 

Ray: is there something more going on?

0 Kudos
Message 909 of 2,571
(10,840 Views)

The problem with "split number" is the change from I32 to U16, changing the representation. Here's what I would do:

 

 

Message 910 of 2,571
(10,831 Views)