From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-12-2011 05:05 PM
Hello,
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.
04-13-2011 06:58 PM - edited 04-13-2011 06:59 PM
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.
04-13-2011 09:00 PM
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.
04-14-2011 08:16 AM
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.
04-14-2011 09:43 AM - edited 04-14-2011 09:51 AM
Edit: Misread post, this comment was not applicable.
04-14-2011 09:49 AM
THis can be done explicitly or implicitly.
Inplicit
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.
Explicit
Use a semaphore that must be acquired prior to starting a test and is realeased afterwards.
Ben
04-14-2011 09:51 AM
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.
04-14-2011 09:55 AM
What is a non-reentrant vi?
04-14-2011 10:00 AM
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".
Ben
04-14-2011 10:12 AM
Ben,
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.