CAll VB 6 DLL wilth labview 8.2

I have VB 6.0  DLL  I want to call it in my Labview 8.2 program . 
as per the link http://digital.ni.com/public.nsf/allkb/F2CD7758CD3C847F86256C01006C0E48 i am using Automation Refnum but iam unsuccessful .
i am getting following error Automation Open: Object specified is not creatable in vi (Error code :3005) .

You have registered your DLL with regsvr32 before? If not, open command prompt (Start --> Execute --> cmd), navigate to your DLL and enter "regsvr32 DLLNAME". There should be a message like "DLL register successful"...
Hope this helps
Christian
THINK G!! ;-)
Using LabView 2010 and 2011 on Mac and Win
Programming in Microsoft Visual C++ (Win), XCode (Mac)

Similar Messages

  • Calling 64-bit dll from labview 8.2 on Windows7

    Hello,
    I have tried the LABview driver from the OMNIDRIVER (OceanOptics) package. But when calling functions from the “OmniDriver32.dll” , LABView is crashing and  says that the memory is corrupted.
    I am using LABVIEW 8.2 (32-bit) running on Windows 7 (64-bit).  I have tried some LABView code examples given for LABview 7.1 and 8.0. These example are using the OmniDriver32.dll (not the OmniDriver64.dll).
    But maybe these example are assuming that you are on a 32-bit operating system, which is not my case.
    So I have tried calling the OmniDriver64.dll. but LABView seems not to recognised the dll and can’t read the included functions.
    Is there a way to call some 64-bit dll from LABview 8.2 ?
    Or do I need to buy a new license for LABVIEW 64-bit ?
    Thanks,
    Pierre

    There is no virtualization support for DLL bitness issues outside of the Windows standard directories. The Windows and System directories that an application "sees" depends on its bitness. All other directories are not mapped depending on the calling process' bitness.
    So if you have installed 32 Bit LabVIEW and are not calling one of the system DLLs, you have to point the path of the DLL to the real 32 bit DLL. Pointing it to a 64 bit DLL should not even be able to get the VI compilable, since Windows will refuse to load the DLL into the 32 bit process as being an unknown file format, and that should make the VI broken.
    If you need to call a system DLL you simply enter the DLL name without path and Windows will find the according DLL for LabVIEW.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Has anyone called the Solver dll in Labview?

    I have developed a non-linear mathematical model in Excel that uses it's Solver routine. I am currently trying to convert this over into the Labview environment because the equations are more manageable and the front panel interface is more marketable. However, I need the power of the Solver dll.
    Frontline Systems (www.solver.com) provides an evaluation version of the dll but I am new to this and I was wondering if anyone has done it and could provide a VI which calls this dll or has any suggestions, please?
    I think it would be pretty nifty if Labview could provide this sort of optimisation power. (It's current optimisation routines in the Mathematics toolbox are pretty limited and are not nearly as powerful as Solver)
    . But I'm sure a labview guru could configure a simple VI which calls the Solver dll for a multi-dimensional non-linear problems similar to Excel....
    Many thanks in anticipation!!!

    Hello �
    You might want to consider using a Call Library Function Node. This node supports a large number of data types and calling conventions. You can use it to call functions in most standard and custom-made DLLs and shared libraries.
    Refer to the Configuring the Call Library Function Node section of Chapter 2, Shared Libraries (DLLs), of the Using External Code in LabVIEW manual (attached) for more information about using the Call Library Node to call code from text-based programming languages.
    Hope this helps!
    S Vences
    Applications Engineer
    National Instruments
    Attachments:
    Call_Library_Function.pdf ‏2030 KB

  • Calling a C# DLL in Labview that makes a call to another DLL

    I have a set of DLLs created with C# that I am calling in Labview.  They all work fine using the .NET functions except for one DLL that makes a call to another DLL created in C. It returns an error.  Any ideas why this wouldn't work?  All DLLs are located in the same Windows directory.

    It should be discernable (by looking at the C# code) whether the C DLL needs to be registered.
    If the DLL is serving COM objects it may need to be registered at a command-prompt with
    regsvr32 <your_DLL_File_path>
    If it's supplying .NET assemblies, I think it needs to be registered with
    regasm <your_DLL_File_path>
    Although I've written a few C DLLs, none were called from a C# DLL and I can't advise what subtle things to watch-out for in this scenario.
    Do you have a way to validate/exercise the C DLL's functionality? Is it possible to through-together a C# application (not a C# DLL) that successfully uses the C DLL?
    Luck/Cheers!
    Message Edited by tbd on 12-03-2008 02:36 AM
    "Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)

  • Error calling DLL in LabVIEW, but works in VC

    I compiled a DLL from Matlab, and then compiled a wrapper DLL in VC++. I tested the wrapper DLL in VC++, and it works fine, generating the correct output as in Matlab. 
    But when I call the wrapper DLL in LabVIEW, the first thing I noticed was that it only ran once. The second time I ran the VI, it returns an error. And the output is always a single number instead of an array when it runs. 
    I followed the examples how to create a wrapper DLL for Matlab compiled code. One of the examples said three functions Initialize, run and terminate should be implemented so that the DLL function can run continuously. I did all those, but it still does not work. 
    Here is the test code in C++. I explicitely loaded the DLL and ran the functions. It worked fine. Why the VI in LabVIEW does not do the same thing?
    // contourWrapper3.cpp : Defines the entry point for the console application.
    #include "stdafx.h"
    #include <Windows.h>
    #include <iostream>
    typedef int (*InitFunc)();
    typedef void (*TerminateFunc)();
    typedef void (*contourFunc)(double*,double*,int,int,double);
    int _tmain(int argc, _TCHAR* argv[])
    InitFunc _InitFunc;
    TerminateFunc _TerminateFunc;
    contourFunc _contour;
    HINSTANCE hInstLibrary = LoadLibrary("contourcWrapper.dll");
    if(hInstLibrary)
    _InitFunc=(InitFunc)GetProcAddress(hInstLibrary,"c​ontourcInit");
    _TerminateFunc=(TerminateFunc)GetProcAddress(hInst​Library,"contourcTerminate");
    _contour=(contourFunc)GetProcAddress(hInstLibrary,​"contourcGenerate");
    if(_InitFunc)
    _InitFunc();
    if(_contour)
    double image2DArray[] = {1,2,6,4,6,8,0,5,1,3,5,4,7,8,8,9,10,0};
    int width = 3;
    int height = 6;
    double c[sizeof image2DArray] = {0};
    _contour(c, image2DArray, width, height, 0.6);
    for (int i=0; i<width*height; ++i)
    std::cout << c[i] << std::endl;
    _TerminateFunc();
    else
    std::cerr << "Could not initialize libcontour properly."
    << std::endl;
    return 0;
     This is the output window of the above C tester code. It displays the correct output of array. 
    And this is the VI that does not work. 
    In the attached files, 'libcontour.zip' contains the matlab-generated dll and wrapper dll. 
    Attachments:
    contourcWrapper_test.vi ‏12 KB
    libcontour.zip ‏50 KB

    But LabVIEW does.  The declarations (in C) for different types of arrays are not the same.  I think you are passing extranious data to the DLL which is causing the issue.
    I will defer to your expertise however.  Over the years my knowledge in this area has waned.  Perhaps you are correct (in which case I am not sure what is wrong).
    Examples:
    typedef struct
        int dimSize;
        double data[1];
      } t_LvArrayDbl1D, *p_LvArrayDbl1D, **h_LvArrayDbl1D;
    typedef struct
        int dimSize[2];
        double data[1];
      } t_LvArrayDbl2D, *p_LvArrayDbl2D, **h_LvArrayDbl2D;

  • How to build a dll for labview pda, which uses the intel ipp primitives in it

    Hi all,
    For my application, I need to call a c dll from Labview PDA, and in the c function i need to use intel IPP function. When i call my dll, i get an error saying the ippfunction i use, say "ippsCopy_16s missing c or vi file". Can someone tell  me what I might be doing wrong?

    Hi Vani,
    When using a DLL in a PDA there are some special considerations you have to take. Please take a look at the following knowledgebase describing the process.
    Eli S.
    National Instruments
    Applications Engineer

  • How can I calling LabView DLL within LabView and pass similar Data Types?

    I am trying to use an Instrument Driver, which is created in LabView6.1 as a DLL. At this point I have only LabView to test this DLL. I was wondering, is there easy way to find out what sort of Parameter or Data Type I should be using.
    How can I pass the following data with in LabView:
    LVRefnum as Type?
    LVBoolean as Type?
    TD1 (a structure) as Type?
    It is funny to see that I am able to create a DLL in labview but having trouble calling it within LabView. I thought, it would be easier to test the DLL within the same environment.
    Basically, I am more worried about the VISA calls that are used in the driver to communicate with instrument. Because, there is no link to �VISA32.dll� in
    the header file, is that handled by the LV Run-time engine? I guess more details are needed on using the LabView DLL within LabView from National Instrument Technical Support.
    Attachments:
    RL5000.h ‏1 KB

    A LVRefNum seems to be an unsigned long data type (32bit). You can cast it
    in LV then use that as a parameter to call the DLL. (an Occurrence type
    seems to be a Ulong32)
    When you created the DLL what was the resulting type for the LVRefNum?
    Happy Holidays
    "Enrique" wrote in message
    news:[email protected]..
    > I see...
    >
    > After doing some research, it seems to me that there is no easy way to
    > find out the type of data, other than looking at the header file and
    > have documents like Using External Code in LabVIEW handy. The
    > following information is from that document:
    >
    > LVBoolean is an 8-bit integer. 1 if TRUE, 0 if FALSE.
    >
    > LabVIEW specifies file refnums using t
    he LVRefNum data type, the
    > exact structure of which is private to the file manager. To pass
    > references to open files into or out of a CIN, convert file refnums to
    > file descriptors, and convert file descriptors to file refnums using
    > the functions described in Chapter 6, Function Descriptions.
    >
    > I know you are creating a dll in LabVIEW, but I am pretty sure the
    > information applies as well and is useful. For your dll this can be
    > interpreted that, rather than passing a LVRefnum, try passing the file
    > descriptor.
    >
    > From the header file, is can be deduced that TD1 is a cluster in
    > LabVIEW.
    >
    > You are right in saying that "more details are needed on using the
    > LabView DLL within LabView from National Instrument Technical
    > Support.".
    >
    > Enrique

  • Call dll in labview

    "Hi All,
    I have to get data from USB camera, I have following functions in DLL.
    DLLINOUT HANDLE WINAPI CC_Open( LPCSTR CameraName , ULONG CameraNumber , CC_CAPTURE_MODE CaptureMode ) ;
    and
    DLLINOUT BOOL WINAPI CC_CaptureSingle( HANDLE Cam , PVOID Buffer , ULONG TransferSize , CC_TRIGGER_MODE TriggerMode , USHORT TimeOut , OVERLAPPED * pUserOverlapped );
    When I open hardware with function cc_open I am getting handle to an object. How can I store this object and pass it to CC_CaptureSingle function?
    Another question is when I call CC_CaptureSingle I am getting pointer on the 2 dimension array �PVOID buffer� how can I get this array in Labview?"

    hi,
    you can do this two thing.
    1. Create your new DLL with (your DLL will call camera's DLL) one big function my_capture_image() and insert you do CC_Open(), CC_CapruteSingle() and CC_Close(). And to LabView you pass only Array whit image data. And you don't have problems with HANDLE. But you must allocate memory for image array in LabVIEW before you call this DLL!!! [Or use LabVIEW C function for reallocating memory]
    2. You must identify type of HANDEL variable. And you can change type of this variabile. But when HANDLE variable is structure it is hard pass this structure to LabVIEW.
    If you use LabVIEW 7.1 look example 'Call DLL.vi' it is great!
    Have a nice day.
    JCC

  • Creating a DLL in Labview 8.6 and calling it from Visual Basic 6.0

    Dear friends,
    I need to create a DLL in Labview 8.6 and call it from Visual Basic 6.0. The system works as follows:
    I made an application using Labview 8.6 + Vision Assistant 8.6 where I can obtain the x,y coordinates of a template in an certain image being captured by an USB camera. The template coordinates change every time it moves and Visual Basic 6.0 must read these x,y values in real time. I found some information in the link http://zone.ni.com/devzone/cda/tut/p/id/3925, but it works for version 6.x of Labview and 8.6 version is different. Am I in the right path? If you have an updated tutorial like the one in the link above but for Labview 8.6 It would be very nice. Please help me.
    Kind regards.
    João Júnior

    Hello Osvaldo,
    I analysed the updated tutorial you sent me, but the thing is that it doen't show how to create the DLL in LV 8.6 but only show how to accessing the DLL from VB6. My problem is really HOW TO CREATE THE DLL IN LV8.6. In the link http://zone.ni.com/devzone/cda/tut/p/id/3063 there is detailed information about how to do this in LV6.x, the problem is that I don't find the path Tools»Build Application or Shared Library (DLL) in LV8.6, I think the procedure in LV8.6 is a little bit different. Don´t you have an updated tutorial on how to build a dll in LV8.6?How could you help me?
    Kind regards.
    João Júnior

  • Calling Dlls from LabVIEW

    LabVIEW Gurus:
    I am working with some software engineers who have no experience in LabVIEW. Unfortunately I have little experience in C/C++ to make sense of their inquiry.  
    Basically we are dealing with “Data Marshalling”. I will call a DLL and issue a command (string) and get back a 2-D array and an integer. So far so good.
    The C/C++ programmer requested that I provide them with a pointer/memory address in which they will store data, so I can read it once the dll returns the array and integer. I browsed through the example online http://decibel.ni.com/content/docs/DOC-1690 and thought that if I wanted to read from the dll, the process is a simple as calling the appropriate function and configure the parameter (no pointers needed).
    So, is there a specific way that they need to write the C/C++ code to be used in LabVIEW? Or what else to I have to take into consideration?
    Thank you,
    Santiago 

    That example is pretty simplistic as it only deals with integers. In this case no pointers are required since everything is returned by value. When you're dealing with arrays, however, you need to deal with pointers. If you open the Example Finder (Help -> Find Examples) and search for "dll" you will see the "Call DLL" example. That contains many examples of how to call DLL functions with a wide variety of datatypes. I strongly suggest looking at that example. There is also a chapter in the LabVIEW Help on calling DLLs (Fundamentals -> Calling Code Written in Text-Based Progamming Language).
    You have 2 things to consider:
    You're dealing with arrays - this means you typically need to pre-allocate the memory in LabVIEW, and it sounds like that's what the DLL expects you to do. This amounts to using the Initialize Array function to create your 2D array of the appropriate size and datatype.
    You may be dealing with a C++ DLL. LabVIEW can only interface to C DLLs. This doesn't mean that you can't create a DLL in C++, but it does mean that the C++ programmers need to add an extern "C" modifier to the function calls, otherwise you get name mangling, and LabVIEW won't be able to call the DLL. The DLL programmers should know what that means.

  • Problem about calling a DLL in LABVIEW

    Hi,
    I have a problem using Labview to call a DLL file, when I call the function " commandinterp() in labview, labview will always return error message"an error occured in external code, it might  have corrupted labview memory..."  attached is the DLL file and the labview code .so did the code i attached have any problem? or is it the problem of the DLL?  thanks
    Attachments:
    mydll.txt ‏22 KB
    callfunctionnode.vi ‏7 KB

    It looks to me that he might be missing an input parameter. 
    The line shows   int commandinterp (char cmd_line[]) {
    So is a char type an input argument for the function to be used as the variable name cmd_line?
    The attached VI does not show any input parameters doing into the DLL call.
    (I am not entirely sure.  Since the dll itself was not attached, I had to tell Labview to ignore the item when it looked for it.  Perhaps the way the VI opens up when the dll doesn't exist on my machine is different then if the dll did exist.)
    Message Edited by Ravens Fan on 07-20-2007 12:01 AM

  • Create DLL from labview and calling it from other application

    I have an application built using Labview. I wanted to create DLL out of it. The application has
    two String inputs start and stop buttons and two status indicators.
    1. How to itegrate start and stop buttons from function prototype?
    2. Does Labview created DLLs requires labview runtime engine when it is to be called from other application?
    Can some one help on this.
    Solved!
    Go to Solution.

    Hi Yuvish,
    1) They should be boolean inputs to your VI. But does it makes sense to provide a stop button input at the start of your VI? (THINK DATAFLOW!)
    2) Yes, the LV-RTE is needed...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Call a dll for Labview: Function not found in library

    Hello,
    I am trying to call a very simple .dll form Labview. I compiled the .dll for x64 using Visual Studio 2010, because I am using Labview(64-bit). I did everything exactly the way I read it in several Tutorials. But the "Call Library Function Node" doesn't create a popup menu with the avalible functions like it is supposed to do. The Import Wizard doesn't find any functions neither. What is wrong with my .dll?
    I added a block marked 'extern "C" ' into my source file, but it still won't work.
    Thanks
    Matthias
    Solved!
    Go to Solution.
    Attachments:
    DynamicLibrary.zip ‏2452 KB

    You need to define an entry point to the DLL
    BOOL APIENTRY DllMain( HANDLE hModule,
                            DWORD  ul_reason_for_call,
                            LPVOID lpReserved )
        return TRUE;
    Also add extern "C" __declspec(dllexport) to your functions
    More details here: http://www.ni.com/white-paper/3056/en
    Beginner? Try LabVIEW Basics
    Sharing bits of code? Try Snippets or LAVA Code Capture Tool
    Have you tried Quick Drop?, Visit QD Community.

  • Help to make opencv's dll and LabVIEW's Call Library function node understanding each others

    Hi, i have a little problem trying to use a C++ opencv's dll in labview. I wrote a really simple and stupid dll just to try to understand how it works the call library function node. Here the header code:
    #ifdef GENERICDLL_EXPORTS
    #define GENERICDLL_API __declspec(dllexport)
    #else
    #define GENERICDLL_API __declspec(dllimport)
    #endif
    #include "stdafx.h"
    #include <opencv2/core/core.hpp>
    #include <opencv2/highgui/highgui.hpp>
    #include <iostream>
    #include <string.h>
    #include <stdio.h>
    #include <opencv/cv.h>
    #include <opencv/highgui.h>
    // Questa classe è esportata da Generic DLL.dll
    class GENERICDLL_API CGenericDLL {
    public:
    int Summ(int a, int b);
    int Sott(int a, int b);
    int opencv(int a);
    // TODO: aggiungere qui i metodi.
     and here the .cpp:
    // Generic DLL.cpp: definisce le funzioni esportate per l'applicazione DLL.
    #include "stdafx.h"
    #include "Generic DLL.h"
    #include <opencv2/core/core.hpp>
    #include <opencv2/highgui/highgui.hpp>
    #include <iostream>
    #include <string.h>
    #include <stdio.h>
    #include <opencv/cv.h>
    #include <opencv/highgui.h>
    using namespace cv;
    using namespace std;
    // Esempio di variabile esportata
    GENERICDLL_API int nGenericDLL=0;
    // Funzioni esportate.
    GENERICDLL_API int Summ(int a, int b)
    return a+b;
    GENERICDLL_API int Sott(int a, int b)
    return a - b;
    GENERICDLL_API int opencv(int a)
    const string ind = "C:\\Users\\sviluppo\\Desktop\\Tuli.bmp";
    const string ind_2 = "C:\\Users\\sviluppo\\Desktop\\Tuli_Gray.bmp";
    //Mat image;
    return 5;
    i can call all the three simple functions in labview with this easy code. No problem at all. If i uncomment the line "Mat image;" the call library function node doesn't work and i receive the error:
    "The library specified for this node cannot be found or cannot be loaded. Right-click the Call Library Function node and select Configure, then choose the correct library name or path."
    I think that is a problem of dependencies between opencv libraries but i dont know how to manage this. Any ideas?
    Thank you for yours time,
    Francesco.

    Hello Francesco,
    I'm having exactly the same problem as you. I created a DLL that I can easily access from LabView. If I add one line and include "imgproc.hpp" (the only one I need), then LV gives me the same error you had. I read the thread Loura linked to, but I don't see how people actually take care of the dependecies (Klemen's examples did not work for me for the same reason, even though I recompiled the .cpp). Could you explain in detail what you did to make it work?
    Thanks

  • Use a wrapper to build a C++ Dll that calls a C++ .lib and Use the Dll is LabView

    Hi All,
    I need to access some functions in a C++ .lib within LabView, but has no source code for the library.  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?  I am new to C++, could some one suggest how to use the .lib in Visual C++ 6.0 studio to build the Dll?
    Thanks for your help.
    Bryan

    BryanL wrote:
    Hi Rolf, thanks for the info. I will try to build a vi to call that function. For a more immediate need, I can use a downloaded vi that calls SetActiveWindow function, then use its output windowshandle to find the window name with a lvwuser32.dll function. The problem is this find window name function vi requires a windows reference input, which does not take the window handle output from the SetActiveWindow vi. How do i convert the window handle into a reference number? Thanks again.
    Don't try to write a VI to call that function. That function requires a callback function pointer, something that is more or less impossible (well you can get it done but it is not worth the trouble) to create in LabVIEW. You will need an external DLL that does the enumeration and returns an array of strings to LabVIEW.
    The lvwuser32.dll also just uses window handles. Look inside those VIs and you should see that those window references are typecasted into uint32 and then passed to the Call Library Node if I remember correctly. You definitely should be able to typecast the (probably uint32) you get from your other function into the window reference that that VI takes. The window reference of the lvutil library is just a nice trick to make it refnum like so that you can not inadvertly wire something else to it (and confuse/crash Windows).
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

Maybe you are looking for