How to call LabVIEW ActiveX dlls into VB6

I'm jumping in on a project written primarily in VB6. I'd much rather wirte code in LabVIEW so what I am looking for is some example code for calling LabVIEW activeX dlls into VB6. Does anyone have example code? I need to see how the LabVIEW libraries and classes are called and used in VB6.

Hi Drewdafis,
Refer to this link for example code on calling a LabVIEW DLL from Visual Basic.
Hope this helps!
Best Regards,
Jonathan N.
National Instruments

Similar Messages

  • How to call LabVIEW8.5 DLL in VB6.0?

    1:I am running an NI example which is here
    http://zone.ni.com/devzone/cda/epd/p/id/3990
    However, when it runs it gives this error  :
     Unable to locate the LabVIEW Run-time Engine.
     numtest requires a version6.0(or compatible) LabVIEW Run-time Engine.Please contact the vendor of number to correct this problem
    2:I am running an  example which is here http://www.blog.edu.cn/user2/shawnchen/archives/20​06/1330215.shtml
    However, when it runs it gives this error  :
    Run-time error "453":
         Can't find DLL entry point AddInt in e:\NUMBER\AddInt.dll
    Any ideas?
    Solved!
    Go to Solution.

    WARNING: The second link you provided is reported as an attack site.
    Message Edited by smercurio_fc on 10-13-2008 10:19 AM
    Attachments:
    attack site.png ‏13 KB

  • Turning a LabVIEW built DLL into an ActiveX server

    Does anyone have a list of the steps you must go thru
    to convert a LabVIEW generated DLL into an ActiveX server. Do the functions become methods?

    Hi James,
    we have a library we deploy in three ways: as a LabVIEW library, as a DLL and as Active-X server.
    In the build file for the DLL we have made each "function to call" a top level VI.
    In the Active-X server each "function to call" is a dynamic VI. We created a new top level VI which will run when the server is started and stops after his window is hidden. In LV 6.x you need the winutil library to hide the window. If you close the window (through FP.Open set to FALSE) the server will stop. The window size is set to 1x1 in the VI Properties to minimize flickering on the screen during start of the Active-X server. You must check the "Enable Active-X Server" box on the "Application Settings" page in the app builder. In your client application yo
    u open a reference to the server and then you can open a reference to the VI. You set/read the controls and run the VI. There is sample code for Visual Basic on the NI web site. I have also sample code for Visual C++ single and multi threaded clients.
    If you are interested in the examples contact me at [email protected] and I will ask my customer to allow me to send it to you.
    Waldemar
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions

  • How to call LabVIEW dll from ATL COM dll

    I have tried to call simple LabVIEW 8.6 Dll from win32 test application, class Library.
    I have include LabVIEW generated SharedLib.h file and SharedLib.lib file in the test application which I created as simple win32 console project and also from win32 class Library. I was sucessfully able to call my LabVIEW dll funtion. 
    But when I create ATL COM project and try to add SharedLib.h file and SharedLib.lib file I used to get following erors
    Error 1 error C2733: second C linkage of overloaded function 'StrCatW' not allowed d:\program files\national instruments\labview 8.6\cintools\extcode.h 463 
    Error 2 error C2733: second C linkage of overloaded function 'StrCpyW' not allowed d:\program files\national instruments\labview 8.6\cintools\extcode.h 464 
    Error 3 error C2733: second C linkage of overloaded function 'StrCpyNW' not allowed d:\program files\national instruments\labview 8.6\cintools\extcode.h 465 
    Error 4 error C2733: second C linkage of overloaded function 'StrCmpW' not allowed d:\program files\national instruments\labview 8.6\cintools\extcode.h 466 
    Error 5 error C2733: second C linkage of overloaded function 'StrCmpNW' not allowed d:\program files\national instruments\labview 8.6\cintools\extcode.h 467 
    these many errors.
    Will some one explain me how to call LabVIEW dll from ATL COM dll.
    Thanks & Regards,
    Jay

    I also had this problem.  My application is unicode-aware, but I was attempting to link it to a library with primitive C-string arguments.  You could dynamically load the DLL as suggested (more work), modify the header files (really not recommended), or if you are feeling lucky you could try fooling the compiler, as I was successfully able to do in Visual Studio 2010, by steering the preprocessor around those functions (assuming you're not using them, of course -- otherwise this probably wouldn't work):
    // prepare for NI extcode.h inclusion. avoid linker errors for this project.
    #define StrCatW(a,b)     IgnoreLinkError_StrCatW(a,b);
    #define StrCpyW(a,b)     IgnoreLinkError_StrCpyW(a,b);
    #define StrCpyNW(a,b,c)  IgnoreLinkError_StrCpyNW(a,b,c);
    #define StrCmpW(a,b)     IgnoreLinkError_StrCmpW(a,b);
    #define StrCmpNW(a,b,c)  IgnoreLinkError_StrCmpNW(a,b,c);
    // header file for my LabView-built DLL (ASCII single-byte character arguments)
    #include <MyLibraryHeader.h>
    // clean up afterwards, put things back to 'normal'
    #undef StrCatW
    #undef StrCpyW
    #undef StrCpyNW
    #undef StrCmpW
    #undef StrCmpNW

  • How to call a c++ dll from oracle

    plz can someone help me how to call a c++ dll (not ocx coz 10g cant see ocx) from oracle 10g ?
    Edited by: jihad jag on Apr 23, 2009 1:40 AM

    I guess your request is timed out but to call shared libraries look for 'External Procedure Call' in Oracle documentation.

  • How to call Labview DLL from VB2005

    Dear all expert,
    I'm a student and very new in Labview programming.
    Currently i have build a simple vi and need to convert it to dll so that i can call it from my VB.net. But the problem is how to call the labview dll from my VB.net?
    I know we must declare function something like this,
    Auto function Bodeplot Lib"..\\Bodeplot.dll" (Byval Val1 as double, Byval Val2 as double,...) as double
    but how to determine Val1, Val2 (and so on) is input for which data?  if my vi have 10 input (frequency, Kc,Fcz,Fcp,Wzrhp,Wp,k,Wz,Beta and Operation) ? and how to select the output (my application have 3 possible output : magnitup loop,phase loop, and degree loop)
    In addition, since I'm using Labview 8.0 , and as i know apllication  builder for this version cannot convert vi to dll which contain Mathscript (but unfortunely, my vi all use Mathscript), so really hope someone can help me to convert my vi to dll using Labview 8.2 (which remove this limitation).
    here I'm attach my Vi and really hope someone willing to help.
    Thank you.
    Attachments:
    bodeplot.vi ‏1049 KB

    On Sep 17, 6:40 am, cckoh <[email protected]> wrote:
    > Dear all expert,
    > I'm a student and very new in Labview programming.
    > Currently i have build a simple vi and need to convert it to dll so that i can call it from my VB.net. But the problem is how to call the labview dll from my VB.net?
    > &nbsp;
    > I know we must declare function something like this,
    > &nbsp;
    > Auto function Bodeplot Lib"..\\Bodeplot.dll" (Byval Val1 as double, Byval Val2 as double,...) as double
    > &nbsp;
    > but how&nbsp;to determine Val1, Val2 (and so on) is input for which data?&nbsp; if my&nbsp;vi have&nbsp;10 input (frequency, Kc,Fcz,Fcp,Wzrhp,Wp,k,Wz,Beta and Operation)&nbsp;? and how to&nbsp;select the output (my application have 3 possible output : magnitup loop,phase loop, and degree loop)
    > &nbsp;
    > In addition, since I'm using Labview 8.0 , and as i know apllication&nbsp; builder for this version cannot convert vi to dll which contain Mathscript (but unfortunely, my vi all use Mathscript), so really hope someone can help me to convert my vi to dll using Labview 8.2 (which&nbsp;remove this limitation).
    > &nbsp;
    > here I'm attach my Vi and really hope someone willing to help.
    > &nbsp;
    > Thank you.
    > &nbsp;
    >
    > bodeplot.vi:http://forums.ni.com/attachments/ni/170/272124/1/bodeplot.vi
    If you insist on using Labview with your project then you should
    consider using ActveX in place of using a dynamic link library to
    interface to your VB.net code. You don't need "Application Builder"
    if you use ActiveX. The Student, Basic and Full development versions
    of Labview for Windows come with ActiveX capability. For more
    information on ActiveX look up the subject ActiveX in Labview's Help
    File.
    Howard

  • How to call labview DLL from visual C++?

    Hi,
    I'm trying to call a LV DLL from a VC++ application
    by using the LoadLibrary and GetProcAddress functions.
    The DLL contains a simple sum function. The Library is
    loaded correctly, but the result is always 0.0000.
    I have loaded a VC++ DLL in a similar way and it works
    correctly. Also, I have tested the DLL by loading it in LV,
    and it works correctly. The calling convention is defined
    to be stdcall in LV Application Builder.
    I have also tried this solution, but I will get a compiler error
    from one the header files that are created by the LV when
    the DLL is made. The error comes from this line
    typedef char                int8;
    and the error states that
    ..\fundtypes.h(107) : error C2371: 'int8' : redefinition; different basic types
    If someone knows of newer tutorial(for LV 8.2) or knows how to use those
    LoadLibrary and GetProcAddress function for LV DLLs, I will appreciate the
    information greatly.
    Below is the code that I'm using for loading the LV DLL.
    Thanks
    #include "stdafx.h"
    #include <stdio.h>
    #include <stdlib.h>
    #include <map>
    #include <windows.h>
    int _tmain(int argc, _TCHAR* argv[])
        HINSTANCE LVLib = LoadLibrary(TEXT("Testdll"));
        typedef double (__stdcall *MYPROC)(double, double);
        if (LVLib != NULL)
            MYPROC ProcAdd = (MYPROC) GetProcAddress(LVLib, "Add");
            if (ProcAdd != NULL)
                double d = (ProcAdd)(5.5, 6.6);
                printf("sum = %f\n", d);
            else
                printf("Invalid function pointer\n");
        else
            printf("Failed to load the library\n");
        return 0;

    I was just about to post the header file of the DLL, when
    I noticed that there's a function called LVDLLStatus.
    This little thingie turned out to be a rather handy tool.
    With that function I found that in the DLL I had a problem
    with another function that prevented the DLL to be correctly
    loaded.
    This other function in the DLL is for generating digital output
    and it worked as it should, when tested from LV.
    Anyway if someone is interested, I got it working by using
    the LoadLibrary and GetProcAddress function, as in the
    source code thatI posted earlier.
    I will investigate what is wrong with that digital output, and
    post into a another thread if I have problems with that.

  • How to call labview DLL from C#, passing char, char[], float[], long, short

    Hi,
    I'm having trouble calling labview dll from C# to perform certain function.
    The function supposed to return the values in the float Analysis[] array. However, when I execute it it only returns zero values.
    It seems that some parameters are not properly passed to the dll.
    Below is the function in the header file:
    void __stdcall Optical_Center(char FileDirectory[], long ImagePtr,
        short int Height, short int Width, char ReadFromFile, float Analysis[],
        long lenAnalysis);
    and my corresponding dll import in c#:
    [DllImport(@"SMIA.dll", CharSet = CharSet.Ansi)]
            public static extern void Optical_Center([MarshalAs(UnmanagedType.LPStr)]string FileDirectory, long ImagePtr,
                short Height, short Width,char  ReadFromFile, IntPtr Analysis,
                long lenAnalysis);
    string str = @"C:\SMIA.raw";
    int len = 3;
    long m_lenAnalysis = 3;
    long m_ImagePtr = 0;
    short m_Height = 2464;
    short m_Width = 3280;
    IntPtr m_PtrArray = Marshal.AllocHGlobal(len * Marshal.SizeOf(typeof(float)));
    char m_ReadFromFile = '1';
    Optical_Center(str,m_ImagePtr,m_Height,m_Width,m_ReadFromFile,m_PtrArray,m_lenAnalysis);
    float[] m_Analysis = new float[len];
    Marshal.Copy(m_PtrArray, floatArray,0,len);
    Marshal.FreeHGlobal(m_PtrArray);
    string printstr = "";
    for (int i=0; i<len; i++)
        printstr = printstr + floatArray[i].ToString() + "\n";       
    MessageBox.Show(printstr);
    Appreciate if anyone can help, thanks.
    KL

    I was just about to post the header file of the DLL, when
    I noticed that there's a function called LVDLLStatus.
    This little thingie turned out to be a rather handy tool.
    With that function I found that in the DLL I had a problem
    with another function that prevented the DLL to be correctly
    loaded.
    This other function in the DLL is for generating digital output
    and it worked as it should, when tested from LV.
    Anyway if someone is interested, I got it working by using
    the LoadLibrary and GetProcAddress function, as in the
    source code thatI posted earlier.
    I will investigate what is wrong with that digital output, and
    post into a another thread if I have problems with that.

  • Calling LabView ActiveX Server from TCL?

    Does anyone have experience calling a LabView ActiveX server vi from
    TCL? I created a simple VI with one control (labeled "A") and one
    indicator (labeled "B") and a +1 adder between them. I can load and
    open the VI from TCL:
    package require tcom
    set lv [::tcom::ref createobject "LabView.Application"]
    set viPath "D:\\National Instruments\\LabView\\Activity\\a.vi"
    set vi [$lv GetVIReference $viPath]
    $vi FPWinOpen True
    But when I try to send in data:
    $vi -namedarg Call A 1
    I get the error message "unknown parameter A".
    I have also attempted to duplicate the "ActiveX Server" example
    from the LabView help file, calling "Frequency Response.vi". This
    approach encounters the same error message:
    % package require t
    com
    3.0
    % set lv [::tcom::ref createobject "LabView.Application"]
    ::tcom::handle0x013202F4
    % set viPath "D:\\National
    Instruments\\LabView\\examples\\apps\\freqresp.llb\\frequency
    Response.vi"
    D:\National Instruments\LabView\examples\apps\freqresp.llb\frequency
    Response.vi
    % set vi [$lv GetVIReference $viPath]
    ::tcom::handle0x01335AE8
    % $vi FPWinOpen True
    % $vi -namedarg Call Amplitude 10
    unknown parameter Amplitude
    If anyone can point me in the right direction, or give me an
    example of how to do this I would greatly appreciate it.
    TIA.
    Leslie

    In article ,
    Leslie Brooks wrote:
    >"Bruce Hartweg" wrote in message
    >news:...
    >> "Chin Huang" wrote in message
    >news:[email protected]...
    >> >
    >> > I don't use LabView, but from the Visual Basic example I saw, it seems
    >> > the Call method takes two arguments. The first is an array of parameter
    >> > names and the second is an array of parameter values. Try to send in
    >> > data with the Tcl command
    >> >
    >> > $vi Call [list A] [list 1]
    >>
    >> I'm unable to help the original question (don't know LAbView or VB stuff) but
    >> just want to point out that [list A] is equal to A and [list 1] is the
    >same as 1.
    >>
    >> Bruce
    >
    > I know what is supposed to be passed to the 'Call' method. Doing
    >this:
    >
    >set inst [::tcom::info interface $vi]
    >$inst methods
    >
    > produces (among other things):
    >
    >{1015 VOID Call {{{in out} {VARIANT *} paramNames} {{in out} {VARIANT
    >*} paramVals}}}
    >
    > So the 'Call' method is expecting two parameters, both pointers
    >to variants. TCOM appears to be passing the correct parameter type
    >because the TCOM documentation says that a TCL List maps to a
    >one-dimensional array of VT_VARIANT. However, the results are
    >INvariant (bad pun intended):
    >
    >% $vi -namedarg Call Amplitude 10
    >unknown parameter Amplitude
    >% $vi -namedarg Call [list Amplitude] [list 10]
    >unknown parameter Amplitude
    >% $vi -namedarg Call [list Amplitude] [list [::tcom::na]]
    >unknown parameter Amplitude
    >% set i 5
    >5
    >% $vi -namedarg Call [list Amplitude] {incr i}
    >unknown parameter Amplitude
    >% $vi -namedarg Call [list Amplitude] [list [incr i]]
    >unknown parameter Amplitude
    >% $vi -namedarg Call Amplitude [incr i]
    >unknown parameter Amplitude
    >
    > Who can help me with this? Who is the LabView Guru?
    Try invoking the Call method without the -namedarg option. The
    -namedarg option doesn't work the way you seem to think it works. The
    -namedarg option provides a way to specify arguments named from the
    method's parameter specification. For example, you discovered that the
    Call method take two parameters named "paramNames" and "paramVals".
    Tcom returns the error "unknown parameter Amplitude" because "Amplitude"
    doesn't match either parameter name.

  • How to call one vc++ dll inLabview?

    I am a new user of Labview,but I don't know how to call one dll compiled by vc++ in Labview,please the experts tell me how to call it and use what function .
    thanks a lot !!

    Hi 214552213;
    There are several references at NI Developer Zone that explain how to access a dll from LabVIEW. You need to know the function prototype of the function you are calling in order to make the right call from LabVIEW. If you have LabVIEW 6, it allows you to see the different functions, but not the necessary arguments. If you have LabVIEW 5, you can use a vi available from NI<
    /a> to view all the functions exported in a dll. Follow nchernin instructions...
    Using External Code in LabVIEW, which you can access from LabVIEW's help or access through the link above.
    If you are writing the dll, check the several articles in NI website. There is a lot of documentation, but specially for doing it using Microsoft's VC++.
    Regards;
    Enrique
    www.vartortech.com

  • Where can I get an example of how to call Labview.exe (Active X Server) from Visual C++

    I would like to Call Labview application (as Active X Server) from Visual C++. I need any type of exemple on how to do this, any input will be greatly apriciated.

    In the summer there has been an example in the Developer Zone, but i can't find it again. I can send you the attached zipfile from that example. The example is resricted to single threaded applications. In multi threaded applications you must initialise OLE in the thread where you communicate with the active-X server.
    If you need more information contact me at [email protected]
    Waldemar
    Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
    Don't forget to give Kudos to good answers and/or questions
    Attachments:
    VCandLabVIEW.zip ‏91 KB

  • How to Call third party Jar into Application

    Hi Can any Expert help ?
    I want to put third party Jar into my application but i have some problem occur.
    1. how to call jar with parameter in application ?
    2. when i exit the third party jar task, it will exit my main task too. How to set my main tast exit stats standalone ?
    3. I have over 10 jar files in one application, how can i set a classpath for client to call JNLP, instread of load all jar to client before run.
    Thanks.
    Sanki Poon ([email protected])

    1) Sounds like you are trying to launch the third party from it's application main instead of using it as an API How does your code interact with it or is that not important?. You don't call a jar, you load a class. You could use a exec http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Runtime.html to run the java launcher and pass it all it's command line stuff(But this may not be possible security wise via WebStart).
    2) if it is launched in the same JVM and it calls a System.exit there is nothing you can do about your app closing too. It would need to be in another instance of the JVM
    3) Under the resources tag you can have as many jar tags as needed.
        <resources>
            <j2se version="1.5.0" java-vm-args="-esa -Xnoclassgc"/>
            <jar href="/jsf-wita/apps/MathMLWebEditor.jar"/>
        </resources>

  • How to call precedure in impl into java bean

    Dear all,
    i'm tried to call procedure at impl.java into java bean.
    but, there is error which is it cannot find the root of this.getDBTranstation
    any idea.
    TQ

    Hi
    Please tell me
    How to call ethod in AppModuleImpl from other bean?
    I have created method in AppModuleImpl
    public String callFuncWithArgs(String p_company, String p_division, String p_user, String p_wrkord_type,
    String p_service_type, String p_HOLD_CODE_TYPE) {
    return (String)callStoredFunction(VARCHAR2, "WS_tran.Margin_TO_USER(?,?,?,?,?,?)",
    new Object[] { p_company, p_division, p_user, p_wrkord_type, p_service_type,
    p_HOLD_CODE_TYPE });
    This method is working after run APPModule. But I want to call this method from SparesTEOImpl class and
    public boolean validateUnitPrice(int unitprice) {
    //want to call here AppModuleImpl
    callFuncWithArgs(String p_company, String p_division, String p_user, String p_wrkord_type,
                                       String p_service_type, String p_HOLD_CODE_TYPE) here
    Please tell me how to call , I wrote in following ways but I got error...
    public boolean validateUnitPrice(int unitprice) {
    String margin=appImpl.callFuncWithArgs("00004","SDWSG", "S1","CSH", "SP","M");
    System.out.println("Output"+margin);
    return margin;
    After that I got the following error.
    Exception in thread "main" oracle.jbo.InvalidOwnerException: JBO-25301: Application module AppModuleImpl_0 is not a root app module but has no parent
        at oracle.jbo.server.ComponentObjectImpl.getRootApplicationModule(ComponentObjectImpl.java:177)
        at oracle.jbo.server.ApplicationModuleImpl.getDBTransaction(ApplicationModuleImpl.java:3656)
        at model.AppModuleImpl.callStoredFunction(AppModuleImpl.java:128)
        at model.AppModuleImpl.callFuncWithArgs(AppModuleImpl.java:160)
        at model.SparesTEOImpl.validateUnitPrice(SparesTEOImpl.java:55)
        at model.SparesTEOImpl.main(SparesTEOImpl.java:67)
    Process exited with exit code 1.
    Please tell me how to solve this problem...

  • How to call a file object into LinkedList?

    Hey all,
    I know LinkedList uses a String to be identified like: List<String> list = new LinkedList<String>;I was wondering if there was a way to convert a file object so that the LinkedList can use the file as a basis of sorting? I tried link.set(inputFile), but that doesn't work, as usual I tried List(file) list = new LinkedList(file); but that doesn't work either. I would use an array, but I heard people say not to use array or container when working with a large database?
    Right now, my only code to sort looks like:
         public boolean isAscending(File iFile) throws IOException
              List list = new LinkedList();
              ListIterator li = list.listIterator();
              if(li.hasNext() && iFile != null){
                   return true;
               else
                    return false;
         }}I know it's incorrect, but I need to call a .txt file into LinkedList, but as I said before, the methods that I know how to work with doesn't work with it?

    Sorry guys, I made a big mistake!
    Sorry for wasting your time, I got it fixed by myself!

  • How to call the Report program into Function module

    Hi Experts,
    Actually I want to create the DataSource. But I have only the ALV report program. I need to create function module but I don’t know how to call the ALV report program using in function module  
    So could you please any one send the Document or step by step method?
    Advance Thanks,
    Sathis

    If the report is just based out of a table than create a Generic Extractor using View.
    If its an InfoSet query than create a Generic Extractor on that InfoSet.
    If its an ABAP report than create a Generic Extractor using FM
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33

Maybe you are looking for

  • Access document which locks up computer unable to exit document

    Receive document on Email save to file. Open file to print. Computer locked up, Unable to edit using mouse or Keyboard Only able to remove from screen by restart computer.Did send in a requested fault report days ago but no reply.

  • I can't change the ringtone on my iPhone 4

    I recently changed my wife's incoming ringtone on my phone to one I recorded from a CD.  The default ringtone on my own phone is one I bought from Apple*. Doing this changed the default for ALL incoming calls to the one I set for my wife even though

  • XE and Java

    I know that Oracle XE-Edition doesn't support Java, but is it possible to install Java into Oracle XE supplementary? I need a package SYS.DBMS_JAVA. Thanks

  • Can TOC Book Default to Open?

    Is it possible to have a book in your TOC default to being open when the site is accessed? I have several books, but would like the first one to default to an open state while the remaining books default to closed. Thanks, Maggie

  • AT&T contract end?

    I've been hearing a lot of conflicting reports from people and the internet. When does the AT&T contract end with Apple? 2010 or 2012? My best friend told me yesterday he said it ends in 2012 but I've read 2010. So which is it?