f



Debugging a C++ dll from LabVIEW - is it possible to debug both in labVIEW and then in the C++ environment, say Visual Studio?

Hello all,
 
What I want to get a feel for is how easy it is to set up the ability to debug code both in labVIEW AND in a C++ compiler, say Visual Studio. 
 
If we have a situation where we have a c++ dll which we are accessing from labVIEW is it possible to attach the process so that you can set breakpoints in both environments. Hence run labVIEW app and when dll gets called hit a Visual Studio breakpoint?
 
This is a new area to me and I have not found anything regarding debugging. Any comments would be appreciated.
 
Regards
 
Kevin
0
x9561 (148439)
7/3/2006 4:40:07 PM
comp.lang.labview 35213 articles. 1 followers. vasusachin24 (1) is leader. Post Follow

1 Replies
1352 Views

Similar Articles

[PageSpeed] 55

Hi,
  you don't say whether you're actually using Visual Studio, or if it's .net or borland or something enirely different, but the principal holds for all that allow external debugging capability.
You need to set labview.exe as the external process to run for your dll project, and then load up the .vi in labview that calls it. You then have the debugging features of LabVIEW (since you're in that environment) and when LabVIEW calls the DLL (must be made debuggable), the c++ environment is effectively running LabVIEW in it's memory space, so it will honour all the breakpoints in the c++ project code as they get called.
For Visual Studio 6.0 c++, have a look here :
<a href="http://windowssdk.msdn.microsoft.com/en-us/library/ms164704.aspx" target="_blank">http://windowssdk.msdn.microsoft.com/en-us/library/ms164704.aspx</a> 
and here
<a href="http://windowssdk.msdn.microsoft.com/en-us/library/605a12zt.aspx" target="_blank">http://windowssdk.msdn.microsoft.com/en-us/library/605a12zt.aspx</a> 
Hope that helps
Sacha EmeryNational Instruments (UK)
0
x9561 (148439)
7/4/2006 9:10:08 AM
Reply:

Similar Artilces:

Should I call C from LabVIEW or call LabVIEW from C?
I need to write some software and am trying to choose the best development environment. I currently use Borland C++ Builder to develop most of my software and have also used some LabVIEW occasionally. The new package I need to write has to provide several functions, some of which would be better in C++, some in LabVIEW and I am wondering whether to combine the two. So far, I have had a quick play around and called a very basic piece LabVIEW code, built into a dll, from some C++ code. I am about to try to reverse (create dll in C++ and call from LabVIEW) but would appreciate some advice on the advantages/disadvantages of each method. &nbsp; Restrictions I have: 1. I will (probably) be using some hardware which will be supplied with C++ driver functions only. My interface with this card is the 'heart' of my system and is time-critical. Also, I need to assign a pointer to pass to this card (could I do this in LabVIEW?) 2. I wish to analyse data from the card using FFT and related functions so would ideally use the LabVIEW Sound &amp; Vibration and Order Analysis toolkits. I need to use these in real-time where the data sampling rate is fairly high (frequency analysis to be done on 4 channels at once with each channel sampled at approx 100kHz). &nbsp; To add to this, I would like to be able to create/modify the display screen at run-time - something which I am fine with in C++ but understand is very difficult in LabVIEW (I have only used LabVIEW for relatively...

Labview from C/C++
Hi My question is about how to call Labview VI/Global variables from C/C++. We have a cRIO-9012 that runs under the VxWorks operative system. Up to now, we were calling C functions from Labview, but we also need to do the opposite. - Can I call a VI from C/C++? - Can I access Labview global variables from C/C++? - Or is there a passive diagram, mapped to a C function, to be placed in a VI that is triggered by the C function? Alain -- _________________________________________________ Alain Migeon Please reverse alain and migeon for replying. On Oct 15, 9:20 am, Alain Migeon <migeon.al...@tdcspace.dk> wrote: > Hi > > My question is about how to call Labview VI/Global variables from C/C++. > > We have a cRIO-9012 that runs under the VxWorks operative system. > > Up to now, we were calling C functions from Labview, but we also need to > do the opposite. > > - Can I call a VI from C/C++? > - Can I access Labview global variables from C/C++? > - Or is there a passive diagram, mapped to a C function, to be placed in > a VI that is triggered by the C function? > > Alain > > -- > _________________________________________________ > Alain Migeon > Please reverse alain and migeon for replying. The two main methods for accessing the functionality of a Labview VI from external C/C++ code are ActiveX and Application Builder. ActiveX is available only on the Windows Platform. Application Builder comes with the P...

Is .NET DLL better to use than C/C++ DLL in labview?
I was wondering which one runs more natively in LabView8.5. C/C++ DLL or DLL by .NET ?Thank you. You can use either kind, but .NET assemblies are much easier to work with. You can find some tutorials on working with&nbsp;both by searching this site. ...

Use a wrapper to build a C++ Dll that calls a C++ .lib and Use the Dll is LabView
Hi All, &nbsp; I need to access some functions in a C++ .lib within LabView, but has no source code for the library.&nbsp; Can I build a Dll in Visual C++ that calls this library, then have LabView calls the Dll? If so, how different is building this Dll compared to building a Dll from a .cpp file?&nbsp; I am new to C++, could some one suggest how to&nbsp;use the .lib in Visual C++ 6.0 studio to build the Dll? &nbsp; Thanks for&nbsp;your help. Bryan Hi Emilie, &nbsp; Thank you for the help. Sorry for the late reply here, got caught into a few busy projects. I do have a difficult LabView problem and hope get some help.&nbsp; I need to move a pop up window by using lvuser32.llb. Are pop up windows from labview or other application such as written by C++ are the same with regular windows?&nbsp; Also, is there a way to find the window names of all open windows including not only labview vi windows but also windows from other applications?&nbsp; Some of my non labview applications will have their names changed dynamically during execution. I need to know their exact name&nbsp;to access them in a vi.&nbsp;&nbsp; &nbsp; Regards, Bryan&nbsp; BryanL wrote:Hi Emilie, &nbsp; Also, is there a way to find the window names of all open windows including not only labview vi windows but also windows from other applications?&nbsp; Some of my non labview applications will have their names changed dynamically during execution...

how can i access the C++ DLL source code of labview? how can I creat my own DLL in C++ etc.
I wnat to know how to access the c++ source code of those DLL for labview? and HOW can I creat my own DLL in C++, or VB and use them in LABVIEW? fenny; Well, you don't source code inside a .dll file. You access functions. All the information about how to access .dll functions, and how to create your own .dlls so you can access them from LabVIEW, are in the following manual: <a href="http://digital.ni.com/manuals.nsf/websearch/8D930295FFBF9F7686256D2C00624728?OpenDocument&node=132100_US">Using External Code in LabVIEW</a> That manual should be included with La...

Debugging C vs debugging C++
I was browsing the web pages of les haltton, a software engineering professor ( http://www.leshaltton.org ) and I found this data in htp://www.leshatton.org/Documents/dross_2006.pdf < begin quote > Summary of known measurements � C++ OO systems have comparable defect densities to conventional C or Pascal systems. � Each defect in a C++ OO system takes about twice as long to fix as in a conventional system. This is true for both simple defects AND difficult ones. The whole distribution is right shifted. � Components using inheritance have been observed to have 6 times the defe...

labview and C++ dll
Hi, I&nbsp;have a vi with&nbsp;Call Library Function node call a visual C++ dll.&nbsp;And use this vi in my labview project. Somehow it seems to work for first time only. the next time it get to this Vi, the system seems to hang up. Any ideas? ...

C++ DLL in LabVIEW
I have a DLL function call whose definition is void * OpenComm(Char* device, char autodet, struct settings* setgs); &nbsp; struct defn is: &nbsp; struct settings { long baud; char protocol; } &nbsp; how can i configure my Call Library function node for this? i have used this before, but i have not interfaces with void* and structs! Hi rkpat, There's probably another way, but I pass cluster-information as an array (see attached.) Baud may need the byte-order switched - if your DLL wants it in <a href="http://en.wikipedia.org/wiki/Endianness" target="_blank">Big-endian</a> format. The Device (char *) input can probably be re-defined as a C-string - then the explicit zero-termination won't be necessary (LabVIEW will take care of it). As you know, CLF calls can be tricky, hopefully this is at least close to what you'll need. :smileywink: Cheers! CLF.vi: http://forums.ni.com/attachments/ni/170/237907/1/CLF.vi ...

debug m-file dll from Visual C++ Studio
I currently use MATLAB 6.5. I made a dll file by compiling an m-file with mcc. Then I call the dll function from my C program (Visual C++ 6.0). It worked fine when m-file was simple, where little parameters are passed. But as the m-file program becomes more complex, many parameters are sent and often (almost always) cause errors, probably mainly the dimension and size mismatches with mxArray variables. I find it practically impossible to identify the errors with trial and error approaches. Is ther any way I can use debugger, and set break points in a displayed dll code? Young Park ...

Creating a DLL in labview that interacts with a DLL in C++
I?m creating a DLL in LabView that will interact with a DLL created in C++. I don?t have control in the C++ DLL. &nbsp; Both DLLs would pass a big amount of data as strings between them, for that it is necessary to allocate memory to store information in one dll and read it in the other and viceversa. The first time I will call the other DLL,&nbsp; with this function : &nbsp; long in texts ( unsigned char *name, void *id) I would pass them a pointer pointer to an ASCII string &nbsp;(name) and a pointer to an unspecific data structure (id). The id would then be passed to me by his DLL whenever they use one of the functions implemented on my dll. &nbsp; What I don?t know is what to pass as a void*id? What are they expecting? A number? A cluster? &nbsp; The other thing I don?t know is how to allocate memory in labview and write there information, such as a string, and then tell the other DLL to look for the information at that DLL, and viceversa. I hope I made my self clear, hope somebody can help me, and please indicate me if you need more information ...

C and C++ colloding! // How to debug a DLL?
Hi, I have a bigger VC++6.0 project which is successfully compiled into a DLL. It's compiled with full conformance with the ANSI C standard (symbol __STDC__). I had to combine this code with my one (C++) which worked fine for itself. After integrating my code one into one of the classes the the compiler threw errors. They disappeared after the compiler option __STDC__ was removed. My code is C++ code (and can't be rewritten), thus the errors when compiled with __STDC__ activated. An additional __ANSI_CPP__ is defined in the DLL project as well, but doesn't seem to harm or benefit ...

how to create a .dll file for LabVIEW 8.5 in visual C++ .net 2003
I want to know the detailed procedure for creating a .dll file in Visual C++ 2005 or Visual C++ .NET 2003. I have a C code which i like to compile but all the steps i have followed from the NI site result in some or the other error. Please help me witrh it. &nbsp; Hi! &nbsp; I'm not really familiar with the process (and perhaps the forums at microsoft might be better suited to handling how to build a dll in their environment), but I imagine you were talking about our <a href="http://zone.ni.com/devzone/cda/tut/p/id/3056" target="_blank">Building a DLL with Visual C++</a>&nbsp;article?&nbsp; Are you seeing errors in LabVIEW as you try and use the .dll once it has been built?&nbsp; If so, what are those errors? ...

labview vs visual basic vs visual C
Hi, &nbsp; I am hoping to get advice about LabVIEW vs Visual&nbsp;Basic/C for developing education software.&nbsp; I have programmed in LabVIEW for test and measurement applications.&nbsp; I have also programmed a couple of short programs in C , but have never programmed in Visual C or Visual basic.&nbsp; I want to develop software for educational purposes for students with special needs such as spelling and reading comprehension programs.&nbsp; These programs would involve a lot of displaying text, graphics and sounds to the students and measuring student inputs via text or clicks on buttons to determine whether they need additional&nbsp;help from the computer to learn the lessons.&nbsp; I was was wondering if anyone has the knowledge to advise using LabVIEW vs Visual C vs Visual Basicfor such programming tasks? &nbsp; I am guessing that Visual C and Visual Basic&nbsp;may have more flexibility in displaying text, graphics, sounds etc. since&nbsp;this is mostly what&nbsp;they used for.&nbsp; On the other hand, I am famliar with the ease of coding in LabVIEW for test/measurement applications&nbsp;but wondering if there might be limitations or difficulties in programming with LabVIEW for a more general purpose windows application such as the education software I am planning.&nbsp;&nbsp; I would have to learn Visual C or Visual Basic, but if those environments would be easier&nbsp;or better&nbsp;in ...

Error while using LabVIEW 8.2.1 Dll from Visual C++ 6.0
I am getting an error&nbsp;while using a LabVIEW 8.2.1 dll from Visual C++ 6.0 application. This is what I am doing: 1) Created a dll using LabVIEW 8.2.1 (I used a tutorial from NI knowledge base: "Creating DLLs from 6.0i". It is a temperature conversion VI; input DegreeF and get DegreeC out). Instead of LabVIEW 6.0i, I used 8.2.1. It created the dll Convert_Temp.dll successfully. 2) Then I created a Visual C++ 6.0 application (used a tutorial from NI knowledge base: "Calling a DLL from Microsoft Visual C++ that was Generated by LabVIEW 6i). I could build the project and create an executable application F_To_C.exe. 3) Then copied the LabVIEW dll Convert_Temp.dll into the folder where F_To_C.exe resides. Using windows explorer, went into that folder, and executed the application.&nbsp; I got the following error: &nbsp; System Error 998 while loading the LabVIEW run-time engine (C:\Program Files\National Instruments\Shared\LabVIEW Run-Time\8.2\lvrt.dll). Convert_Temp requires a version 8.2.1 (or compatible) LabVIEW Run-Time Engine. Please contact the vendor of Convert_Temp to correct this problem. &nbsp; I checked the folder: C:\Program Files\National Instruments\Shared\LabVIEW Run-Time\8.2\. It has the file lvrt.dll. &nbsp; So why am I getting this error? &nbsp; GKB &nbsp; &nbsp; &nbsp; ...

Is it possible to manipulate and use variables and parametres from a .dll converted progr. (C++) with a labview written progr.
Hi fellows I got a program written in C++ and I want to comunicate with it and use some parametres&nbsp;and variables from&nbsp;it, to handle these&nbsp;with my labview written program. I just want to be shure if it is possible?? &nbsp; Zamzam &nbsp; ...

Using labview dll in C#
Hi All, I m trying to import a labview dll in C#. The functions exported by the dll return invalid results when used in C#.Net application. However when the same dll is used in simple C/C++ application, they return expected results. Are there any compatibility issues between C# and labview? Please let me know if there is a solution for the same. Thanks and Regards, Gouri ...

calling LabVIEW dll from C#
Could somebody post a fully working C# example of calling a function from a LabVIEW generated dll with passing strings and integers in and a couple of strings out? What should be settings when creating the dll, of course (which convention, how to pass)? ...

C to Labview
Hi all, &nbsp; I am fairly new to Labview and I have been given a project at work to convert an existing c code to labview. I will provide the section of the code That is giving me problems to see if any of you could assist me in writing it in labview. &nbsp; void CPokey2Dlg::FindN(unsigned char Channel) { double FreqOne,NFrac; int NReg; int iDividend; NFrac = FreqOne/(double)2.8e6; NReg = int(NFrac+.5); m_EditChannelTwo = NReg; UpdateData(false); // if (NReg &gt;= NFrac) NFrac = (double)262144*(NFrac - (double)NReg); // else // NFrac = int((262144*((double)NReg-NFrac))+.5); if (NFrac &lt;0) NFrac = int(NFrac -.5); else NFrac = int(NFrac +.5); // m_EditChannelTwo = NFrac; // UpdateData(false); &nbsp; NReg = NReg - 32; iDividend = (int)NFrac; m_EditChannelTwo = NFrac; UpdateData(false); // format for register SKY72300[0] = (unsigned char)(NReg &gt;&gt; 8); SKY72300[0] = SKY72300[0] &amp; 0x01; SKY72300[1] = (unsigned char)NReg; SKY72300[2] = (unsigned char)(iDividend &gt;&gt; 16); SKY72300[2] = SKY72300[2] &amp; 0x03; SKY72300[2] = SKY72300[2] | 0x10; SKY72300[3] = (unsigned char)(iDividend &gt;&gt; 8); SKY72300[4] = 0x20; SKY72300[5] = (unsigned char)(iDividend); } &nbsp; Thanks ...

labview UI in Visual C
I'm in the process of trying to merge a LabVIEW app into a third party&nbsp;application.&nbsp; In order to interact with this other application, I need to create custom COM objects that inherit from their provided classes: no fun, but fine.&nbsp; I'm having trouble getting LabVIEW windows&nbsp;to interact properly with the windows from the main app.&nbsp;In one case, for example, my COM function is passed a HWND from the app that I'm supposed to use as the parent window for a dialog.&nbsp; They of course expect me to derive from CDialog or a property page, but I want to use a LV window.&nbsp; I'm able to create LV windows by calling VIs out of a LV built DLL, but they don't behave properly with the app because they don't&nbsp;insert properly&nbsp;into the app's window hierarchy.&nbsp; Windows that are set to be modal in LV are not modal to the app.&nbsp; Plus, the other app windows don't redraw properly when the LV windows are moved in front. &nbsp; As a work around, I tried creating a CDialog window in VC, made my LV window a child to it using the SetParent Windows function and then maximized the LV window to take up the bounds of the dialog.&nbsp; This nearly worked since the Dialog behaves properly with the app, but the LV window then fails to redraw itself when things pass in front of it. &nbsp; I had the idea of trying to embed the LV remote panels activex control, but after reading a...

build a DLL in LabVIEW &amp; Use the DLL in LabVIEW
I am trying to build a DLL for the simple vi with LabVIEW and want to use the DLL in LabVIEW. is it impossible? &nbsp; I wrote a vi and it have 2 terminals. one is the input for numeric dbl data type and one another is the output for numeric dbl 1D array data type. &nbsp; It was built with the Application builder for LabVIEW 8.0 and DLL was created successfully. &nbsp; I want to use this DLL&nbsp;in new vi with LabVIEW. &nbsp; Call library function used. I wrote a new vi to use that DLL. &nbsp; In config dialog I config each parameter for dll and connected terminals. but it doesn't work &nbsp; pleas refer to the attatched file and let me know what I missed. &nbsp; Array1D.zip: http://forums.ni.com/attachments/ni/170/235977/1/Array1D.zip ...

Calling a LabView DLL from a Labview VI
Hi, I have a vi that is calling a Labview DLL and they both have a same subVI. If I drop that SubVI into the block diagram first then drop in the Call Library Function Node, when I run the VI, the DLL would not work and it did not give me any error. Does anyone know how fix this problem with Labview? or is there some configuration that I can force the all of that SubVI points into the DLL. Thanks for your help, Dan ...

[ann] C/C++ interpreter Ch for labview released
Ch is a free C/C++ interpreter. The source code for embeding Ch into labview is now available from the link below http://iel.ucdavis.edu/projects/chlabview/ More about C/C++ interpreter Ch can be found at http://www.softintegration.com Any comments or suggestions are welcome That's realy cool thanks, ...

Visual C++ by-passed when debugging a c++ MEX-file
Hi all, I used matlab 2007b, vs2003 as compiler and debugger. I generated my dynamic library(filename.mexw32) for matlab from c++. It was 'mex -g' compiled successfully, from 2 cpp files and a couple of headers. I want to debug using visual studio 2003, I followed the instructions here. http://www.mathworks.com/support/solutions/data/1-1BUHC.html?solution=1-1BUHC However, every time I set up the breakpoint and debug (F5) from VS2003, the matlab 2007b got launched and vs2003 (strangely) went out of debug mode. If I ran matlab routine to call the mexw32' library, it won't stop at my breakpoint. This 2007b+vs2003.net method worked fine before, to other projects (all of which contains only one source code file). I suspect this must have to do with the project settings. But I cannot seem to find out what is that. I used the same setting as those successful projects. Any help will be much appreciated. Thanks. Hello, I had this problem and finally I remarked there are two matlab.exe. One in C:\Program Files\MATLAB\R2007b\bin and the other in C:\Program Files\MATLAB\R2007b\bin\win32. When I configured my MSVC, I choosed the first one instead of the second one ... Maybe this is the key of your problem. Vanderbilt <shufei.fan@gmail.com> wrote in message <56b8a77e-f48b-4549-b2d4- e9561b6f20b8@u10g2000prn.googlegroups.com>... > Hi all, > > I used matlab 2007b, vs2003 as compiler and debugger. > I generated my dynamic library(filena...

change a LabVIEW array outside LabVIEW and keep updated in LabVIEW
change a LabVIEW array outside LabVIEW and keep updated in LabVIEW hi, I am Interfacing a FrameGrabber with LabVIEW using a frame grabber SDK(dll). The memory managment of this FG allow you to allocate your own Array and to give a pointer to this Array to the memory manager. Then when you acquire with the frame grabber, the acquired image will be directly accessible in your array. 1.I give to the FG memory manager a pointer to the Labview array through a SDK Dll function. 2. I run the acquisition 3. I display the array My problem is that the Array is allways displayed with it initial val...

Web resources about - Debugging a C++ dll from LabVIEW - is it possible to debug both in labVIEW and then in the C++ environment, say Visual Studio? - comp.lang.labview

Environment - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

New Queensland environment law takes aim at Clive Palmer
The State Government has moved to force mine and refinery owners to pay for any environmental clean ups if their business goes bust, in the wake ...

'Very poor': Environment office opposed miners using rehabilitation work as biodiversity offset
New documents show how coal firms won the right to claim planting of grass or trees on old mine sites as conservation offsets for future woodland ...

Environment Canada issues special weather statement over potential spring storm for Halifax
... Winnipeg Canada World Views Entertainment Life Food Money Health Drive Sports Your Home Horoscopes Games Features Contests News / Halifax Environment ...

SIOS updates its machine learning solution for virtual environments
... IT analytics last year, SIOS Technology Corp has released regular updates to help maximize the availability and efficiency of virtualized environments. ...

How to easily raise $11.5 million in a bad startup funding environment, according to the CEO of Bustle ...
The digital media boom may not be over just yet. Bustle, a media startup focused on creating content for millennial women, has raised $11.5 ...

Kasich: Trump creating 'toxic environment'
Ohio Gov. Kasich denounced his billionaire businessman opponent on Saturday in Sharonville.

What Does Canada’s Budget Say About The Environment?
Originally published on the ECOreport The environmental community has been watching Justin Trudeau’s Liberals closely, to see how they live up ...

NPR Is Sending Reporters To Hostile Environment Training To Prepare To Cover Trump
NPR Is Sending Reporters To Hostile Environment Training To Prepare To Cover Trump

Hyperscale Environments Pressure Server OEMs
The Googles, Facebooks and Amazons of the world are buying a lot of servers, and many of them are coming from smaller ODMs.

Resources last updated: 3/28/2016 10:33:52 PM