BreakPoint

取消
显示结果 
搜索替代 
您的意思是: 

Rube Goldberg Code


Ray.R wrote:  I'm sure some delay value should be wired to the input.

And even a dely of 0ms has an effect.  It causes the thread to release so the CPU looks for other actions to take眨眼表情


"Should be" isn't "Is" -Jay
0 项奖励
641 条消息(共 2,635 条)
12,490 次查看

Ray.R wrote:

Not sure what the intent of the code is or why the TRUE constant Boolean.  There's no need for the Exclusive OR when using a TRUE constant.

Let's not mention the fact that the loop may run once or forever depending on the initial value for sensor.  I always use Express VI's, I'm lovin it. They have increased my Labview skills by several magnitudes  


 

The Boolean gymnastic were perhaps somewhat strange. But the user have set the time delay inside the Express VI to 4 seconds. With Express VIs you click to configure. The Rube code in this was the Express VI it self. All Express VIs are Rube code. And should therefore be deleted



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
642 条消息(共 2,635 条)
12,475 次查看

I have to agree with you Coq.  (or is that M. Rouge?)

 

Just goes to show how little I've used Express VI's.  I think I tried it once and that VI died of loneliness..

 

I know I'm not the only one in this situation because 2 or 3 years ago, the Champions lost during NI week because they didn't know much about Express VI's.  LOL!

 

(did they loose?  Can't remember... but they didn't know Express VI answers)  😉

0 项奖励
643 条消息(共 2,635 条)
12,461 次查看

Ray.R wrote:

 

I know I'm not the only one in this situation because 2 or 3 years ago, the Champions lost during NI week because they didn't know much about Express VI's.  LOL!

 

(did they loose?  Can't remember... but they didn't know Express VI answers)  😉


Is it anything to know about them, beside how to delete them. Did the Champions not know that?



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
644 条消息(共 2,635 条)
12,452 次查看

Coq Rouge a écrit: 

Is it anything to know about them, beside how to delete them. Did the Champions not know that?


 

May be how to remove them from the functions palette ?

0 项奖励
645 条消息(共 2,635 条)
12,443 次查看

I was taken down a peg this morning as my potential solution lost out to some RG code.  Spotted here. (I shrank a little for snipping purposes)

 

BooleanRG.png

 

Well the snippet is allergic to locals.  The property node is a local to set the array to all false in case the first iteration is too slow.  If we vote for the idea to hide the iteration terminal it could help, no use for that in this VI  眨眼表情 .  Six case structures contain individual boolean array constants.  The OP wanted 10 LEDs, perhaps the author figured we got the idea with only 5 in this example (the idea perhaps that there must be a better way).

646 条消息(共 2,635 条)
12,434 次查看

Does Andy work for NI?  He has the blue rectangle...

 

 

647 条消息(共 2,635 条)
12,429 次查看

Ray.R wrote:

Does Andy work for NI?  He has the blue rectangle...

 

 


That exact thought passed through my mind, I think that is what made me go from taking a double-take at the code to a triple-take.  My guess is marketing or upper management.  极度高兴的表情

 

Certainly not tech support, they really saved my bacon this week so they are spared from all snide comments.

 

Actually, I have very vague recollections of reading a post once that mentioned that email address that start with '@ni' trigger the blue bars regardless of what completes the address.  Maybe that is still true.

0 项奖励
648 条消息(共 2,635 条)
12,423 次查看

I found some very nice little Rubes today, here...

 

rubes abound!.PNG

 

First of all, anyone want to guess why we're taking a 1D array (the output of DAQmx Read, N chan N samp, 1D waveform) and resizing it to a....1D array???

 

Then, we decide we'd better turn it into a cluster, then unbundle it...

 

...then we take all of our separate data arrays and format them into strings...

 

...then concatenate the strings.

 

Now let's look at that case structure.  It's the ever popular use-a-boolean-to-select-the-same-boolean-value-contained-in-the-original-wire trick!  The "true" case does the same thing, but uses a different number for the "greater or equal" comparison.

 

Now, we could have written it like this:

 

bye rubes.PNG

 

But that isn't very much fun.

 

We also could, perhaps, have used the "2D DBL" instance of DAQmx Read, and skipped all the get-the-data-arrays-out-of-the-waveforms operations, but it looks like he uses at least one of those waveforms for something else so maybe he does need them. 

0 项奖励
649 条消息(共 2,635 条)
12,225 次查看
Found in "virtual life" here
 
 Needs a Nav- WindowNeeds Nav window.png
 
 
 Comments
  • Never use unbundle for a type def cluster.  use the unbundle by name to improve readability
  • The =0 cases were not necessary at all as then you immidiatly compared to see if it was a 0x01,0x10 or 0x40. I removed them.
  • The index array function can be expanded by dragging the bottom of the icon down. It improves readability and reduces clutter.
  • Why were you using DBLs to represent a count?  I changed to U32s And I can change te representation of the indicators to make sense(hex display)  Same with the comments,  when you express a number as hex use either 0xFF or 80h to make it clear.
  • The connector pane (OUCH)!  see the differance?  use the 4:2:2:4 as a default- if you need more terminals rethink your code structure.  There arecases for more bu you really should ask "Can I do this simpler?" first.
  • Boolean Case structures that use the output of Comparision (e.g. = functions) are not self-documenting and are always rube-goldberg code!  Note that I use the value as the case selector."

Check-fxd.png
 
"Result: Code is clean compact and readable without the Navagation window"
Message Edited by Jeff Bohrer on 04-06-2010 09:28 PM

"Should be" isn't "Is" -Jay
0 项奖励
650 条消息(共 2,635 条)
12,211 次查看