11-20-2012 03:06 PM
Hello.
I work in a bearing testing environment. I write custom code to do test data acquisition on bearing testing rigs. Pretty much each is a one-off that's written for that specific customer or test we're running at the moment.
My quandry is this; One test, let's call it test A, has been up and running for a few weeks. We want to bring another test, test B, up and run it as well.
Traditionally, we would suspend both tests while I add the code for test B to the existing main instance that's already running test A and make it a tabbed control. However, I have a couple of programs I'm very happy with as-is, and would like to simply just bring them both up and run at the same time.
The problem being, they will both try to use the same resource (DAQ card) and will have conflicts.
Is there any way to skin this cat, or should I just get to copypasta'ing my code from one VI to the other?
Thanks in advance.
11-20-2012 03:12 PM
This might be a good excuse for subpanels. You could have a list of tests in a list box. When you select a test, the test that is running is stopped (user event or notifier usually work well) and unloaded from the subpanel and the new test VI is then loaded into the subpanel and ran. You would just have to make some minor tweaks to your existing VIs to handle the stop communications from the master VI.
11-23-2012 02:12 AM - edited 11-23-2012 02:13 AM
If you already have the source codes for Test A and Test B, you will have to develop a new code that can call both Test A and Test B.
you will have to make some modifications to the existing codes and also add some new code. also, it is important to know how many such tests do you wish to perform in parallel? how long does each test take to complete?
Your design approach should be:
Have a module that is doing the data acquisition alone. You will have to remove the data acquisition sub vis from Test A and Test B codes,if any, and make a seperate one that can be called dynamically. Acquire data in this DAQ module and put them in queues.
in Test A and in Test B, read the queues and perform whatever analysis you wish to. You can have a single GUI, that calls both Test A and Test B or only one test as you wish. Whichever test is called, the DAQ will be a single module that you launch.
by using sub panel, you can see only one test GUI at a time. but you can still have the other test running in the background. you need not have to stop Test A to startTest B. else, you can have tab control and see both tests results on the GUI.
Assumption: you DAQ configuration (sample rate, etc) is same for both Test A and Test B. the tests differ only in the data analysis not in data acquisition
conclusion: you cannot have two seperate modules call the same DAQ device at the same time. you will have to develop a new code