LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tab control with state machines


@Nicku wrote:

Would you please post the code saved for Labview 2013 please? I would like to help you if possible.


Who exactly are you referring this to?  If mine, do a search in the Example Finder (Help->Find Examples) for "subpanel".  There is a simple example there.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 11 of 14
(963 Views)

All of the advice given so far (except for JKI state machine - I have taken an irrational dislikin' to it) has been good.  However, people on this forum have a tendancy to want to teach you the "right" way to do it rather than fix a poor solution.  So, let me directly address the question you asked:  Why you need to restart the application to select a different test.

 

I think if you watched highlight execution you would figure it out, and in fact it was pointed out to you earlier in the thread but not made clear that was the problem.  Sequentially, here is what your program does:

 

1.  Starts a while loop.

2.  Looks at tab control.  Picks what UUT you want to use.  Feeds that in to a case structure.

3.  Starts a second state machine driven while loop.  Tests your uut.

4.  Repeats step 3 until "stop" button is pressed.

5.  Once stop is pressed, inner loop finishes executing.  Execution returns to outer loop.

6.  Outer loop, which is fed in to the same stop button finishes executing and program terminates.

 

So the problem?  Your outer loop only runs one iteration ever.  It instantly goes to inner loop and then stops once told to do so.  So, to fix your problem you need to disconnect the outer while loop from your stop button so that it continues execution once you are done testing your first UUT.

 

That having been said, even if you don't go with some of the complex architectures discussed here, I would urge you to at least consider what other architectures you could use here.  I know you said you are new, but it is never too early to learn better ways to set up programs!

Message 12 of 14
(943 Views)

Thanks for the reply!

 

I have currently got a program working using crossrulz advice, which is basically using a subpanel program to call up the relevent VI to test the desired product. This seems to work well, but I feel its a crude approach (or i've not done a good job at it). I understand there are far more advanced ways, and im booked on to core 2/ teststand in the next few weeks to expand my skills....

 

BUT, for now, what architecture would you advise for automed test of different products ? at this stage in the game im just proving a process, not creaing any advanced network systems with live data analysis etc...

 

I have one test unit which houses a USB6008, and other interface circuity ive designed (my background is in electronics), and this connects to three interchanngable top plates which are used to test three different products. At this point i just want labivew to identify which product has been conected to the test rig (only one product is tested at a time, no parallel testing at the stage), and from this drag up the correct front panel for the user to interact with, and test the product.

 

(I appologise for the very basic terminology/ knowlodge!!)

 

Thanks again,

0 Kudos
Message 13 of 14
(910 Views)

In the main VI, I am think you will want two loops: a GUI loop and a Data Logger loop.  The GUI loop just has and event structure in it to respond to button presses (check UUT, select UUT, run, etc).  This loop should also be used to call up your test VI and load it into the subpanel.  The Logger loop should be a Queued Message Handler (similar to a Producer/Consumer) which recieved data from the test VIs and logs the data.  This peice should be reusable, so you might as well just keep it seperate.  Also, file IO tends to be slow, so this allows your tests to run while the file IO happens whenever it can.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 14 of 14
(897 Views)