LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

1)Calling LabView DLL from LabWindows/CVI code or 2) continuously reading dynamic output from a LabWindows/CVI DLL called from a LabView VI

Hi, I inherited a sophisticated program developed in Labwindows/cvi, which controls a robotic device (Call it "DevA"). I also have developed a Labview VI which communicates to another device ("DevB") over a USB port.  I need to add some computation in the C code which monitors what's happening in DevA in order to properly control DevB w/ my labview code. 

 

I have tried creating a DLL out of my labview VI and calling it from the C code, but something seems to be hogging up tons of memory, as it slows the DevA control (the LabWindows/CVI program and GUI) way down.  THe LabView DLL is just writing a command over the USB port.  I made sure I am not opening and closing the port EACH time the comptuation is performed and command sent.  Is calling a LabView DLL just inherently slow, or must I be doing something wrong?

 

I have also tried creating a DLL out of the C code and then calling it from labView. It runs nice and quickly but this DevA DLL does not seem to communicate information to LabView once the DevA program has started. (so DevB never gets turned on or gets any control) -- i.e., the C code launches a GUI to control DevA. So, the Labview code runs, and then when it calls the C dll, it seems that the rest of the LabView functions that are wired to output from the DLL ("call function library node" output) do not execute and probably would not execute until I close the DevA GUI. In other words, I don't know how to continuously monitor and control DevB in real-time as the DevA program's outputs are changing.

 

Anyone have any ideas on what could be wrong w/ either of the approaches I'm taking? Or know of another way that's sure to work?

 

I am neither a LabWindows or LabView expert, so any help you could provide would be appreciated.

Thanks!

0 Kudos
Message 1 of 2
(3,212 Views)

Hi Mark CSULA,

 

What kind of timing do you have in the LabVIEW created DLL?  It may be slowing things down due to that.  You mentioned memory being taken up; is this something you have seen in Windows Task Manager?  Calling a LabVIEW DLL shouldn't be inherently slow, but the memory may be the Run-Time engine being loaded.

Jared S.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 2
(3,160 Views)