BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code


@alexderjuengere wrote:

Why is there a timeout case that can never happen?

- because, I don't want any timeout effects, can it be removed?


Yes.  Just delete the event case.

 


@alexderjuengere wrote:

Why aren't the buttons latch action?

- because you can't use local variables with that mechanical action


Do you actually need the Local Variables?  You've been around long enough to know you should avoid them.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2581 of 2,593
(950 Views)

I somehow missed that this discussion was in the RG thread. I was looking for the link to the quote thread.... 🙂

Message 2582 of 2,593
(943 Views)

wiebe@CARYA wrote:

@Henrik_Volkers wrote:

@altenbach wrote:

In a nutshell, we basically have a 2D boolean array to be turned into a single boolean according to some rules.

 

I have that nagging feeling that this could be simplified somewhat. 😄 (seen here)

 

 

altenbach_0-1717609209654.png

 

 

 


shiftregisters and one OR 🙂   just keep the boolean information (edit: first SR init to false 😉 )


Put the indexing on Last Value, and make it conditional:

 

wiebeCARYA_0-1717681449044.png


Nest auto indexed loops and Just enable the loop conditional terminals and STOP THE LOOPS when the first TRUE occurs. Output last value. 

 

Better yet: there should be a way to use recursion for this and scale it for n dim array where n is known only at runtime (Xnode, vim maybe?  I'd have to play)  just OR each autoindexed element with the previous result on a FBN. NOTE the nth+1 dimension loop will execute 0 times returning the default output F to the nth loop, so the whole dang thing stops on the first T in any dimension

for dimensions (n to 1), n--


"Should be" isn't "Is" -Jay
0 Kudos
Message 2583 of 2,593
(880 Views)

@JÞB wrote:
Nest auto indexed loops and Just enable the loop conditional terminals and STOP THE LOOPS when the first TRUE occurs. Output last value. 

Sometimes this is fine, but not always. In the original code, a lot of other things occur in the loop, including file writing and an inner FOR loop doing DAQ. I cannot tell if stopping early would be correct in that scenario. (I might study it if the code were cleaner, but there are too many hairballs... 😄 )

0 Kudos
Message 2584 of 2,593
(871 Views)

@altenbach wrote:

@JÞB wrote:
Nest auto indexed loops and Just enable the loop conditional terminals and STOP THE LOOPS when the first TRUE occurs. Output last value. 

Sometimes this is fine, but not always. In the original code, a lot of other things occur in the loop, including file writing and an inner FOR loop doing DAQ. I cannot tell if stopping early would be correct in that scenario. (I might study it if the code were cleaner, but there are too many hairballs... 😄 )


Oh, I assumed modular code.  Silly me.

 

So much for just sorting and testing the default (last) element output of delete from array 😞 as an OR Array Elements replacement.   HMMM. I wonder if there is any case where that could be faster than OR Elements. Certainly either would be simpler than the example shown.   That "=0, Negate" bothers me when "≠0" is right there. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 2585 of 2,593
(863 Views)

Logging four scalar (!) values to a file every 10 seconds apparently needs conversion to arrays, to dynamic data,  a diagram full of express VIs and a handful of local variables. (seen here)

 

altenbach_2-1722017396126.png

 

 

Message 2586 of 2,593
(641 Views)

I am not sure where the OP dug out that old example, but turning a 1D array into a 2D array with one column does NOT need a formula node!

 

Seen here

 

altenbach_0-1722487197225.png

 

Message 2587 of 2,593
(557 Views)
Message 2588 of 2,593
(139 Views)

@altenbach wrote:

Sometimes I feel evil. 😄


X(radians)+pi?  Aren't there 2pi radians in a circle?  I'm sure you can find a complex solution that fits on a postage stamp (of course that might be a postage stamp that calls itself reentrantly)


"Should be" isn't "Is" -Jay
0 Kudos
Message 2589 of 2,593
(93 Views)

@JÞB wrote:

@altenbach wrote:

Sometimes I feel evil. 😄


X(radians)+pi?  Aren't there 2pi radians in a circle? 


That pi gets subtracted again later. It just makes sure that the remainder is mapped into -pi..pi instead of 0..2pi.

0 Kudos
Message 2590 of 2,593
(87 Views)