BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code


@Ben wrote:

Type cast


I was just starting some ....and poof .John Crapper shows up

 

For those of you Googling now, mr. Crapper invented the flush toilet.


"Should be" isn't "Is" -Jay
0 Kudos
Message 2271 of 2,565
(9,005 Views)

Can anyone guess what's in the TRUE case??? (Same, just with a FALSE diagram constant!)

 

 

altenbach_0-1618847874509.png

 

Message 2272 of 2,565
(8,932 Views)

Getting the bits from an integer seems to require a lot of code. I am sure there is a one-liner solution 😄

(seen here)

 

altenbach_0-1618945482076.png

 

Message 2273 of 2,565
(8,885 Views)

Not quite a one liner but one Boolean AND per boolean output would work perfectly. Alternatively you could convert it in an array of booleans and then use Index Array, but I'm not so fond of that solution as it is damn easy to mix up the indices, kind of difficult to verify (counting Index Array terminals and translating them to bit position and back is always a chore, error prone and needs to be done every time again when you want to debug and verify the code) and not really less work. The solution with translating it then to a cluster as suggested by cbutcher avoids some of those problems but only if you don't have to many "holes" in the booleans.

 

And if I program for FPGA, the Boolean AND is definitely THE solution. Anything else will tend to use more resources.

Rolf Kalbermatter
My Blog
0 Kudos
Message 2274 of 2,565
(8,837 Views)

Perhaps to Bool Arr and then Array to Cluster with the appropriately ordered fields?

Renumber cluster elements neatly shows their indices.

In this case you'd need a couple of dummy elements for the unused bits, but perhaps still a reasonable solution?


GCentral
Message 2275 of 2,565
(8,832 Views)

@cbutcher wrote:

Perhaps to Bool Arr and then Array to Cluster with the appropriately ordered fields?


Yes, that was my one-liner idea. I actually made a draft yesterday but did not post it.

Message 2276 of 2,565
(8,816 Views)

Hmm, how do I get the array size. Like this I guess:

thols_0-1620194862394.png

 

Certified LabVIEW Architect
Message 2277 of 2,565
(8,694 Views)

And, how to get the maximum value of an array:

thols_0-1620195133833.png

 

Certified LabVIEW Architect
Message 2278 of 2,565
(8,687 Views)

@thols wrote:

Hmm, how do I get the array size. Like this I guess:

thols_0-1620194862394.png


The for loop is ridiculous of course.

 

The array to cluster + unbundle has the advantage of being 'vertically friendly'.

 

It might grow on me 😊.

 

Array Size With Unbundle.PNG

(Note that I do not need this a lot)

 

0 Kudos
Message 2279 of 2,565
(8,672 Views)

wiebe@CARYA wrote:

@thols wrote:

Hmm, how do I get the array size. Like this I guess:

thols_0-1620194862394.png


The for loop is ridiculous of course.

 

The array to cluster + unbundle has the advantage of being 'vertically friendly'.

 

It might grow on me 😊.

 

Array Size With Unbundle.PNG

(Note that I do not need this a lot)

 


Bah!  If that's what you're going for, don't RG it. Just make a malliable VI 🙂

 

BowenM_2-1620246668092.png

 

 

 

Message 2280 of 2,565
(8,636 Views)