LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

simple multithreading question

What did the programmer use on this you tube example to create 4 instances of the EXIT boolean used in this VI?  Are these simply local variables or am I missing something?  Here's the you tube video:  http://www.youtube.com/watch?v=dj8lyKiX9mY

 

Any help is appreciated.  Thank you.

0 Kudos
Message 1 of 5
(2,542 Views)

Sort of a silly example.  The Exit indicator wasn't used (except as an indicator),  There were three local variables, one written by the output of the Dialog box, the other two "passively" set (when the first, and the indicator, are set) to stop the two independent loops.  Note that the problem of stopping independent loops is a well-discussed item in the Forum -- the dual Local Variable solution does not usually get the highest marks.

 

BS

0 Kudos
Message 2 of 5
(2,522 Views)

Those 3 are local variables.  The original is the Exit indicator's terminal.  It is not a good example of LabVIEW programming.

 

First, the terminal is unused, it could be used in place of the local variable in the case structure.

There is no point having another local variable to be wired into the stop terminal in the left loop.  The wire coming from the indicator should go directly to the stop terminal.  In the end, you only need the indicator terminal and the local variable in the right hand loop.  However, it should have a local variable that guarantees the  Exit indicator is reset to false when the VI is run and before the loops begin.

 

It's also a bad example of moving making.  The music is annoying.  It doesn't need 17 seconds of a title screen at the beginning and about 40 seconds of slow moving widely spaced credits.  The time of the movie isn't even reported correctly.  It looks like it is 2 minutes 30 seconds long, but lasts just over 2 minutes then instantly jumps to the end.  Overall, there is only about 1 minute of useful video, useless song, and it is a poor example of multithreading and LabVIEW programming.

Message 3 of 5
(2,520 Views)

Thanks for the help.  Any idea how he made the local variables without the right click of the mouse.  He must have used a keyboard stroke.  What is the keyboard command for that?

0 Kudos
Message 4 of 5
(2,474 Views)

@maelstrom2727 wrote:

Thanks for the help.  Any idea how he made the local variables without the right click of the mouse.  He must have used a keyboard stroke.  What is the keyboard command for that?


It makes no sense to call loops "threads" as in the video, because mutithreading has nothing to do with individual loops. The program would actually work the same if you would force it to use a single thread. It is misleading to call it an example of multithreading in the first place. It simply is an example of parallel loops. It also does not require multiple CPU cores to function (which is also something entirely different).

 

There is no keyboard shortcut to create a local variable from an indicator, but once you have a local variable, you can ctrl-drag it to create copies.

 

Anything is possible with some creative video editing (Look at hollywood!), so don't draw conclusions. Just because the music is continuous, it does not mean it was filmed in a continuous way. 😄 (this is not rope by Hitchcock)

 

And yes, the video is extremely annoying!!

0 Kudos
Message 5 of 5
(2,453 Views)