LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I debug a DLL created in Visual C++ called by the Labview VI

If so , how?
Thanks

0 Kudos
Message 1 of 10
(4,481 Views)
Assuming you mean use VS to debug the DLL, sure. Simply build a debug version of your DLL and then in the project properties in VS, specify LabVIEW.exe as your debug program. Then when you hit F5 to "run" your DLL, it'll launch LV. Set your breakpoints in your DLL and they'll fire when you call the DLL. You won't be able to see what's going on inside of LV, but VS is smart enough to load up your debug info for your DLL.
Message 2 of 10
(4,472 Views)
"in the project properties in VS, specify LabVIEW.exe as your debug program",

I am using VC 2003 7.1, could you give me more detailed description?
I cannot find where I can specify the debug program in the project property



Thanks



0 Kudos
Message 3 of 10
(4,455 Views)
Sure.
 
1. Right click on your project in the solution view and select Set As Startup Project
2. Right click on your project in the solution view and select properties
3. Under Configuration Properties, select Debugging
4. On the right pane, in the Action list, put LV in the Command box. Something like c:\program files\national instruments\labview 8.0\labview.exe
5. Two down from that, in the Working Directory box, put the directory of labview, such as c:\program files\national instruments\labview 8.0
6. Under the Debuggers list, set Debugger Type to Native
 
Now you should be able to hit F5 to build your DLL and launch LV.
0 Kudos
Message 4 of 10
(4,450 Views)
Thanks for the information.
I did as the instruction. However, when I hit F5, it does load the LV, but with no file open. Then I click continue in the LV, load the LV code and run it, then it says :

Debugger detected - please close it down and restart.

The error window is attached.

How come it does not run, what did I do wong?
Thanks


0 Kudos
Message 5 of 10
(4,435 Views)
Maybe creating an executable from your vi would help. The debugger would need to run this exe (only RTE involved, no development environment).

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 6 of 10
(4,429 Views)
I'm afraid I'm not sure why you're getting that message - it isn't from LabVIEW.
 
However, if you google for "A debugger has been detected: unload the debugger and try again", you'll see a lot of information regarding Windows Media Player, Nero, DVD software, etc.
 
You might want to do the search and see if any of the hits apply to your system or software.
0 Kudos
Message 7 of 10
(4,415 Views)
It is the same result when I load a EXE file.

Well, actually I find that the LV (both the LV DVE and RTE) runs the code OK, and it stops in the VC++ env at the breakpoint, however,
it pops up the above error window when it runs the VI "IMAQ AVI Open".

Except the error window pops up in Labview, the following is the error msg in VC env:

'LabVIEW.exe': Loaded 'C:\WINDOWS\system32\nipalut.dll', No symbols loaded.
'LabVIEW.exe': Loaded 'C:\WINDOWS\system32\nipal32.dll', No symbols loaded.
'LabVIEW.exe': Loaded 'C:\Program Files\National Instruments\LabVIEW 7.1\resource\mesa.dll', No symbols loaded.
'LabVIEW.exe': Loaded 'C:\WINDOWS\system32\mscms.dll', No symbols loaded.
'LabVIEW.exe': Loaded 'C:\WINDOWS\system32\icm32.dll', No symbols loaded.
'LabVIEW.exe': Loaded 'C:\WINDOWS\system32\msimg32.dll', No symbols loaded.
The thread 'Win32 Thread' (0x18c) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0xed8) has exited with code 0 (0x0).
'LabVIEW.exe': Loaded 'C:\WINDOWS\system32\qcap.dll', No symbols loaded.
'LabVIEW.exe': Loaded 'C:\WINDOWS\system32\msvfw32.dll', No symbols loaded.
'LabVIEW.exe': Loaded 'C:\WINDOWS\system32\quartz.dll', No symbols loaded.
'LabVIEW.exe': Loaded 'C:\WINDOWS\system32\devenum.dll', No symbols loaded.
'LabVIEW.exe': Loaded 'C:\WINDOWS\system32\d3dim700.dll', No symbols loaded.
'LabVIEW.exe': Loaded 'C:\Program Files\Common Files\Ahead\DSFilter\NeVideo.ax', No symbols loaded.
First-chance exception at 0x0c90b5ed in LabVIEW.exe: 0xC0000005: Access violation writing location 0x00000000.
First-chance exception at 0x0c90ab1c in LabVIEW.exe: 0xC0000005: Access violation writing location 0x00000000.
First-chance exception at 0x0c90ae07 in LabVIEW.exe: 0xC0000005: Access violation writing location 0x00000000.
First-chance exception at 0x0c90af24 in LabVIEW.exe: 0xC0000005: Access violation writing location 0x00000000.
First-chance exception at 0x0c908623 in LabVIEW.exe: 0xC0000005: Access violation writing location 0x00000000.
First-chance exception at 0x0c908716 in LabVIEW.exe: 0xC0000005: Access violation writing location 0x00000000.
First-chance exception at 0x0c908870 in LabVIEW.exe: 0xC0000005: Access violation writing location 0x00000000.
First-chance exception at 0x0c908af7 in LabVIEW.exe: 0xC0000005: Access violation writing location 0x00000000.
First-chance exception at 0x0c908ca4 in LabVIEW.exe: 0xC0000005: Access violation writing location 0x00000000.
First-chance exception at 0x0c90afa7 in LabVIEW.exe: 0xC0000005: Access violation writing location 0x00000000.
First-chance exception at 0x0c90b0f8 in LabVIEW.exe: 0xC0000005: Access violation writing location 0x00000000.
First-chance exception at 0x0c90b26a in LabVIEW.exe: 0xC0000005: Access violation writing location 0x00000000.


What is the reason for that and is there any way to elliminate the error?

Thanks


0 Kudos
Message 8 of 10
(4,406 Views)
Please see my earlier post. This is not something inside of LabVIEW - it is something on your system. Since this is only happening when you do indeed have the debugger attached, I think it has something to do with the AVI/DVD copy protection software installed on your machine. It may be possible to disable it.
 
I did a bit of searching around for you and found the following discussion. They have several techniques that seems to have fixed the problem for other people, so one of them may work for you. The event they are dealing with have to do with getting games running, but I think, from the other hits I read, that it is related to AVI's, and that matches up with what you are seeing. I've also seen several references to the Nero CD burning software. If you have that software, you might want to try uninstalling it to see if the problem goes away - that has worked for other people.
 
 
Similarly, there is a MS support issue on this, again related to games, but their techniques might make a difference.
 
 
0 Kudos
Message 9 of 10
(4,398 Views)
Brian:

Thanks for the information.


0 Kudos
Message 10 of 10
(4,392 Views)