LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA: Call to Labview Host VI DLL too slow

I've designed a FPGA VI, with its coresponding  Host VI that is working well.  I needed to interact with the VI from a C language application.  So, I used LabView's Application Builder to build a shared library (DLL).  From my C code I use the LoadLibrary and GetProcAddress to make calls to my Host VI within the DLL.  Functionally, everything works, i.e. I can control the VIs via my C application.

However, for the application in which this is being used, the Host VI method within the DLL that the C code calls takes too long to process.  Through debuging, I found that the Host VI method takes about 0.85 seconds to return.  I actually went in and created a Host VI method that does nothing, just to prove that it wasn't the Host VI doing some work that was hogging the time.

This just seems like way too long to return from a call to a routine that does nothing.  Is this a windows problem, or something under the hood that's happening in my Labview created DLL?  Like I said, functionally it works, and interfacing to it is simple.

If you need more details, just ask.

Thanks for your help.

- Rick

0 Kudos
Message 1 of 7
(4,229 Views)

Hi Rick,

Does the 0.85 seconds refer to your actual Host VI that interfaces with the FPGA VI or the empty Host VI?   Are you passing any parameters? 

Jennifer R.
National Instruments
Applications Engineer
0 Kudos
Message 2 of 7
(4,192 Views)
I figured it out.  I compile my C code under MS Visual Studio and needed to use the DelayLoad link option on the LabView DLL I created.  The processing time went down signifigantly once I did that.

0 Kudos
Message 3 of 7
(4,181 Views)

Hi zbsbdjhd,

That's great news!  Thanks for posting the solution. 

Jennifer R.
National Instruments
Applications Engineer
0 Kudos
Message 4 of 7
(4,178 Views)

Hello,

 

I've a similar problem calling a labview dll.

 

Can you send me more detaila about Delayload link option? How can I use it?

 

Thank you in advance.

 

Filippo

0 Kudos
Message 5 of 7
(3,803 Views)

Hello,

 

I've a similar problem calling a vi from c, with ni-rio 3.x.x.

 

Do you have any help?

is the DelayLoad link option a valuable solution?

 

Thank you.

 

Phil

 

0 Kudos
Message 6 of 7
(3,801 Views)

Here's some general information regarding Delay-Loaded DLLs.  I hope this helps!

 

- Greg J

0 Kudos
Message 7 of 7
(3,786 Views)