09-21-2005 05:53 AM
09-21-2005 07:12 AM
Hi Fabrice,
To answer your questions:
1. Is there a way to "really" do the work in parallel? (The PC is able to run both quickly without doubling the time).
The answer is yes (with hesitation based on definition of real parallel). Since I don't know which OS you are using, this answer is based on Windows products... So, let's say yes...
The way to do it is to make the sub-vi re-entrant and you can place the two within your vi. Their outputs meet at a "Rendez-Vous". Of course, although you have two of the same sub-vi's in your vi, they are configured differently in order to communicate with the appropriate serial port. Unfortunately, I do not have LV on my work PC, so I can't walk you through the steps of making it re-entrant (I'll find a past post on this). However, I seem to remember that it is set within the Properties of the vi (or sub-vi in this case).
2. Is there a way to create some real thread that the OS manage and not Labview?
Well. That depends on your OS. Windows is not a true multi-tasking OS. I would let LV manage it's threads. You can set priorities for parallel execution and rendez-vous points. Unless you are running LV on a Unix-based machine (Linux included), then LV is probably the better way to go.
09-21-2005 07:19 AM
Hi Fabrice,
Here is how you make a sub-vi re-entrant:
Select the sub-vi, under "VI Properties", select "Execution" and change the "Normal Priority" to "Reentrant Execution".
Regards,
JLV
09-21-2005 07:42 AM
Hi Fabrice,
i want to second JLV's comments right up to a point.
The point is the dll.
The dll must be "thread-safe" for you to be able to run tow instances of it at the same time. Not all dll are thread-safe.
If the dll is not thread-safe (LV plays it safe and assumes they are not) the the dll call will run in the UI thread which is by definition single threaded.
If you can verify that the dll is thread-safe, then the dll call can be configured to NOT run in the UI thread. The difference in these type of dll calls can easily be distinguished by looking at the color of the dll call node. Orange is UI thread. Yellow is thread-safe.
I suspect the issue is the dll call and NOT LV.
Ben
09-21-2005 07:45 AM
Thank you Ben,
You deserve your first set of stars of the day... 🙂
I did read the word dll... but the lack of cafeine this morning scrambled the data before they reached my brain cells.
Thanks for pointing that out. 🙂
Now, it's time for Java (not the sw-dev).
Later..
JLV
*** gone on coffee break ***
😄
09-21-2005 07:57 AM
09-21-2005 08:20 AM
Only the ones that need to run in parallel.
If you still have trouble after doing what JLV suggested and fixing the appropriate dll calls, post your code so we can comment further.
We do much better with visual aides.
Ben
09-21-2005 09:19 AM
09-21-2005 09:26 AM
09-21-2005 11:29 AM