|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Dynamically parallel
Hi, You only have one VI ref here. You will need a new ref for each VI instance that you want to run. Secondly, you specify to open as a re-entrant VI as the option when opening the reference.
<Hint>Open VI Reference primitive</hint> Edit: While this is "legal" LabVIEW code, I would recommend against it if you can avoid it. There is some overhead when opening VI's in this manner. (Dynamic calling) If calling parallel code statically, (IE. Specifying at edit time on the block diagram) the overhead is very minimal. Last edited by SuperS_5 : 22-12-2010 at 01:35. |
|
#2
|
|||
|
|||
|
Re: Dynamically parallel
As others have mentioned, you need to get a new vi ref for each run. What I'd recommend is to in advance, loop through doing the opens and putting the refs into an array, same size as the CAN IDs. Then your timing will not include data space cloning and mgmt overhead. Personally, I've only used this a few times, and for profiling, tend to drop the reentrant code N times. If much code is involved, I wrap it into another reentrant subVI. If I need hundreds, I drop ten, make a subVI, and drop ten of those, etc.
Greg McKaskle |
|
#3
|
||||
|
||||
|
Re: Dynamically parallel
Hi again. I just want to add an extra note. The performance of parallel code will greatly depend upon the target. Single core targets will likely not benefit from parallel code. (Massively multi-core targets obviously benefit greatly) The exception would be if a piece of code must wait for a response from another device, then parallel coding MAY benefit. Usually LabVIEW's compiler can generate more efficient code that is serial then code that is parallel, and therefore, parallel code may potentially be worse in terms of performance. There are a number of articles on the NI site that describe this. Parallel "engines" like what I think you are trying to build can introduce race conditions.
Last edited by SuperS_5 : 22-12-2010 at 17:27. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Parallel Batteries | DiehardCybercard | Electrical | 14 | 06-11-2009 07:15 |
| Batteries in Parallel | ubermeister | Electrical | 20 | 10-04-2008 08:58 |
| Parallel Tanks | AdamC | Pneumatics | 12 | 13-11-2007 20:14 |
| Parallel Processor | rohandalvi | Kit & Additional Hardware | 25 | 27-10-2004 20:21 |
| Working in Parallel | dubya404 | 3D Animation and Competition | 7 | 28-01-2003 11:48 |