11-30-2012 02:06 PM
@crossrulz wrote:
@JÞB wrote:
(Try using the App.Kind property to drive the last cases selection)
I'm more of a fan of the Conditional Disable Structure myself
I suspect the CD would perform a bit better in a benchmark, Especially if the UI thread is heavilly loaded. Although, most UI activity should be done after cleanup
Might make an interesting diversion and a good use for Precision Timer.vi
11-30-2012 02:08 PM
@JÞB wrote:
@crossrulz wrote:
@JÞB wrote:
(Try using the App.Kind property to drive the last cases selection)
I'm more of a fan of the Conditional Disable Structure myself
I suspect the CD would perform a bit better in a benchmark, Especially if the UI thread is heavilly loaded. Although, most UI activity should be done after cleanup
Might make an interesting diversion and a good use for Precision Timer.vi
You must be pretty bored for the end of the day on a Friday. I would almost guarantee that the CD will perform better because it makes the decision at compile time instead of run time.
11-30-2012 02:15 PM - edited 11-30-2012 02:17 PM
@crossrulz wrote:
You must be pretty bored for the end of the day on a Friday. I would almost guarantee that the CD will perform better because it makes the decision at compile time instead of run time.
Oh I agree.... Just sometimes.... "unexpected results" can occur so, I'm not putting money down without checking it out.
almost guarantee reminds me of "a little bit pregnant"
11-30-2012 02:33 PM
Yes, I build an exe file.
11-30-2012 02:36 PM
Please help me to check if it is correct. I never user APP.Kind before.
Thanks a lot.
Steven
11-30-2012 02:37 PM - edited 11-30-2012 02:38 PM
<NOTE>Should have updated web page before posting...</NOTE>
There are quite a few possibilities. Your code has many race conditions since it uses local variables to pass data around between loops. This is always a bad idea. Local variables should only be used to update or initialize UI values. Values used to control the program should be in wires (preferred), data value references, or functional global variables (also called shift register or LabVIEW 2 globals).
Your program is overly complex. For example:
To do the fastest fix for this code, I would add a shift register to the bottom loop which includes all your state information and use this to replace all the calls to local variables. Change the bottom loop from a simple state machine to a queue driven task handler. Use the event structure to send messages to the bottom loop using the queue. Delete the other two loops - their functionality can be folded into the new bottom loop.
If you are unfamiliar with this master/slave architecture, check out the examples that ship with LabVIEW and that exist on the NI website.
When you posted your code, you did not post the subVIs. In the future do a save with dependencies and zip the entire set of VIs to post.
Good luck!
11-30-2012 02:42 PM
Like I said... refactor the code.. 😉
To learn more about LabVIEW, I suggest you try looking at some of these tutorials.
11-30-2012 02:57 PM
Thanks. I will refactor the code.
But right now, I need to know how to use app.kind to close me application and/or front panel. Please take a look the attachments. Is it correct?
Thanks.
Steven
11-30-2012 03:01 PM
No.. in your case, you are simply closing the reference to the application.
I'll draw an example.
11-30-2012 03:16 PM