LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DLL calling efficiency in Labview

Solved!
Go to solution

Hi there,

 

I am working on a labview program for real-time data processing.  So, code running efficiency will be critical.  I am wondering how about the calling cost of the DLLs.  Similarly, how about the calling cost of sub-programs.

 

To implement the same function, will the call of a sub-VI be faster than the call of a DLL?

 

If I can expand all the sub-VIs into the main program and remove all the callings, will that be much faster?

 

Any one can give me any clue or guideline?

 

Thanks.

0 Kudos
Message 1 of 3
(2,419 Views)
Solution
Accepted by topic author crxx

crxx wrote:[...]

I am working on a labview program for real-time data processing. [...]


What is the OS you are using?

 

Since you ask in general, i answer in general:

This question cannot be ansered. It is a case-by-case-thing and has to be benchmarked individually.

Most effect will be memory management: Who is allocating how much memory? When is this done?

 

Esp. memory allocation messes up determinism, so a DLL might perform worse than pure LV code (given an LV RT OS). But it might be better for certain encapsulated algorithms..... no one can tell in general.

 

The most important question is possibly this:

How often is the code (DLL vs. Sub-VI) called and how short is its execution time? If the relation code execution:call overhead is very low (=> 1:1), it is best to "resolve" the subcode. SubVI Inling is a valid way in pure LV (as of 2010).

If the code is called seldom, the whole discussion is somehow obsolete since the call overhead will be neglectible, even if it would be quite high.....

 

And no, C is not faster as LV by definition. It also depends on the task and the way you implement it..... 😉

 

hope this helps,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 3
(2,412 Views)

Thanks Nortert for your quick response.

 

I do need call the sub-code very often. Just want to figure out a way to let the diagram look simple. I tried inline SubVI.

 

Your answer confirmed my guess that any other calling, either SubVI or DLL, will give us call overhead.

0 Kudos
Message 3 of 3
(2,378 Views)