I am working on an automated tester for some units that my company manufactures. I have all the code down for a test in the first position out of two positions. I don't want the units to test simultaneously i want it to wait for unit 1 to finish before unit 2 starts vice versa. Does anybody know the easiest way to achieve this? I have only done single unit testers in the past so I have no experience working with queue's.
Are you working with any DAQ hardware? You shouldn't need to use queues to get software to execute in a certain order, you can just run the error line through your functions or use a flat sequence strucuture.
If you really want to use queue's maybe you could enqueue a cluster. In the cluster you'd have an enum for the states and another enum to indicate which fixture to run. That way you can switch the fixture enum when the first unit is done testing. Does that make sense?
But, without knowing more its hard to say what you should do.
I am using daq ni usb-6501 to be exact, I am not having trouble with the order of operations of the test itself. I have 2 buttons 1 to start each positionl, I want to be able to press them both, but have the tester wait until the first unit that is testing is finished.
THis can be done explicitly or implicitly.
Wrap the entire test in a non-reentrant VI (this is the default) that is used by both of the stations. Since the VI is not reentrant the second will have to wait for the first to finish.
Use a semaphore that must be acquired prior to starting a test and is realeased afterwards.
Almost, I want the operator to be able to have both start buttons pressed, but not have the second unit do anything until the first unit is done and ejected. While unit 2 is testing the operator can then load the tester with another unit in position 1 and press start, then repeat when position 2 finishes. We don't want to pay an operator to sit and wait, we want them moving all the time for max efficiency.
its is a VI that can only be run in one thread at a time.
I wrote more on that topic in the second post in this thread where I talk about "The Traffic Cop Behind the Scenes".
Maybe you could help me solve my other problem, In my code, i have my vi setup with 2 while loops. I only have the code written for the first positon. I have only been programming labview for about a year now. How do I setup buttons to run my vi? I have just been using 2 button dialogs in a case structure which is in the second while loop. I have the output of the dialog wired to the stop of the small while loop. When true is pushed it stops the small while loop and re-runs everything in the large while loop. I tried putting everything in a case structure with a ok button attached to the question mark but that did not work. See attached vi, ill take any critism that i can get.