03-12-2013 11:32 AM
Hi everybody
I'm extending and optimizing a c++ dll that is called in a labview file. I have managed to get it update and running but it's not doing what is supposed to :(.
I need to debug it by setting break point in the c++ code because the labview part is just memory and display. How I can do that? Any help will be really appreciated 🙂
I'm using labview 2012 and VS210 express.
Tanks a lot
Amos
i attached the main file of the dll and the labview interface.
Solved! Go to Solution.
03-12-2013 12:58 PM - edited 03-12-2013 01:13 PM
Go:
Visual studio -> Project -> Properties, select Debug mode as active, go -> Configuration properties -> Debugging -> Command, click browse, select LabView
Close LabView if opened
Select Debug mode, hit F5, click OK, wait for LabView to start, select your VI to run, create breakpoint in DLL code, run VI, the code should break.
ps. Are you serious with that VI and DLL ? That is the function with most arguments and a VI with biggest while loop 🙂
03-13-2013 04:24 AM
Thanks for the replay Bulbina
I'm not able to do what you say because I'm not able to find labview while I browse because VS search for .exe. I have to convert the Labview part in an exe?
ps. I agree the function and the while are ridiculous, and consider that right now they are about a tenth of what they were before I got my hand on them
Have a nice day
03-13-2013 04:30 AM - edited 03-13-2013 04:31 AM
Select Labview, that means you select Labview.exe
C:\Program files\National Instruments\LabView XXXX\LabView.exe
The whole process (simplified)
You tell VS this way that labview is the process, that will call your DLL.
You start LabView in VS as a process you want to debug, after there is a call to a code that was built with debug info, Visual studio is able to give you debugging capability.
03-13-2013 04:45 AM
It's still not working but is closer to success in debugging i seen in weeks 🙂 now i can compile whit out deleting the dll path from labview.
Now the problem is that is ingoring the break point in the dll 😞 . I know that i'm abusing your patient but please help me a little bit more.
thanks a lot bulbina
03-13-2013 04:53 AM - edited 03-13-2013 05:01 AM
To be honest, your DLL is weird.
Why do you have a main function in DLL?!?! DLL has an entrypoint defined in dllmain.c / cpp, delete it or comment it.
If you cannot trigger a breakpoint, there might be several reasons for that.
Check you are running the Debug configuration, check you are calling the proper (the just built) DLL, and put a breakpoint in the first statement.
I see switch statement, so you might just have a breakpoint in code that isnt executed.
On top of all that, if you are allready using labview, if I were you, I would recode the DLL into LabView. Your are not using anything out of LabView scope, just math functions.
Even if the DLL function has 200 rows, you can do this in 50 rows or few hour LabViewing.
03-13-2013 05:12 AM
I have deleted the main, and as far as i can see ( so means see that everything says debug, i'm in local system should i switch to remote?) the configurations is fine. the strange things is that he keep asking me to compile the file when i start the debug even if i just do it. i'm sure i'm calling the right dll 🙂 and i have set break point everywhere but still nothing. i tried to run labview step to step but it isn't helping. in labview the dll node debug proprety is set to maximum.
i send you the adjurned dll
03-13-2013 05:32 AM - edited 03-13-2013 05:33 AM
So,
LabView is off,
You press F5 in your visual studio, this starts LabView, it tells you LabView was not built with debug, you click yes. LabView starts.
Now you select your VI, open the Call library function node and check you have selected the proper DLL.
You start your VI, it is running and jumps into Call library function node. If you do not get triggered breakpoint now, you either have not built the dll with debug info or use wrong dll.
No more help possible to deliver.
And OMG get rid of that main function, even if it is empty !
03-13-2013 06:06 AM
Ok i'm going to reconstruct pice by pice all the function 🙂 the file is still not working but i create a new test dll and whit that one the debug run just fine. Thanks a lot
Amos
03-13-2013 06:11 AM
It is good to know, that if you specify "Attach to process" in debugging project properities, you can attach LabView, so you do not need to turn it off and on.