From 12:00 AM CDT Sunday, October 17 - 11:30 AM CDT Sunday, October 17, ni.com will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Debugging c++ DLL called from LabVIEW (Visual Studio 2017)

Solved!
Go to solution

Hello,

 

I have run across an issue trying to debug a c++ DLL I've created in Visual Studio 2017 that is called form LabVIEW. In the past I was able to do this without issues. Now it seems that my breakpoints in the DLL can't be reached when I call a function residing in the DLL form LabVIEW. I am getting the message "The breakpoint will not currently be hit. No symbols have been loaded for this document." when I attempt to set a breakpoint.

 

The DLL was created using the Visual Studio DLL wizard. My VS2017 Configuration is for Debug, Platform: x64.

 

As in the past I am attaching to LabVIEW via the Debug->Attach to Process option after I start LabVIEW. As soon I complete the attach the breakpoint message described is presented. When I run my LabVIEW VI I don't hit the breakpoint (as the environment is telling me).

 

To try to figure out what might be happening I created a small DLL project & small LabVIEW.vi. The DLL contains two simple functions that I call using the Call Library Function Node in LabVIEW:

getVersion which retrieves the version of the DLL & returns it to the caller (LabVIEW in this case).

setAcqState which takes a value from a caller & sets the state of the DLL

 

I'm attaching my VS project and the LabVIEW VI I'm using as a test bed. I'm using LabVIEW Professional 2020 on a Windows 10 machine.

 

Any help is greatly appreciated!

Download All
0 Kudos
Message 1 of 2
(464 Views)
Solution
Accepted by topic author CaveDweller

Hello Everyone,

 

I found a solution to the outlined problem with debugging a VS DLL.

 

I found this Discussion Board topic:

Solved: Debugging a c++ dll from visual studio 2010 - NI Community

 

Message 2 in this thread discusses setting the command option to start LabVIEW. I made this change and also set the Attach option to 'Yes' as shown below:

CaveDweller_0-1616081191101.png

 

After making this change I rebuilt my solution then did the following:

I started LabVIEW & loaded my test VI.

My breakpoints in VS remained active.

Ran the VI & hit the breakpoints I set in the DLL.

 

Thanks

0 Kudos
Message 2 of 2
(409 Views)