04-14-2011 10:18 AM - edited 04-14-2011 10:18 AM
Is this your top level VI or just a VI to control what to do next? If its your top level VI you shoudl convert it to a State Machine. Otherwise, force program execution with the error line and SubVIs, not a sequence structure. Sequence structures are not very scalable and they take up a lot of block diagram realestate.
Making that change will help making what you are tryng to do easier.
04-14-2011 12:35 PM
Okay, I set it up as a state machine, now how do I create a button to start the vi without having to use the 2 button dialog boxes? See attached.
04-14-2011 12:44 PM
HAve you used an event structure before? I think this will be your best bet to get your state machine running without the two button dialog box. Instead of polling for an input like you are doing, it uses event driven programming. You can set up a boolean called "Start Tests" and monitor for a value change on that boolean in your event structure. Then, based on what button is clicked, you can enqueue the proper states and take the proper action. Article on event driven programming: http://zone.ni.com/devzone/cda/tut/p/id/3331
Your event structure will live in a "Monitor" state where you monitor for inputs. Maybe you'll set it up so that you have a "Test 1" and "Test 2" case. When the "Test" boolean is clicked you'll go to the Test 1 case, and then go to the test 2 case. And then back to your monitor case. Maybe you'll save your data in which case you'll go to a Save Data state after Test 2.
Does that help/make sense?
04-14-2011 12:47 PM
Yes, but don't you need to have the full developement system to use event structures? I am using base developement!
04-14-2011 01:06 PM
Oh... you're right about that. Maybe you can just poll a boolean called "start test" and watch for a value change through the polling. To know if the last unit passed or failed you could use a pass/fail boolean instead of using the dialog.
04-14-2011 02:15 PM
Thanks for all your help
04-19-2011 01:31 PM
I think this is more like what you want as you discussed. This uses semaphores.
04-19-2011 01:38 PM
Thanks
04-19-2011 04:28 PM
I think I got everything all figured out now thanks, I didn't end up using a queue or semiphore! Feel free to check it out.
04-19-2011 04:30 PM
Would love to, but I am currently using LabVIEW 9.0. Can you save it for earlier version?