03-21-2016 05:37 AM
I'm trying to create an application to calibrate UUTs, the calibration is OK, now i make some change to my prog to make 2 parallel tests in one panel.
I create two threads where i put the code to test UUT.
In my "Start_Function_Callback" call the two thread like that:
While the user click on the start-button the test start, two panel (like popup) apprears where the user puts the serial number for each DUT.
After that the test start for the two DUTs.
I give 5second for the first test and 10seconds for the second one.
The problem is that the test is not in parallel mode, supposed that after 5seconds the first panel appears to put the serial for an other UUT in the first position but nothing happen until the second thread ends (after 10seconds).
Please what should i modify in my code to make parallel tests?
Thanks a lot.
Solved! Go to Solution.
03-21-2016 05:55 AM
I would be surprised such a code works!
Your neverending loop continuously starts threads saturating the pool in a few runs.
Try spawining the threads and then exiting the callback: your program will sit in RunUserInterface () while the threads run independently.
You should experimenting the multithreading with a simple conceptual but working framework just to understand how things work. I am thinking to a simple UI that launches the threads; thread functions can simply ask for S/N and then wait for a few seconds, again and again until a stop thread condition is found.
This will help you also to understand how to stop that mechanism.
03-21-2016 06:00 AM
Thanks for your answer Roberto,
Im beginner in labwindows and multithreadding, i like to make this test in parallel.
Have you any example or a modification that should i do?
thanks.
03-21-2016 06:02 AM
In my UI when the user click on the button "start", the first panel appear to put the serial for the first UUt then the second panel appears to put the second serialand the test start.
03-21-2016 08:10 AM
Please any help, i'm blocked !!!
03-21-2016 08:35 AM
Hello xmouth, have you already coded something? Can you posta the framework I told you so that we can discuss on some tangible code?
03-21-2016 09:06 AM
Hello,
I don't know how to start?
Should i add a "while loop"? But i think that is not the good solution.
Really i can't found a solution, when surfing in the net, i found that the real solution for parallel test is multithreadding, i make two thread but can't run them in parallel mode, here is the biggest problem.
Have you any solution or idea?
In my UI, the prog still waiting until the user puts the serial then start testing, but how can i launch the two thread at time?
That's my question.
Please help me !!!
03-21-2016 09:30 AM - edited 03-21-2016 09:30 AM
I have several ideas but I doubt you can understand the real complexity of a multithreading paradigm before a serious study on the subject.
Anyway, attached you can find a simple skeleton of what you can do: it does really nothing but advance a pair of progress bar and ask for serial numbers, but is multithreaded and handles proper start/stop/dispose of threads.
Fully understanding it will need you to read the chapter on multithreading in the help: you'll find it in Programmer Reference >> Creating Multithreaded Applications.
03-21-2016 09:48 AM
Thanks a lot Roberto, i do it now, just i make a condition to repeat the test and to make parallel tests.
Now i have to manage the popup , and block the second test until the user puts the serial number.
I'm really thankful.
🙂