Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Debugging CVI DLL

I have a couple of questions regarding using a CVI DLL in Visual Studio 2005.  Is it possible to step into the CVI DLL code when debugging in Visual Studio?  My DLL functions (which get data from a serial device) work fine in CVI, but don't appear to work in Visual Studio.  Also, I get a message at some point in my VS debugging session stating "the current program has exceeded the maximum time allowed in the Demo version of LabWindows/CVI."  This occurs despite the fact that the CVI version was just activated.  Thanks.
0 Kudos
Message 1 of 5
(3,989 Views)

Hello,

I would be glad to help you with this issue. To answer your first question, it should  be possible to step into your DLL during debugging by following the steps in this KnowlegeBase article:

http://digital.ni.com/public.nsf/allkb/6901DBC7E7A83668862565FA00735CEC?OpenDocument

Essentially, there is an option in CVI to launch an external process (Visual Studio in this case) and then step into the DLL code when executed.

I'm not sure off hand why you are seeing the LabWindows / CVI demo version message. Can you please navigate to Start >> Programs >> National Instruments >> NI License Manager and verify that the version of CVI you are using is properly activated (it should appear with a green square)?

I hope this helps. Please let me know if you need any further assistance and I would be glad to help in any way possible!

Regards,

Casey Weltzin
Applications Engineer
National Instruments

0 Kudos
Message 2 of 5
(3,976 Views)
I'm not having much success with getting the CVI debugger and Visual Studio to work together.  When I select "Run External Process" from CVI, VS starts with a warning message stating "A non-debuggable thread is trying to suspend execution at address 00000001.  Do you want to suspend execution?"  If I select "No" and then open my VS project, I can start the application.   The program runs until the first attempt to call a CVI DLL function.  At this point, the program stops with the following error message: "DLLNotFoundException was unhandled.  Unable to load DLL ...  The specified module could not be found."  I copied the _dbg DLL to the VS program directory (where the other VS source files are located) and added the_dbg DLL to the project files list, so I'm not sure why it cannot be opened.
0 Kudos
Message 3 of 5
(3,926 Views)
Hi,

Within CVI, you need to point the external process to the .exe that you built within Visual Studio.  Currently, by pointing it to the .exe that starts Visual Studio, you are telling CVI that you are trying to debug Visual Studio.  Try this out and let me know if you have any questions.
0 Kudos
Message 4 of 5
(3,918 Views)
Thanks for the tip.  The CVI debugger is now running my Visual Studio app.  I had tried selecting my VS app as the CVI external process earlier, but
it seemed to hang.  I think the key points are to point CVI to the debug version of the VS .exe and have the debug .DLL in the same directory as the .exe.
0 Kudos
Message 5 of 5
(3,912 Views)