Private dll calling in Labview

Hi everyone, (refinement of my question)
I have two dlls. One contains public functions which I call from Labview. The functions in this dll call functions in the other (private) dll. However, how do I tell Labview where to find this private dll?
I have tried installing the dll in the system path directory. I have also put the dll in various different places relevant to Labview (e.g. in the directory of the Labview executable file). However, none seem to work (.
Is there an option in Labview where I can set paths to dlls?
Any help will be gratefully received.
Ciao,
Matthew Banham (colleague of Francois)

> I have two dlls. One contains public functions which I call from
> Labview. The functions in this dll call functions in the other
> (private) dll. However, how do I tell Labview where to find this
> private dll?
>
> Is there an option in Labview where I can set paths to dlls?
>
The problem is that the system loader is what handles the dependent
DLLs. Since LV knows about the primary DLL, we try multiple locations,
the path in the dialog, next to the VI, in the LV search paths, and
finally we ask the system to look in their places. LV doesn't know
about the dependent DLL, and it is up to the system to find it. I'd
recommend trying the system or windows folder again. That should be the
right solution.
An off the wall thought that might h
elp would be to add a dependency
directly into LV by making a DLL node that calls in the the "private"
DLL. You don't actually have to call it, you can place it in a case
structure with a constant set the other way. Anyway, this will cause LV
to look for the DLL, and I think it might help if nothing else works.
Greg McKaskle

Similar Messages

  • How to call a labview dll from excel-VBA?

    How to call a simple Labview DLL from Excel VBA?
    I have seen examples of DLL calls from VB but does it work the same way for VBA? I have 2000 excel and Labview 8.5. I created the DLL and tried to call it from VBA using the same type of code as in NI's website example(ofcourse its a bit diff with 8.5)
    http://zone.ni.com/devzone/cda/tut/p/id/...
    BUT it errors out when called from excel
    ERROR: The object invoked has disconnected from its client

    You would need to provide more details about the LabVIEW DLL, such as the prototypes of the functions (VIs) that you're trying to call, and your actual VBA code. Specifically, what object you're trying to create. You should also make sure the Run-Time Enginer is installed, as well as any required libraries such as the VISA Run-Time if you're using VISA. Have you made sure to enable the ActiveX server for the DLL?
    A search yielded the following items that you may wish to peruse:
    http://forums.ni.com/ni/board/message?board.id=170&message.id=261345&requireLogin=False
    http://forums.ni.com/ni/board/message?board.id=170&message.id=45099&requireLogin=False
    http://forums.ni.com/ni/board/message?board.id=170&message.id=299209&requireLogin=False
    http://forums.ni.com/ni/board/message?board.id=170&message.id=195846&requireLogin=False

  • Error in Calling a dll built in labview from Matlab standalone

    hello,
    The problem I encountered is in the use of the math interface toolkit. I
    created a dll which performs data fitting using a labview vi which i converted into a dll using the
    math interface toolkit.
    This dll is then called from a standalone matlab program. It works fine in the computer where I
    create the matlab standalone program and labview dll. Howerver when i export to another
    computer the matlab part runs fine but an error is reported when it tries to
    call the labview created dll.
    "One or more output arguments not assigned during call Parfit.dll"
    The files related to this problem in the math interface toolkit (the labview vi, the corresponding dll and the matlab .m and .fig files and the standalone exe are in the attachment and named MathITproblem.zip
    The matlab run time engine(for matlab 7) and labview runtime engine(ver 7.1) must be installed for this matlab file to run. the run time engines are downloadable from the web.
    Does any one know the source of this error or encountered it before?
    thanks
    Attachments:
    MathITproblem.zip ‏1263 KB

    Hi Srinivas,
    Just another note, I noticed that the Math Interface Toolkit version (MIT) 1.0 is not compatible with LabVIEW 7.1. You’ll need version 1.0.1. of the MIT toolkit in order for it to work with LabVIEW 7.1.
    The LabVIEW 7.0 lvanlys.dll is also attached. I had to rename it with a .txt extension, so you’ll want to delete the extension.
    Kileen
    Attachments:
    lvanlys.dll.txt ‏516 KB

  • Application crashes when calling DLL built with LabVIEW 2011

    Hello everybody,
    Our application calls DLLs built with LabVIEW 2010 SP1. We installed LabVIEW 2011 and built some DLLs. So far so good. If we start our application and run 2010 DLLs it still works fine. If we run a 2011 DLL just once no error happens, but if we try to run the same 2011 DLL our application crashes reporting the error below. I saved the code for 2010 version and built a DLL and it works fine. Does anyone know why?
    Thank you in advance.
    #Date: Fr, 16. Sep 2011 16:25:25
    #OSName: Microsoft Windows XP Service Pack 3
    #OSVers: 5.1
    #OSBuild: 2600
    #AppName: PasTA
    #Version: 11.0f2 32-bit
    #AppKind: AppLib
    #LabVIEW Base Address: 0x30000000
    16.09.2011 16:25:26.181
    Crash 0x0: Crash caught by NIER
    File Unknown(0) : Crash: Crash caught by NIER
    minidump id: 8a779b3f-51d7-4864-8e4d-6ab0195cd158
    ExceptionCode: 0xC0000005
    N
    0x3072C804 - lvrt <unknown> + 0
    0x3072CBB8 - lvrt <unknown> + 0
    0x7C864191 - KERNEL32 <unknown> + 0
    0x7C83AB50 - KERNEL32 <unknown> + 0
    0x00000000 - PasTA <unknown> + 0
    Attachments:
    error.PNG ‏11 KB

    On that note, you should be able to create DLLs in 2010 and run them with 2011, correct??  In my case, I have a 2010 built DLL (talking to sbRIO), most of the functions work when run in 2011, but a couple of them lock up LabVIEW on the desktop (but not the sbRIO), no lock ups happen with 2010 on the desktop.

  • Input parameter setting when calling a DLL(Built from LabVIEW and a kind of VISA communication driver) in Teststand.

    In labVIEW7.1 I wrote a COM port communications driver by using "VISA Write/Read". I put a string as the input of "VISA Write" and made it the input of the whole vi. Then I converted the vi into a DLL, which is called in Teststand3.1 by specifying DLL adapter. In "Edit C/C++ DLL Call" dialog, I pass a message of "60 6A 94 80 86 81" as the input parameter. My problem is I tried three kinds of methods to pass the message, see attached 1.jpg,2.jpg and 3.jpg. and found the first one sometimes doesn't work, the second work fine and the last doesn't work all time. I don't know why the first one and last one don't work well.
    Thanks!
    Jacky
    Attachments:
    31.jpg ‏38 KB
    11.jpg ‏36 KB
    21.jpg ‏49 KB

    Hi Srinivas,
    Just another note, I noticed that the Math Interface Toolkit version (MIT) 1.0 is not compatible with LabVIEW 7.1. You’ll need version 1.0.1. of the MIT toolkit in order for it to work with LabVIEW 7.1.
    The LabVIEW 7.0 lvanlys.dll is also attached. I had to rename it with a .txt extension, so you’ll want to delete the extension.
    Kileen
    Attachments:
    lvanlys.dll.txt ‏516 KB

  • How to access Call Back Functions using *.dll in the Labview?

    Hai,
    I am Pavan Ram Kumar Somu.
    I am new to Labview, currently I am working on MVB Interface.
    I need to access the API functions from *.dll file in Labview, as of now , I am doing this with Call function Library node in Labview but it does not support the following data types like
        1. Pointer Arguments(To which memory it points in Labview)
        2. function pointers Arguments
        3 .pointers in structures and pointer structures in structures and many other data types.
    Please Answer the below queries also:
    1. How to pass pointer arguments to API functions in DLL and how to collect pointer  
        return types from API functions in DLL
    2. How to pass structure arguments to API functions in DLL and how to collect structure
        return types from API functions in DLL
    3. How to use callback functions(nothing but function pointers) in Labview and how to
        collect callback fuctions return types from API functions in DLL
    I need your help while passing these datatypes to API functions in DLL from labview.
    Suggest me if there is any other alternative for implementing this task.
    I am referencing some examples here:
    Examples:
    I)
    Unsigned short int gf_open_device(void *p_device_config, unsigned long int client_life_sign_timeout, unsigned short int *device_error)
    void *p_device_config: How to access/pass these arguments in LabView and to which memory location it points in LabView.
    II) #include <windows.h>
         #include <process.h>
         HANDLE rcvEvent0, rcvEvent1;
    /* Function call*/
    CanGetReceiveEvent(handle[0], &rcvEvent0);
    Above is a piece of C code, Now I want to use HANDLE datatype which is windows based, how to use these type in the LABVIEW.
    With regards
    Pavan Ramu Samu

    "Somu" <[email protected]> wrote in message news:[email protected]...
    Hai,
    I am Pavan Ram Kumar Somu.
    &nbsp;
    I am new to Labview, currently I am working on MVB Interface.
    &nbsp;
    I need to access the API functions from *.dll file in Labview, as of now , I am doing this with Call function Library node in Labview but it does not support the following data types like
    &nbsp;&nbsp;&nbsp; 1. Pointer Arguments(To which memory it points in Labview)
    &nbsp;&nbsp;&nbsp; 2. function pointers Arguments
    &nbsp;&nbsp;&nbsp; 3 .pointers in structures and pointer structures in structures and many other data types.
    &nbsp;
    Please Answer the below queries also:
    &nbsp;
    1. How to pass pointer arguments to API functions in DLL and how to collect pointer&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp; return types from API functions in DLL
    &nbsp;
    2. How to pass structure arguments to API functions in DLL and how to collect structure
    &nbsp;&nbsp;&nbsp; return types from API functions in DLL
    &nbsp;
    3. How to use callback functions(nothing but function pointers) in Labview and how to
    &nbsp;&nbsp;&nbsp; collect callback fuctions return types from API functions in DLL
    &nbsp;
    I need your help while passing these datatypes to API functions in DLL from labview.
    &nbsp;
    Suggest me if there is any other alternative for implementing this task.
    &nbsp;
    &nbsp;
    I am referencing some examples here:
    Examples:
    I)
    Unsigned short int gf_open_device(void *p_device_config, unsigned long int client_life_sign_timeout, unsigned short int *device_error)
    &nbsp;
    void *p_device_config: How to access/pass these arguments in LabView and to which memory location it points in LabView.
    &nbsp;
    II) #include &lt;windows.h&gt;
    &nbsp;&nbsp;&nbsp;&nbsp; #include &lt;process.h&gt;
    &nbsp;&nbsp;&nbsp;
    &nbsp;&nbsp;&nbsp;&nbsp; HANDLE rcvEvent0, rcvEvent1;
    &nbsp;
    /* Function call*/
    CanGetReceiveEvent(handle[0], &amp;rcvEvent0);
    &nbsp;
    Above is a piece of C code, Now I want to use HANDLE datatype which is windows based, how to use these type in the LABVIEW.
    &nbsp;
    With regardsPavan Ramu Samu
    Search the forum (forums.ni.com) for callback, pointer or handle, and you'll find that it is all possible, but not very easy.
    e.g.: http://forums.ni.com/ni/board/message?board.id=170&message.id=88974&requireLogin=False
    Regards,
    Wiebe.

  • 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

  • Is it possible to call DLL develloped with LabView 7.0 in LabView 6.0.2 VIs?

    Hello,
    I would like to devellop DLLs in LabView 7.0 and use them in LabView 6.0.2.
    Is it possible???
    I tried this operation. I generated an installer (with the LabView 7.0 runtime in) and tried to load the DLL in a LabView 6.0.2 VI.
    When I run the VI, LabView 6.0.2 is crashing...
    Here my export function prototype:
    typedef struct
    LVBoolean status;
    long code;
    LStrHandle source;
    } TD1;
    typedef struct
    long dimSize;
    unsigned char Numeric[1];
    } TD2;
    typedef TD2 **TD2Hdl;
    void __cdecl driver(LVBoolean *SendCommand, unsigned char DataToSend[], long LenDataToSend, char RHICommandString[], TD1 *errorInNoError, LVBoolean *GetAnswer, LStrHandle *FrameReceivedID, long *Da
    taLength, TD2Hdl *DataReceived, TD1 *errorOut);
    Any example ???
    Thanks for your help,
    Regards, Pascal.

    Hi Pascal,
    I made a simple dll in LabVIEW 7 and called it from LabVIEW 6.0 and it worked fine.
    I have attached the dll I built. It adds two numbers.
    double Testdll(double B, double A);
    Try using this and see if it works for you.
    Feroz
    Attachments:
    SharedLib.dll ‏17 KB
    SharedLib.h ‏1 KB
    SharedLib.lib ‏3 KB

  • Labview 5.1 vs. 5.0 and dll calls

    Hello!
    I have Analogic cPCI-14-2 DAQ cards in the PXI box. Their driver is a dll
    for which I wrote LabView interface using LV5.01 . Everything was nice
    until I switched to 5.1, now it is impossible to run the program for more
    than 5min without a memory access violation error and subsequent LV crash.
    I compiled executable from the DAQ module under 5.01 and 5.1. Executable
    made under 5.1 would not even execute once, resulting in the crash. Then I
    saved VI's using save as LV5.0 option, compiled executable under LV5.01 and
    that runs without problems. I ended up using ActiveX server capabilities of
    the executable by calling it from my main program written using LV5.1
    because I needed to call Matlab. ActiveX server is actu
    ally nice because of
    DCOM in NT boxes, I can now run everything from my office super-duper
    machine instead of using a PXI box's Pentium233.
    Question is, has anyone else had problems with dll calls and how were they
    solved ?
    I will appreciate your suggestions.
    Sincerely
    Reinis Kanders

    Mass compiled in 8.2.1
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Keithly 8_2.zip ‏1231 KB

  • C++ Call to DLL made in LabVIEW Fails the second time it is called

    I have an application where a C++ executive calls a LabVIEW DLL (a LabVIEW application built into a DLL).
    The executive calls and operates the DLL fine the first time (NT, the applications task manager shows LabVIEW runtime runs, then stops when the DLL is done. However, when the executive calls the DLL a second time, it hangs, and the runtime engine never shows up in the applications task manager as running.
    However, this only occurs when something like IMAQ, DAQ, or another custom DLL call is occurring. We tried it with a simple DLL that only uses a call to the sound VIs, and it seems to run fine, although as the program called is very short, and the task manager slow, we never see the runtime engin
    e in the task manager. We are going to put a popup dialog in to ensure that the DLL is being called reliably, but we believe it is.
    We are unable to answer why when we call something that uses IMAQ, that the DLL doesn't run right the second time. We are unsure of the reasons, but believe it to be related to thread creation and destruction in the executive.
    If anyone out there has any insight into this, we would be happy to see it.
    We will be putting in a formal request for support from NI, but wanted to poll the audience as well, as we know from first hand experience that LabVIEW users often times have more experience with this sort of thing than developers.
    Thanks a bunch

    > Thanks for the information Greg. There is no documentation on this
    > issue, except for the email that we got from NI Support. This is
    > quite a new realm for us and NI alike. We would like to know what
    > your experiences have been on this subject. If you have a bit of
    > information, perhaps we should suggest a topic. As I said, this is a
    > new frontier for LabVIEW, and there are a lot of things that NI
    > doesn't know, and I'm sure a few of the programmers out there have
    > figured out.
    >
    I often answer emails from home, but I work for NI on the LV development
    team. So anything I know about, NI knows about. The info I was
    describing about the DLL execution system is not well documented since
    we were hoping that it would work we
    ll with the way Windows Apps are
    typically written. I suspect that we will need to write a Tech Note
    to cover the nitty gritty. This sort of info gets lost in manuals,
    and it is subject to change as we learn how people are expecting to
    use it.
    Anyway, my post was to explain why your use of it didn't work.
    In general, we believe that LV DLLs are thread savvy, reentrant
    VIs can be called from multiple threads simultaneously, execution can
    continue in the background after the DLL call has returned, and the UI
    is live provided the calling app processes messages in that thread.
    If you have other issues or questions, just ask.
    Greg McKaskle

  • Identify LabVIEW as DLL caller

    I would like to be able to identify LabView as being the calling process of a C++ DLL (inside the DLL code). This way I can differentiate the behaviour of the DLL based on whether it is called from LabVIEW or from another programming environment. Does anyone have an idea how I could do this ?
    Message Edited by Raistlin on 08-03-2006 09:13 AM

    "Raistlin" <[email protected]> wrote in message news:[email protected]..
    There are some interesting suggestions there. In fact, it should not only be able to identify if LabVIEW calls the DLL, it should also be impossible to act as if LabVIEW calls the DLL. It is in fact in the context of an SDK which we distribute to customers, which should be waterproof in terms of security. Only if it is called from LabVIEW certain possiblilities (such as a demo mode) should exist. We could off course work with two versions to make things easier.
    In security, there is no such thing as waterproof. Any mechanism you build in can be removed or faked. Even self modifying code, compressed code, debugging traps, etc. can be removed.
    Settle for a mechanism that is waterproof enough. Removing it should cost (much) more than the official release. Spending one day to remove security mechanism from a 100$ toolkit would be kinda stupid. Also consider what public will use it. Big companies will usually not work with illegal software. The number of users is also important. If you're making something like Windows, or Word with millions of users, it will be cracked sooner that a LabVIEW SDK, with (hopefully for you) hundreds or max. thousends of users.
    I'd use GetProcAddress, with NULL and any of LabVIEW.exe's export functions. LabVIEW will have them, the created executable won't. It will be very easy:
    If (!tested)
    If (GetProcAddress(NULL, "ASCIITime"))
    labview=true;
    tested==true;
    Easy to make. Also easy to remove if you're making a c or c++ dll.
    Let us know how it turns out.
    Regards,
    Wiebe.

  • DLL build by Labview App Builder doesn't work if Built-IN functions used!?

    Hi All,
    I hope somebody shed some light on this;
    (All VIs are in the attached case1-2.zip)
    Case 1:
    A VI reads a 1D array data and Uses RMS.vi to calc the rms of the data and returns the rms value and the error value. (make1_dll.vi).
    This VI is used to build a DLL. (test1.dll using the test1.bld)
    Call this DLL in a new VI (just to test that the DLL works) (test1.vi)
    RUN the new VI >>> Result Nothing happens No Error or Crash and No result!!!
    Case2 :
    Build the above without using the “RMS.vi” and works OK. (see case2 VIs)
    Any idea why the build-in function doesn’t work?
    Best regards
    Attachments:
    case1-2.zip ‏44 KB

    Joel A wrote:
    You might want to look at the path building you are doing to find the RMS VI. If you are using relative paths, then LabVIEW calls like "VI Path" will have an extra path if the VI is an exe or inside an LLB.
    Drop some probes (indicators, outputs, etc.), rebuild and double check the paths. I've been burned by this before...
    If this is the case, you can use the VI properties, or path parsing to solve it.
    joel
    I don't think that is the problem. The RMS.vi is referenced as statically linked VI in the make1_dll.vi.
    As such it should be linked into the LabVIEW DLL as well. What I suspect is the problem is the fact that
    the RMS.vi uses the lvanlys.dll and that for some reason there is something going wrong with the LabVIEW
    test1.dll, which runs in the LabVIEW runtime context, calling lvanlys.dll while executed in the context
    of LabVIEW itself. Probably something to do with the changes to how lvanlys.dll is treated between LV 7.0
    and 7.1.
    I see this same behaviour on my system too, so an installation problem is quite unlikely. Other than that calling a LabVIEW dll from within LabVIEW makes not that much sense (but did work fine in the past save from some hassles in 6.0 and 6.0.1), I have no explanation why this doesn't work.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How to eliminate advapi32.dll error in Labview RT

    Hi all,
    I am having a problem deploying a RT application to the remote machine. I get an error stating Error loading 'WS2Help '.dll: Missing
    export 'AllocateAndInitializeSid' from ADVAPI32.DLL'  After searching the internet for a while I know that this is a dll that the labview realtime os cannot use.  However I do not know if there is a tool/debugger that I can use that will tell me what vi's are calling this dll.  If I know what is calling it I figure I can figure out an alternative to that function.  Any help is appreciated. Thanks.

    Hi KidMoe,
    In addition to the information (and the program) from the thread that mathan linked, here is a little more about that dll.  WS2Help.dll is used by Internet and network applications.  Specifically, the file contains functions used by the Windows Sockets API.
    Regards,
    Charlie Piazza
    Staff Product Support Engineer, RF
    National Instruments

  • How to load DLL library on Labview?

    Hi
    I have an application that is working well in Visual C++ 2012. I would like to load the dll library on labview and to execute the code on labview. I have only the DLL file, the working application and the help file. Is it possible to realise this task on labview using Call Library Function Node.
    I have par example the following code in .cpp file:
    void CMTBClientUsingCOMDlg:nBnClickedConnect()
    // TODO: Add your control notification handler code here
    try
    // login to MTB, using english language
    m_MTBConnection->Login(("en"), &m_ID);
    // get MTB root (forcing an internal QueryInterface() on IMTBRoot!)
    m_Root = (IUnknown*)(m_MTBConnection->GetRoot((BSTR)m_ID));
    // ask root to return the number of devices
    int count = m_Root->GetDeviceCount();
    // list all devices
    for (int i=0; i < count; i++)
    _bstr_t name = ((IMTBIdentPtr)m_Root->GetDevice(i))->GetName();
    m_ComboDevices.AddString(name);
    if( m_ComboDevices.GetCount() > 0)
    m_ComboDevices.SetCurSel(0);
    OnCbnSelchangeDevices();
    m_BtnConnect.EnableWindow(false);
    m_BtnDisconnect.EnableWindow(true);
    catch(_com_error e)
    // connection close
    OnBnClickedDisconnect();
    DisplayError(&e);
    How to execute this code on labview?
    Best regards

    Hi
    I have attached the help file describing the dll library (MTBApi.dll). My working program made on Visual C++ Dot Net is very big and therefore I can’t attach it.
    In my header file I import at the beginning the dll library on this way:
     #import "MTBApi.tlb" named_guids
    using namespace MTBApi;
    Than I have a class:
    class CMTBClientUsingCOMDlg : public CDialogEx
    public:
    CMTBClientUsingCOMDlg(CWnd* pParent = NULL); // standard constructor
    ~CMTBClientUsingCOMDlg(); // standard destructor
    enum { IDD = IDD_MTBCLIENTUSINGCOM_DIALOG };
    protected:
    virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
    protected:
    HICON m_hIcon;
    IMTBConnectionPtr m_MTBConnection;
    IMTBRootPtr m_Root; 
    CComBSTR m_ID; 
    IMTBChangerPtr m_Changer; 
    IMTBDevicePtr m_Device;
    DECLARE_MESSAGE_MAP()
    public:
    afx_msg void OnBnClickedConnect();
    CButton m_BtnConnect;
    In my .cpp file I have:
    CMTBClientUsingCOMDlg::CMTBClientUsingCOMDlg(CWnd* pParent /*=NULL*/)
    : CDialogEx(CMTBClientUsingCOMDlg::IDD, pParent)
    m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
    CoInitialize(NULL);
    try
    // create an instance of the connection class which can connect to the server
    m_MTBConnection = IMTBConnectionPtr(CLSID_MTBConnection);
    catch(_com_error e)
    CMTBClientUsingCOMDlg::~CMTBClientUsingCOMDlg()
    void CMTBClientUsingCOMDlg:isplayError(_com_error* e)
    void CMTBClientUsingCOMDlg:oDataExchange(CDataExchange* pDX)
    CDialogEx:oDataExchange(pDX);
    DDX_Control(pDX, IDC_CONNECT, m_BtnConnect);
    BEGIN_MESSAGE_MAP(CMTBClientUsingCOMDlg, CDialogEx)
    ON_BN_CLICKED(IDC_CONNECT, &CMTBClientUsingCOMDlg:nBnClickedConnect)
    END_MESSAGE_MAP()
    BOOL CMTBClientUsingCOMDlg:nInitDialog()
    CDialogEx:nInitDialog();
    void CMTBClientUsingCOMDlg:nPaint()
    void CMTBClientUsingCOMDlg:nBnClickedConnect()
    try
    // login to MTB, using english language
    m_MTBConnection->Login(("en"), &m_ID);
    // get MTB root (forcing an internal QueryInterface() on IMTBRoot!)
    m_Root = (IUnknown*)(m_MTBConnection->GetRoot((BSTR)m_ID));
    // ask root to return the number of devices
    int count = m_Root->GetDeviceCount();
    // list all devices
    for (int i=0; i < count; i++)
    _bstr_t name = ((IMTBIdentPtr)m_Root->GetDevice(i))->GetName();
    catch(_com_error e)
    // connection close
    My question is how to start this code in labview. How to write the function in labview, par example this function:
    m_MTBConnection->Login(("en"), &m_ID);
    Best regards
    Attachments:
    MTBApi.zip ‏1935 KB

  • Error Code 1097 Coming in DLL Calling

    Hi,
    I am getting error code 1097 in DLL calling function. Please find the DLL calling function details for more information.
    Function :  GetControllerListTest(controller *ptrControllertest,char *max_controller);
    Controllertest parameter details:
    define NO_OF_CONTROLLER  100
    #ifndef CONTROLLER_STRUCT
     typedef struct
      CString name;
      char status;
      CString blocked_by;
      char group;
     }controller;
    Controllertest parameter data type is structure. In LabVIEW, I have configured parameter as a cluster.
    name : String control
    status : U8 Integer control
    blocked_by : String control
    group : U8 Integer control
    Could you please confirm it, did I configured the datatype in correct way?
    I am getting empty array output and Error Code from the DLL 1097. Can you please tell me where I am missing?
    Thanks
    Sivaramkumar.V
    Solved!
    Go to Solution.

    Call Library Node problems without the VI in question attached AND the complete C prototype of the function provided, AND preferably some documentation about the C function in question can be not diagnosed. These informations are paramount to get the Call Library Node configured properly since there is no way a calling application can retrieve the necessary information from the DLL itself. The DLL interface was never intended to be a self configuring interface and it was designed with the understanding, that the user of such an interface is a fully knowledgeable C programmer knowing both, how to read a header file definition as well as various details about memory buffer handling.
    So show us your VI and the C header file, and we can start to help you. Otherwise all we can do is guessing in the way you have done with changing the calling convention randomly. You can of course try to shoot in the shooting range with a blindfold on, but the chances that you not only do not hit the target, but injure some other person instead is very high.
    The only reason that the suggestion from Fragger Fox has any merits is the fact that LabVIEW used to have some heuristics that changed the Call Library Node automatically from C calling convention (the LabVIEW default) to Windows calling convention, if it recognized a certain pattern in the exported function name. This heuristic was removed in LabVIEW 2009 because it did prevent the Call Library Node to be able to call functions that were using C calling convention but happened to match the heuristic pattern. So changing a Windows calling convention to C calling convention when the code has "seemed" to work before is NEVER a solution.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

Maybe you are looking for

  • Having Trouble Shutting Down

    Hey guys- My comp doesn't seem to want to shut down (or restart). i.e. If I follow Apple>Shut Down>"OK", it will close out all my apps and act like its going to shut down, then just sits on the Finder. I checked out the activity monitor and can't fin

  • Errors while installing runtime engine netframework 4 (32bit)

    While installing the update for runtime engine netframework 4 we get diffrent errors. We can't register DLL files. This is the error we get: Error 1904. Module C;\Program Files\ SAP BusinessObjects\Crystal Reports for .NET Framework4.0\Common\SAP Bus

  • WRT54GL firmware upgrade failed

    Hi, I'm trying to upgrade the firmware on my WRT54GL v 1.1 from 4.30.2 to 4.30.9 and I keep getting the "Upgrade are failed!" message after a few bars on the upgrade-o-meter. After I get the msg, the router keeps working exactly as it used to. I trie

  • How to batch export Chapters

    I would like to be able to automatically take a QT movie with Chapters marked, and create individual QT movies of each Chapter. The manual method is quite tedious!

  • OBIEE Web Services + HtmlViewService returns an iframe?

    It looks like the when using the HTMLViewService methods, they are just returning an iframe. When I write the HTML to a file and load the page, I am getting an Access is Denied error from the JavaScript. Probably something to do with cross-site scrip