BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

Rube Goldberg Code



JeffOverton wrote:
that's not so weird Ray.  If you forget a couple characters in C or VB your comments execute inlineSmiley Very Happy


😄 Okay... 😄  yes, that is true...  well, you'd likely have the compiler complain about unrecongized commands LOL..  😄
Message 221 of 2,635
(12,296 Views)
You'd probably also have a developer complaining about a dumb compiler after spending ten hours looking for a semicolon Smiley Wink
Message 222 of 2,635
(12,287 Views)

I always use error clusters for data flow instead of sequence structures.

If the sub VI still needs to be executed though an error occured, I just pass the error in to error out without having an error case or handling it... Smiley Wink



Message Edited by Vsh on 04-22-2008 08:11 AM
0 Kudos
Message 223 of 2,635
(12,283 Views)

If the sub VI still needs to be executed though an error occured, I just pass the error in to error out without having an error case or handling it...

That's actually the standard way that NI is doing things as well.  Just check for example the 'Release Queue' or 'DAQmx Clear Task' vi.    They also run normally, even if an error occured.     Basicly, that holds true to all vi's that clean up stuff after use.   Makes sense, because you typically do want to run these vi's to properly close an application after an error.

It's even true for the 'time delay' express vi.  That was a bit surpising for me, because that's rather nasty when you use it with long time delays   (minutes or even hours....)   



Message Edited by Anthony de Vries on 04-22-2008 05:34 PM
0 Kudos
Message 224 of 2,635
(12,249 Views)

Where does this program start?  You can't tell if the wires run up, down, left, or right!

http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=318446#M318446

Message 225 of 2,635
(12,221 Views)

The problem is that he wired the Error In from the image property node to the VISA reference input of the unknown vi..  😉

 

EDITED:  now let's not get into the potential race conditions...



Message Edited by JoeLabView on 04-23-2008 01:22 PM
0 Kudos
Message 226 of 2,635
(12,236 Views)

@JoeLabView wrote:

The problem is that he wired the Error In from the image property node to the VISA reference input of the unknown vi..  😉


Well, now it's totally clear! Smiley Very Happy
Message 227 of 2,635
(12,215 Views)

If People start programming LabVIEW without any previous experience and without doing even simple tutorials or inspecting the examples, there could be interesting mental blocks, leading to some convoluted results.

Here's an interesting example where the programmer was under the false inpression that:

it is absolutely illegal for wires to cross structure boundaries!!!. 😄

  1. First we do a NOOP, writing a control to a local variable of itself! (where have we seen that before?)
  2. Then, in each case of the case structure, we read from the local variables of these controls.
  3. In the inner case, we create a 100% race condition doing a similar thing with a global variable.
  4. The "run wave" part uses an even worse alternative to (1). In one case of the case structure, the value is written to a global variable and in the other case we read from the global. Since a global is detached from the control, it is possible that the global never receives any valid data, e.g. if the other case executes exclusively.
  5. Obviously, there was a belief that if we give a global the same name as the a control, they will be linked spiritually forever. 🙂

 

 

(From http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=320058)

0 Kudos
Message 228 of 2,635
(12,122 Views)
Interesting that "Sin" is default.  I don't trust this guy...
Message 229 of 2,635
(12,121 Views)
At least it's not "CoSin" 😄
0 Kudos
Message 230 of 2,635
(12,107 Views)