BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code


@altenbach wrote:

Here's one way to determine if the current code is run as executable (seen here).

 

 

isexe.png

  

Also that uninitialized shift register would be problematic if run more than once during a session.

 

I am pretty sure there is a better way!


Also this property node might come in handy http://zone.ni.com/reference/en-XX/help/371361H-01/lvprop/app_appkind/

0 Kudos
Message 1951 of 2,571
(11,040 Views)

(seen here)

 

So we hav a handful different files in the same folder ("1.lvm" ... "5.lvm") and would like to append rows according to the value in the first column.

 

Apparently we need five basically identical cases, differing in a single character (!!) in some path diagram constant (top image).

 

... or we could just eliminate the case structure entirely (bottom).

 

SortToFilesRube.png

 

0 Kudos
Message 1952 of 2,571
(11,015 Views)

(seen here)

 

Carnac the magnificient says:  "TRUE & TRUE"

 

... and the question was: "Is it possible to predict the value of the LED without even running the VI, and if so, what is its value?"

 

TheTruthwWillComeOut.png

 

In fact an easier solution would be to just paste a picture of a lit LED on the front panel. No code needed. 😄

Message 1953 of 2,571
(10,951 Views)

@altenbach wrote:

(seen here)

 

Carnac the magnificient says:  "TRUE & TRUE"

 

... and the question was: "Is it possible to predict the value of the LED without even running the VI, and if so, what is its value?"

 

TheTruthwWillComeOut.png

 

In fact an easier solution would be to just paste a picture of a lit LED on the front panel. No code needed. 😄


But we can not be sure. What if there are two controls labeled "TT section" ?

 

Echoing a common theme these days, "show us the rest of the code".

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 1954 of 2,571
(10,926 Views)

@Ben wrote:

@altenbach

But we can not be sure. What if there are two controls labeled "TT section" ?

 

 


True in a vacuum, but I checked that before posting. The link has the code and there is only one control with that name. Both equally named locals point to the same control.

 

Of course if the control changes right between reading the first and second instance of the local variable, we could get unusual results due to race conditions, but my gut feeling is that this is very unlikely. 😄

 

Maybe we could give these kind of algorithms the name "Hamlet code". 😮

0 Kudos
Message 1955 of 2,571
(10,901 Views)

I wanted to ask about race conditions, but I wasn't sure if the compiler would ensure the two locals were read simultaneously.

 

Obviously not... it doesn't even take very long on my computer. Sometimes it even stops with Producer=0.

Example_VI.png


GCentral
Message 1956 of 2,571
(10,867 Views)

I know this is the Rube Goldberg Code forum, but doesn't this prove it as well?

Boolean stop.png

Clicking once or twice stops the loop.

 

In a realistic loop it won't happen that fast obviously. Adding a 1 ms wait makes it almost (I did not succeed, but gave up after 20 times) impossible to stop the loop.

 

So it's not RGC at all! It is in fact a (unintentional) "you have to click often and fast" detection...

0 Kudos
Message 1957 of 2,571
(10,845 Views)

Now you make it seem like the original was completely reasonable, and mine is the REAL Rube Goldberg code... You reproduced it in much less code!


GCentral
Message 1958 of 2,571
(10,825 Views)

@cbutcher wrote:

Now you make it seem like the original was completely reasonable, and mine is the REAL Rube Goldberg code... You reproduced it in much less code!


Ah, you picked up on that...Smiley Embarassed

0 Kudos
Message 1959 of 2,571
(10,809 Views)

@cbutcher wrote:

Now you make it seem like the original was completely reasonable, and mine is the REAL Rube Goldberg code... You reproduced it in much less code!


Face Palm moments happen 


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