09-02-2011 11:47 PM
So, while working with a "python" guru yesterday I asked:
"Did I read this right?--
IF value !=TRUE
statement1
value==FALSE
...
So, if it is false do other things and make it false again?" line 234 of main.py disappeared instantly.
The point? R-G is not LabVIEW dependant.
09-05-2011 08:30 AM - edited 09-05-2011 08:31 AM
09-05-2011 11:01 AM
@altenbach wrote:
(Maybe I am completely misunderstanding the answer here, but the question was how to run a loop indefinitely).
Q: How do you loop a problem indefinitely?
A: "Compare to infinitiy. The positive infinity block is in the numeric section. The greater than comparison is in the comparison section. Compare something to infinity and wire the output to the stop icon in the while loop found in the structures section."
Really!?
Well that should make the loop go longer because the boolean constant will eventually decay. By continuously comparing a value with infinity the programmer is taking advantage of the Quantum Zeno effect to ensure that the loop does not stop. Ever.
09-08-2011 11:50 PM
@Jeff Bohrer wrote:
@SnowMule wrote:
Doesn't get any more efficient than that. :lol3
no, it does not. write LabVIEW- post it to the forum- Christian removes all the unnecessary gyrations in your R-G code and it works. What other development enviornment has that optomizer?
Now all we need is a sub-vi to do that programatically 🙂
09-09-2011 07:39 AM
@Hornless.Rhino wrote:
@Jeff Bohrer wrote:
@SnowMule wrote:
Doesn't get any more efficient than that. :lol3
no, it does not. write LabVIEW- post it to the forum- Christian removes all the unnecessary gyrations in your R-G code and it works. What other development enviornment has that optomizer?
Now all we need is a sub-vi to do that programatically 🙂
I would settle on a Nugget by Christian Titled
"How I Approach Optimizing Code - Musing by One of the Worlds Best Wire-Slingers"
So what would it take Christian?
Can we bribe you with Kudos? Are you interested in an old "NI.com/exchange" coffee mug? Or maybe my collection of LTR publications?
Ben
09-12-2011 11:55 AM
09-13-2011 10:57 AM
It looks prettier than the AND all array elements
09-13-2011 04:15 PM
@altenbach wrote:
Interesting use for typecast, seen here. 😮
(guess it indexes out the first element)
Does index first element. I had to try
09-13-2011 05:27 PM
The autor seems to have come up with this "solution" because the case structure would not accept a boolean array at the selector terminal.
QUOTE:
"I am getting boolean array which i want to connect to case terminal of different type. So, that is the only reason i converted that 1D array to scalar value by typecast."
While the typecast function can sometimes do magic, this is the first time where it was expected to read the programmers mind and somehow process the entire array and digest it into a single boolean that somehow reflects the contents of the original array in a meaningful way. 😄
This is another one of those examples where, one at a time, a randomly selected primitive is thrown in, until the wire is no longer broken. At this point, the code must be sound. Darwin would be Proud!
09-14-2011 07:45 AM
I would never have expected that.. That's truly remarkable (or extremely lucky).
Maybe someone should suggest that the Case Structure takes boolean arrays at its input. It would automatically AND all the elements..
😉 (I had to put a smiley somewhere)