Re: Properly close multi loop application - labview
This is a discussion on Re: Properly close multi loop application - labview ; Don't want to hijack the thread....   but isn't it bad style to have multiple event structures like that?   Or is that only a problem for dynamically registered event?  
I'm thinking about this thread: <a href="http://forums.ni.com/ni/board/message?board.id=170&amp;message.id=237840&amp;view=by_date_ascending&amp;page=4" target="_blank">http://forums.ni.com/ni/board/message?board.id=170&amp;message.id=237840&amp;view=by_date_ascending&amp;page=4</a>
&nbsp;
Personally, I generally ...
-
Re: Properly close multi loop application
Don't want to hijack the thread.... but isn't it bad style to have multiple event structures like that? Or is that only a problem for dynamically registered event?
I'm thinking about this thread: <a href="http://forums.ni.com/ni/board/message?board.id=170&message.id=237840&view=by_date_ascending&page=4" target="_blank">http://forums.ni.com/ni/board/message?board.id=170&message.id=237840&view=by_date_ascending&page=4</a>
Personally, I generally use local variable/property nodes, or have a (command) queue in the loop, with either a special stop command for the loop, or the loop simply terminates when the queue is unavailable. (Like the producer/consumer design patterns that you can select when creating a new vi.)Message Edited by Anthony de Vries on 10-18-2007 05:27 PM
-
Re: Properly close multi loop application
I don't really use dynamic events, so I cannot comment on that specific thread, but for plain events I never had any issues with multiple event structures tied to the same FP event.
In my opinion, the following are OK:
- Multiple event structures serving the same FP event (e.g. "stop:value changed" in this case). Each in it's own while loop.
Not OK are the following (again in my opinion):
- Multiple events in the same loop (unless all are "transparent" with 0ms timeout). Still, this is not something I would do.
- event structures within event structures
- event structures inside case structures
- event structures inside certain sequences (if any of the frames contains delays).
- events containing long delays.
- events NOT in a while loop (except for dialog style VIs that don't have any while loops)
- events containing interactive while loops (short "math" while loops are of course ok, e.g. as used in a newton iteration)
- ...
In summary: any event topology that prevents the event from being serviced by the code dataflow within a short time is NOT OK.
This is my own list. Have a look at the <a href="http://zone.ni.com/reference/en-XX/help/371361D-01/lvhowto/caveatsrecmndtnsevnts/" target="_blank">NI documentation</a> for other more details. I cannot find any objection against firing multiple event structures in parallel. 
Similar Threads
-
By Application Development in forum RUBY
Replies: 0
Last Post: 12-16-2007, 01:03 PM
-
By Application Development in forum CSharp
Replies: 1
Last Post: 12-14-2007, 02:37 PM
-
By Application Development in forum Java
Replies: 2
Last Post: 03-08-2007, 12:54 AM
-
By Application Development in forum basic.visual
Replies: 0
Last Post: 08-16-2005, 04:23 PM
-
By Application Development in forum Microsoft Exchange
Replies: 0
Last Post: 04-01-2004, 05:07 AM