BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code


Cory K wrote:

Why wouldnt you just append a constant of "        "?

Well, I guess thats more colorful.


At bare minimum at least split the wire or use a tab lol 

 

0 Kudos
Message 491 of 2,600
(11,861 Views)

Cory K wrote:

Why wouldnt you just append a constant of "        "?


Well, then it would not be Rube Goldberg code and would be offtopic in this thread. :o:D

 

(read my reply in the original thread (FYP_5MOD.vi). We can do all in one formatting operation without any string manipulation at all).

Message Edited by altenbach on 06-14-2009 09:27 AM
Message 492 of 2,600
(11,855 Views)

I was getting a "MechFactoryCWrap.cpp line 956" crash under LV 8.6 (CAR#174798) when trying to trasnfer an array of waveform data type via queue from one LVOOP based template to another. The following Rube Goldberg code stopped the crashing.

 

Work_Around.JPG 

 

Smiley Surprised 

 

The code looked much better before.  Smiley Sad

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 493 of 2,600
(11,782 Views)

I was looking at some books on Google books, then I found this http://books.google.com/books?id=Ta_C5PWcw9kC&pg=PA135

I am not quite sure but is this not a very complex method?

sample.PNG

 

Message Edited by Coq rouge on 06-17-2009 04:24 PM


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 494 of 2,600
(11,765 Views)

This one is mine.......

 

In relation to forcing the output type on a Dynamic Dispatch VI. (Not REALLY a Rube-Goldberg but coming mighty close.....)

 

Load class from XML workaround.PNG

 

In firness, it does actually do something (apart from breaking the Dynamic Dispatch idea).

 

Shane.

Message Edited by Intaris on 06-17-2009 09:39 AM
0 Kudos
Message 495 of 2,600
(11,754 Views)

Coq rouge wrote:

I was looking at some books on Google books, then I found this http://books.google.com/books?id=Ta_C5PWcw9kC&pg=PA135

I am not quite sure but is this not a very complex method?


In fairness, the text indicates that it was done for speed. It's not clear which version of LabVIEW this would apply to, though, and that usually affects this kind of situation. While the cover states the book has been revised for LV 8.0, the example may be old (and I suspect it is) .

0 Kudos
Message 496 of 2,600
(11,723 Views)

smercurio_fc wrote:

Coq rouge wrote:

I was looking at some books on Google books, then I found this http://books.google.com/books?id=Ta_C5PWcw9kC&pg=PA135

I am not quite sure but is this not a very complex method?


In fairness, the text indicates that it was done for speed. It's not clear which version of LabVIEW this would apply to, though, and that usually affects this kind of situation. While the cover states the book has been revised for LV 8.0, the example may be old (and I suspect it is) .


Me thinks Smercurio_FC doth protesteth too much.  you edited the book didn't you?


"Should be" isn't "Is" -Jay
Message 497 of 2,600
(11,720 Views)

smercurio_fc wrote:

In fairness, the text indicates that it was done for speed.


Doing a meaningful benchmark on this is very (very!) difficult, because we need to make sure to avoid constant folding.

Anyway, the code shown in the book is surprisingly efficient compared to some other ideas,

but a plain string operation is still about twice as fast (code at the bottom).

 

Here are four code alternatives and the relative execution time. As you can see, it's not the best, and in contradiction

to what is said in the book, there are many buffer allocations. To be fair, I am sure the buffer allocation display

was not available when this code was written, so the author probably had to guess.

 

 

Note: There are just some quick ideas for code alternatives. I am sure there are even better ones. 😉

 

It's puzzling how slow the bitwise operation is.

 

(Still, we probably don't need to worry about speed on four bytes of data ;))

 

 

Message Edited by altenbach on 06-17-2009 10:27 PM
Message 498 of 2,600
(11,716 Views)

Two more versions:

 

Message Edited by altenbach on 06-17-2009 10:46 PM
Message 499 of 2,600
(11,712 Views)

Jeff Bohrer wrote:

Me thinks Smercurio_FC doth protesteth too much.  you edited the book didn't you?


Huh?

 

All I'm trying to point out is that you can't jump to a conclusion regarding that code, especially given the explanation that was in the book (and shown in the screenshot). Memory management and allocations have changed dramatically over the years, so what was true once may no longer be true. So what may seem like a Rube Goldberg and something completely unnecessary today may have been a necessary evil way back in the "stone age". 

Message 500 of 2,600
(11,679 Views)