LabView 7.1 DLL in C# (VS2010) Hangs

Hello,
This is my first time posting here, hopefully i can find some help.
I created a DLL in Labview 7.1 to validate a button lock system for a Clamp. I tried to call the
DLL using C# but everytime the DLL funcion is called C# just hangs.
I added some messages accross de DLL function, but none show up when called from C#.
It seems that it hangs before being able to start the function.
I tried using the DLL in VB.net it worked fine on the first try.
I've tried compiling the DLL on both stdcall and C calling conventions.
Using DLL import on C#
.NET Framewok used is 4.0
PC is 32bit system.
Any ideas what might be happening here?

Hi Javier-T,
Reviewing the Code there are several things that we could do to minimize the error source in this application. First I would recommend a "State Machine" Architecture because of the nature of the application and what you are trying to achieve. You can find more information in the next Link
You are opening in two places in the code references to the same DAQmx tasks without stoping them the first time you use them. This could be causing an error.
Secondly there is nothing timing your acquisition loops, I suggest using a timing function to give the While Loops a Loop Rate.
To test your communication between C# and LabVIEW I would recommend creating a DLL that only performs a sum and call it from C# to check communication between programs.
We're setting up a PC to check any compatibility issue but that shouldn't be a problem if it already worked for you once.
We'll be waiting fot the test results.
Juan Arguello
National Instruments México y Latinoamérica
Applications Engineer

Similar Messages

  • I want to use a VposCOMAPI.dll, written by vs2010,  from PB9 or later.

    I want to use a VposCOMAPI.dll, written by vs2010,  from PB9 or later.
    I use the following code:
    OLEObject obj
    int ret_code, ret_Code2
    obj = create OLEObject
    String Auth_code, Rsp_code,  Rsp_msg
    ret_code = obj.ConnectToNewObject("VposCOMAPI.dll")
    if ret_code <> 0 then
       destroy obj
       messagebox("error", "Error !" + string(ret_code))
       return
    else
       obj.apiInit()
       obj.CARD_NO="9999111188882222"
       obj.MERCHANTID = "0909090909"
       obj.executeAuth()
       ret_Code2 = obj.AUTH_RETCODE
       if ret_Code2 = 0 then
           Auth_code = obj.APPROVE_CODE
           Rsp_code = obj.RESPONSE_CODE
           Rsp_msg = obj.RESPONSE_MSG
           messagebox("OK", "OK !")
       else
           messagebox("error2", "Error2 !")
       end if
       destroy obj
    end if
    I got the ret_code “ Errorcode  -2 ( Class name not found )”.
    Anybody could help me ?
    Could I use the VposCOMAPI.dll in this way ?
    Thanks !
    Jack
    PS : The VposCOMAPI.dll works in VS2010
    1 Add Reference --> Browse
    2 VB sample code
    Public Class Form1
    Dim ac As New VposCOMAPI.ApiClient
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim retCode As Integer
    rspCode.Text = ""
    rspMsg.Text = ""
    approveCode.Text = ""
    txnNo.Text = ""
    txnDate.Text = ""
    apiResult.Text = ""
    ac.setPORT(443)
    ac.setLogFile("D:\workTemp\vposApi.log")
    ac.setURL("nccnet-vpostest.nccc.com.tw", "/vposMert/servlets/apiControl")
    ac.setMERCHANT_ID(merchantId.Text)
    ac.setTERMINAL_ID(posId.Text)
    ac.setEXPIRE_DATE(expireDate.Text)
    ac.setCARD_NO(cardNo.Text)
    3 C# sample code
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Diagnostics;
    using System.IO;
    using VposCOMAPI;
    namespace testCSapi
    public partial class Form1 : Form
    public Form1() {InitializeComponent();}
    private void send_Click(object sender, EventArgs e)
    int retCode = 0;
    ApiClient ac = new VposCOMAPI.ApiClient();
    ac.setURL("nccnet-vpostest.nccc.com.tw", "/vposMert/servlets/apiControl");
    ac.setLOGFILE("D:/workTemp/vpos/log/testCSapi.log");
    ac.setMERCHANT_ID(merchantId.Text);
    ac.setTERMINAL_ID(posId.Text);
    ac.setEXPIRE_DATE(expireDate.Text);
    ac.setCARD_NO(cardNo.Text);

    Hi,
    A few things to remember. They must be 32-bit ComVisible or COM Interop registered assemblies.
    You need to use the ProgId to connect to; have you checked if they were visible in the browser?
    As Jacob mentions,
    These have been discussed before by Bruce, particularly in the PowerBuilder Deveopment Center and in other places.
    A few more references:
    http://scn.sap.com/message/14156871#14156871
    http://scn.sap.com/community/developer-center/powerbuilder/blog/2013/02/28/using-net-assemblies-with-powerbuilder
    http://scn.sap.com/community/developer-center/powerbuilder/blog/2014/07/19/calling-net-assemblies-from-powerbuilder-classic-win32-via-powershell
    http://pbdj.sys-con.com/node/397016
    http://pbdj.sys-con.com/node/258395
    Ben

  • Does anybody can give me a simple example about the labview programme calling dll ?

      Does anybody can give me a simple example about the labview programme calling dll ?And the dll is also writed  by using labview .I just want to study  the process of the labview programme calling dll file.Thank you!

    Hi,
    Please click on "Find Examples" in the "Getting Started Window"
     A window named "NI Example Finder" will pop up.
     In this go to "Search" tab
    Type "DLLs"
    You will see a lot of examples. 
    If you're online, you'll see user examples too...

  • Labview 6 xmathtypes.dll missing

    Hi,
         I am trying to run Matlab script (Matlab version I think it is the latest one) from Labview 6.1. Initially it wasn't running. Then I came across this thread
    http://digital.ni.com/public.nsf/websearch/CE309627064A3D5686256A9C005B0A5F?OpenDocument
    and replaced the two script files (hiqscript.dll & matscript.dll) (in Labview6.1/resource/script) with three new files mentioned in that thread (matscript.dll, xmathscript.dll & XmathTypes.dll). Created a matscript with code given in Labview help
    a=rand(50)
    surf(a)
    After running the code it shows me the plot. So everything works up to that point.
    The problem is:
    Whenever I right click on the matscipt (to add input/ouput) (even if I right click on a blank matscript), it gives me this error
    " Labview.exe unable to locate component"
    "This application has failed to start because XmathTypes.dll wasn't found. Re-installing the application may fix the problem."
    Also somebody metioned in other thread to place a copy of that dll file (xmathtypes.dll) in system 32 folder. But not any help. I have already repaired the labview 6.1 using the labview cd. But the problem is still the same.
    I have winows XP pro version installed on my desktop. I checked it on vista premium too. But the same error is popping up.
    In our lab we have labview 8.5 and in that everything works fine.
    But since all the drivers and code are written in labview 6.1. So I want this to be done in labview 6.1.
    Thanks
    Raj
    Message Edited by Tablet on 02-12-2009 01:09 AM
    Solved!
    Go to Solution.

    It finally worked.
    Solution:
    Placed all the three dll files in the system 32. After thateverything works fine

  • Can LabVIEW call a DLL built with VS(2005) C++ with /CLR and Without an Entry Point

    My project requires me to convert a C++ program to a DLL and having it called by LabVIEW. Due to the complexity of this C++ program (converted from fortran using f2c -C++ option), it cannot be compiled without using /clr option.  I did build the application standalone (/clr), and it functioned fine.  When I build it into DLL using VS2005, I was forced to use No Entry point option and without using DllMain in the C++ code. Eventually the DLL was built without error.  But after I call it from LabVIEW, I was not getting calculated results as expected.  I added a testing function to the C++ code of the DLL and just try to modify a parameter, it will not, but only return the input numbers.  I was passing data by pointer and not by value, so I expect this parameter output be modified.  I suspect that the DLL didnt get executed at all as it has no entry point specified.
    Am I on the right track to approach this task, or I am heading to totally wrong direction here?   I believe due to the fact that my C++ was from f2c and use vsf2c.lib and so on, the code is managed code, so that a regular DLL cannot be built from it with an entry point. How can LabVIEW call such a DLL? Am I right on that?  I really need your advice here for a right approach to this problem and possible implementation "watch outs"...Thanks!
    Bryan

    Hi...Finally I was able to compile my code with an entry point defined and without using /clr.  I can also call this DLL from LV and got back a variable from a little test function added to the DLL.  But the function that was used for my main application in the DLL crashed LV and I got a pop up box from Microsoft Visual C++ Runtime Library: Runtime Error! "This application has requested the Runtime to terminate it in an unusual way, please contact the application's support team for more information".  In Visual Studio I also got the following message: (I eliminated most of the "No symbols loaded" messages that are not errors but just info.)  I would apprciate if someone can take to look with your more "experienced eyes", many thanks! Bryan.
    'LabVIEW.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll', No symbols loaded.
    'LabVIEW.exe': Loaded 'C:\WINDOWS\system32\xpsp2res.dll', Binary was not built with debug information.
    'LabVIEW.exe': Loaded 'C:\Program Files\National Instruments\Shared\nicont.dll', Binary was not built with debug information.
    'LabVIEW.exe': Loaded 'C:\Program Files\National Instruments\Shared\NICONTDT.dll', Binary was not built with debug information.
    'LabVIEW.exe': Loaded 'C:\Program Files\National Instruments\LabVIEW 8.5\resource\nitaglv.dll', No symbols loaded.
    'LabVIEW.exe': Loaded 'C:\WINDOWS\system32\lkbrow.dll', No symbols loaded.
    'LabVIEW.exe': Loaded 'C:\WINDOWS\system32\lkrealt.dll', No symbols loaded.
    'LabVIEW.exe': Loaded 'C:\Program Files\National Instruments\LabVIEW 8.5\resource\Framework\Providers\lvdaq.mxx', No symbols loaded.
    'LabVIEW.exe': Loaded 'C:\Program Files\National Instruments\LabVIEW 8.5\resource\Framework\Providers\lvdesktop.mxx', No symbols loaded.
    'LabVIEW.exe': Loaded 'C:\Program Files\National Instruments\LabVIEW 8.5\resource\Framework\Providers\lvfp.mxx', No symbols loaded.
    'LabVIEW.exe': Loaded 'C:\WINDOWS\system32\mfc71.dll', No symbols loaded.
    'LabVIEW.exe': Loaded 'C:\WINDOWS\system32\MFC71ENU.DLL', Binary was not built with debug information.
    'LabVIEW.exe': Loaded 'C:\Program Files\National Instruments\LabVIEW 8.5\vi.lib\FieldPoint\SubVIs\FPLVMgr.dll', Binary was not built with debug information.
    'LabVIEW.exe': Loaded 'C:\Program Files\National Instruments\LabVIEW 8.5\resource\Framework\Providers\lvfprt.mxx', No symbols loaded.
    'LabVIEW.exe': Loaded 'C:\Program Files\National Instruments\LabVIEW 8.5\resource\Framework\Providers\LvProjectProxy.mxx', No symbols loaded.
    'LabVIEW.exe': Loaded 'C:\Program Files\National Instruments\LabVIEW 8.5\resource\Framework\Providers\LvRealTimeCoreProvider.mxx', No symbols loaded.
    'LabVIEW.exe': Loaded 'C:\Program Files\National Instruments\LabVIEW 8.5\resource\Framework\Providers\MVEProvider.mxx', No symbols loaded.
    'LabVIEW.exe': Loaded 'C:\Program Files\National Instruments\LabVIEW 8.5\QtCore4.dll', Binary was not built with debug information.
    'LabVIEW.exe': Loaded 'C:\Program Files\National Instruments\LabVIEW 8.5\QtXml4.dll', Binary was not built with debug information.
    'LabVIEW.exe': Loaded 'C:\Program Files\National Instruments\LabVIEW 8.5\QtGui4.dll', Binary was not built with debug information.
    'LabVIEW.exe': Loaded 'C:\Program Files\National Instruments\LabVIEW 8.5\resource\Framework\Providers\mxLvProvider.mxx', No symbols loaded.
    'LabVIEW.exe': Loaded 'C:\Program Files\National Instruments\LabVIEW 8.5\resource\Framework\Providers\nimxlcpp.mxx', No symbols loaded.
    'LabVIEW.exe': Loaded 'C:\WINDOWS\system32\nimxlc.dll', No symbols loaded.
    'LabVIEW.exe': Loaded 'C:\Program Files\National Instruments\LabVIEW 8.5\resource\Framework\Providers\variable.mxx', No symbols loaded.
    'LabVIEW.exe': Loaded 'C:\Program Files\National Instruments\LabVIEW 8.5\resource\Framework\lvMax.dll', No symbols loaded.
    'LabVIEW.exe': Loaded 'C:\Program Files\National Instruments\MAX\UI Providers\FieldPoint71.dll', No symbols loaded.
    'LabVIEW.exe': Loaded 'C:\Program Files\National Instruments\LabVIEW 8.5\resource\MathScriptParser.dll', Binary was not built with debug information.
    'LabVIEW.exe': Loaded 'Z:\bli\development\projects\galfitDLL\Debug\galfitDLL.dll', Symbols loaded.
    'LabVIEW.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700\msvcr80.dll', No symbols loaded.
    'LabVIEW.exe': Loaded 'C:\Program Files\National Instruments\LabVIEW 8.5\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.
    The thread 'Win32 Thread' (0xf94) has exited with code 0 (0x0).
    The thread 'Win32 Thread' (0x90c) has exited with code 3 (0x3).
    The thread 'Win32 Thread' (0xfd0) has exited with code 3 (0x3).
    The thread 'Win32 Thread' (0x284) has exited with code 3 (0x3).
    The thread 'Win32 Thread' (0xdac) has exited with code 3 (0x3).
    The thread 'Win32 Thread' (0xa98) has exited with code 3 (0x3).
    The thread 'Win32 Thread' (0x528) has exited with code 3 (0x3).
    The thread 'Win32 Thread' (0x614) has exited with code 3 (0x3).
    The thread 'Win32 Thread' (0xa5c) has exited with code 3 (0x3).
    The thread 'Win32 Thread' (0xebc) has exited with code 3 (0x3).
    The thread 'Win32 Thread' (0x5cc) has exited with code 3 (0x3).
    The thread 'Win32 Thread' (0x700) has exited with code 3 (0x3).
    The thread 'Win32 Thread' (0xcf0) has exited with code 3 (0x3).
    The thread 'Win32 Thread' (0xc7c) has exited with code 3 (0x3).
    The thread 'Win32 Thread' (0x4c8) has exited with code 3 (0x3).
    The thread 'Win32 Thread' (0xa4) has exited with code 3 (0x3).
    The thread 'Win32 Thread' (0x52c) has exited with code 3 (0x3).
    The program '[804] LabVIEW.exe: Native' has exited with code 3 (0x3).

  • Call function in LabView from a DLL, then access global variable from DLL

    I have created a DLL in LabWindows with a function and a structure.  I want to call the function from within LabView and then access the global structure.  I am able to call the function from the DLL with a "Call Library Function Node" and can access the return value, but I cannot figure out how to access the global structure.  The structure is declared in the DLL header file with __declspec(dllimport) struct parameters.
    Is there any way of accessing this structure without using the Network Variable Library?
    Solved!
    Go to Solution.

    dblok wrote:
    When you say "access to" or "the address of" the global variable, do you mean to pass the variable as an argument to the function call in the DLL?  If so, then I was not really sure how to pass a cluster from LabView by using the "Call Library Function Node".
    Yes, that's exactly right.  I would include a pair of helper functions in the DLL to read and write the global variable.  Alternatively you might write separate helper functions for each field inside the global structure, depending on the number of fields and whether you want to do any validation on the values.
    You can pass a cluster by reference to a function that expects a struct by setting the parameter to Adapt to Type, so long as the cluster does not contain any variable-length elements (strings or arrays).  The cluster needs to match the struct exactly, and sometimes that involves adding extra padding bytes to make the alignment work.  Variable-length elements in LabVIEW need to be converted to clusters containing the same number of elements as the struct definition (for example, if your struct contains char name[12], you would create a cluster of 8 U8 values, and you could use String to Array of Bytes followed by Array to Cluster to convert a LabVIEW string into that format).  If the struct contains pointers it gets more complicated, and it may be easier to write functions in the DLL to access those specific elements individually.
    If you can't get this working or need help, post your code and an explanation of the error or problem you're seeing.
    EDIT: it is also possible to include a single function in the DLL that returns the address of the global variable, which LabVIEW can then use to access and modify the data, but that's more complicated and likely to lead to crashes if you don't get the memory addressing exactly right.

  • Build a DLL in LabVIEW & 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?
    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.
    It was built with the Application builder for LabVIEW 8.0 and DLL was created successfully.
    I want to use this DLL in new vi with LabVIEW.
    Call library function used. I wrote a new vi to use that DLL.
    In config dialog I config each parameter for dll and connected terminals. but it doesn't work
    pleas refer to the attatched file and let me know what I missed.
    Attachments:
    Array1D.zip ‏60 KB

    At first I kept scratching my head wondering why someone would want to do this. Create a DLL in LabVIEW to call it from LabVIEW. Seems redundant. But, perhaps it's an exercise or perhaps it's for testing the DLL...
    In any event, calling the DLL worked for me in 8.2. How are you configuring your Call LIbrary Function node? I have it set up as follows:
    return type: void
    iteration: Numeric, Signed 32-bit Integer, pass by value
    array1D2: array type, Signed 32-bit Integer, 1 dimension, "Array Data Pointer" format
    len: Numeric, Signed 32-bit Integer, pass by value
    Then I called the DLL like this:
    Message Edited by smercurio_fc on 03-16-2007 12:57 PM
    Attachments:
    Example_BD.png ‏2 KB

  • Labview crashing - running dll. motorbee

    Hi, I'm a student doing my masters project.
    I'm trying to run a dc motor with the driver board and software called motorway from pc-control.co.uk
    The board came with some software to run it and I have the dll. and header files.
    I have managed to import the files, however whenever I try and run the "set motors" vi, labview crashes for no reason and doesn't give an error code.
    The files can be found here https://www.dropbox.com/sh/0nbrx0ncyfg58y0/rKMy9iMAKE
    Thanks a lot for any help as I don't have much time to complete my project!
    Cheers
    Henry
    Attachments:
    mt.h ‏1 KB

    Hello, can you please post your LabVIEW code so I can look at the error in order to be able to help.
    Thank you

  • How do I call a LabView VI via dll to display its control panel in a tab of my uir in LabWindows

    Hi User Community,
    I am trying to build a LabWindows Top Level Control Panel to call individual LabView VI's, which have been compiled into a dll.
    I have no problem using the CmtScheduleThreadPoolFunction to start a new thread that calls these VI's however, I'm having trouble trying to get the display that comes up in it's own window to display in a tab of my existing UIR.
    I've compiled the DLLs to always display the VI Control Panel window when running - and usually it covers the whole screen you can't see the LabWindows window until the VI completes.
    Is there a definitive guide to LabWindows Windows/Panels/Tabs? Or does anyone have experience with this? Any help would be appreciated.

    Hello,
    I would suggest reviewing the Programming with Panels and Programming with Tabs CVI Help documents.  I think that this can be done with the LoadPanelEx function.  Let me know how it goes!
    As well, I found some example code to get you started.
    How to access individual controls within multiple tabs in CVI
    http://decibel.ni.com/content/docs/DOC-14187
    Regards,
    Shawn S. | NIC
    Instrument Driver/IVI PSE
    National Instruments

  • Can LabVIEW call a function from a .sys file or is LabVIEW limited to dll access?

    My vendor has sent me a .sys file with functions accessing their hardware.  Can i call these function from labview directly or do I have to wrapper the .sys with a dll?

    Well a sys file is a kernel device driver. LabVIEW does not have any direct way of accessing such a driver. The way kernel drivers are accessed is usually through a DLL which makes calls to WinAPI functions such as CreateFile(), ReadFile(), WriteFile(), CloseHandle() and DeviceIORequest(). Since these WinAPI calls are basically just DLL calls too, you could theoretically use the Call Library Node to call them and access the kernel device driver in such a way.
    However for any kernel device driver with more than one or two device driver calls, it will certainly be easier in terms of development, debugging and maintenance of the code, to write actually a dedicated DLL in C/C++ for this device driver and access that DLL from LabVIEW, especially if you consider the LabVIEW datatype limitations when designing the DLL interface (Basically this same DLL can then be called from any other Windows development environment, be it Visual Basic (similar datatype limitation as LabVIEW), Delphi, (Visual) C, LabVIEW or also various scripting environments like Python and Lua.
    Some of the necessary WindAPI calls are rather involved and pose quite a bit of trouble to get the parameter data right in LabVIEw.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Trouble when Labview call CVI DLL in after compiled to EXE

    Hi,
    I m developing a program by LabVIEW, and have to call a DLL, which developed by using CVI. 
    The UI of the DLL consist of a table and a listbox. 
    The DLL run smoothly but when I compiled the project to EXE, when the program call the DLL, the DLL won't show properly.
    The DLL UI only show the table, and the listbox has "disappeared".
    Any common known-problem caused it ? Please advise. Thanks a lot. 

    Hi Engwei,
    I'm not familiar with any such issue. Would it be possible for you to post the corresponding CVI and LabVIEW codes and the built DLL and executable? I would like to investigate this issue further. Also, what version of CVI and LabVIEW are you using?
    Thanks!
    Joshua de la Llana
    NI Applications Engineer

  • LabVIEW Error in DLL with pointor

    Hi,
    Sorry for my very very bad english....
    I developped a DLL in Visual C++. In this DLL, I call functions with pointors like parameters. The DLL works very well under Visual but when I call it under LabVIEW 7.1, LabVIEW gives an error when a pointor is read or modify.
    Can someone help me? Thanks
    Bonjour,
    J'ai développé une DLL sous Visual C++. Dans cette DLL, j'utilise des sous-fonctions en leur passant des pointeurs. La DLL fonctionne très bien sous VIsual C++ mais sous LabVIEW 7.1, LabVIEW retourne une erreur (l'exécution s'arrête) quand la DLL veut modifier ou lire un de ces paramètres.
    Avez-vous déjà rencontré ce problème et avez-vous réussi à le résoudre? Merci

    Ok Dynamik, I understand your answer. I knew these properties for "Call Library Function". The pointers aren't in LabVIEW but in the DLL: I pass under LabVIEW an parameter with "Type" adapt to the type in LabVIEW (I have a French LabVIEW and it says "Adapter au type"). This parameter is a cluster of clusters. In the DLL, it becomes a structure of structure with the same order as the cluster.
    Then, I pass the address of this structure in an other function of the DLL for modify it.
    Perhaps, it isn't a pointer's problem but an problem of cluster transfert. What do you think?
    Attachments:
    DLL call.JPG ‏356 KB

  • LabView interface with DLL that uses ActiveX

    I've written a DLL using Microsoft Visual Studio 2005. This DLL uses ActiveX (MSXML4.0). It works fine being called from other applications created in Microsoft Visual Studio. It crashes being called from LabView 7.1. By commenting out everything, I've figured out that it crashes on the call to ActiveX (no problems if this call is commented out). What should I do to make it work?
    I've tried using CoInitialize at the initialization of DLL; it didn't solve the problem.
    Additional information: DLL is using MFC in a Static Library, not using ATL, Character set = Not Set.
    The functions are defined in C calling convention (not __stdcall).
    Please help.
    Thank you.
    Irina Kaliniouk

    Thank you for your answer, but that is not the case. There is no UI in this DLL, but it is using some convinenient MFC classes, like threads, CString, etc. The threading really was not even involved in the example that crashed. The function that crashed was
    selectNodes on MSXML2::IXMLDOMNodePtr. Here is the code:
    MSXML2::IXMLDOMNodeListPtr selectNodes (LPCTSTR expression, MSXML2::IXMLDOMNodePtr pStartNode)
    CComBSTR quesryBstr (expression);
    return pStartNode->selectNodes (quesryBstr.m_str); //_bstr_t(expression));
    where the pStartNode was a root node of
    MSXML2::IXMLDOMDocument2Ptr m_pXMLDoc;
    hr = m_pXMLDoc.CreateInstance ("Msxml2.DOMDocument.4.0", NULL, CLSCTX_INPROC_SERVER);
    I commented out really everything except this function, so there was nothing to corrupt the memory or any other problems.  
    What can be of a problem?
    Thanks.

  • LabVIEW module use DLL

    In a teststand sequence file, it uses LabVIEW modules that call .NET DLL.  The DLL cannot be linked to the program.  If I were using LabVIEW only, I know that I can insert the DLL into a LabVIEW project and the VI in the project will know where the DLL are.  However, I am not sure about teststand.  Can someone help?  Thanks!
    Kudos and Accepted as Solution are welcome!

    Are you asking because you want to deploy the system? If yes, you should create a workspace and add the .NET DLL to your project as additional file. You can use the Deployment Utility to include the DLL in a MSI (Microsoft Installer).
    If you are NOT asking in the context of a deployment, please elaborate your question....
    Norbert
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Labview Crashes after DLL call

    HI All,
    I am working on to write a wrapper to a dll. The call to dll works fine an returns appropriate values but as soon as i close the VI the LabVIEW dev environment crashes. Any help on avoiding the same. I went through a lot of posts and tried varing the types of data being sent to the dll but still it gets crashed.
    the dll function I am using is of the prototype(with C type call convention)
    int functionName(Struct *cfg, UCHAR dNumber, UCHAR hTYPE)
    The UCHAR varables I am passing as Unsigned 8-bit Integers.
    For the structure I have made a cluster and am passing with Adapt to Type and as Handles.
    The DLL executes fine and the VI stops too, but as soon as i try to close the VI the dev environment crashes. Please help.
    Thanks.
    Solved!
    Go to Solution.

    While nathand is right about possible other errors, the Struct that you fail to tell anything about is a big flag pole for something that might be going wrong. Show us the C header declaring the structure and function and attach the VI you created (please no BMP or other image! They do say a picture says more than thousend words, but in the case of a LabVIEW diagram a picture is not enough to show all aspects of a VI, especially things like how the Call Library Node is configured!)
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

Maybe you are looking for