Run-time DLL in CVI 8.0

I never work bevore with DLL but I want to learn it. So I create without big problems a program with a static DLL in LabWindowCVI 8.0
Now I want understand the handling of dynamic DLLs. I read this (http://digital.ni.com/public.nsf/websearch/8AE57BD​A995ACCB486256AEA0062B3C6?OpenDocument) article and build my own program like the example but it does not work and show many errors. I have only changed myFunction and MYDLL.DLL with my own names. CVI seems not understand the instructions.
It could be that I understand the instruction wrong. I do not realy understand the wxample code. Can you help my and explain it esay?
Solved!
Go to Solution.

Hi Susay,
As a first step, you need to include the stdio and windows headers to get access to the Windows SDK functions that you will need for the dynamic DLL call:
First you load your dll - Make sure that you pass a correct file path to the LoadLibrary function.
Then you find the function in the dll by calling GetProcAddress and passing the function name you would like to call.
Then you can call the function by using the typedef'd function pointer. (You would have to define one for each function to call)
You should start by using an example, which you can find here: Calling a DLL in CVI: Explicit Linking vs. Implicit Linking (Dynamic vs. Static)
The example is explained on this page: Calling a DLL in CVI (Tutorial). These pages also contain links that may help you decide which linking method to use.
Don't hesitate to ask if other questions arise. Good luck!
Peter
Peter A.
Field Sales Engineer, NI Germany

Similar Messages

  • How to Load a Panel during run time from a CVI dll

    Hi,
    I want to execute/load a panel during runtime, from a CVI dll function.
    my CVI dll "test.dll" has "READ_PAN" function. while executing this function from a Test Stand Action step i want Configure Panel (from FR_GUI.uir) to pop up.
    can you please suggest me how can i do this from my "test" project of CVI.
    int __stdcall __export RunFRConfig (CAObjHandle step,CAObjHandle thisContext)
        ERRORINFO errorInfo;
        char errMsg[1024];
        int pan;
        pan = LoadPanelEx (0, "FR_GUI.uir", READ_PAN, __CVIUserHInst);
        DisplayPanel (pan);
        RunUserInterface();
        DiscardPanel (pan);
        return 0;
            Error:
       // sprintf(FinalErrMsg,"Configure Error: %s",errMsg);  
        return -1;

    Thanks for ur reply.
    Hello Asad,
    It is possible to maximize the run time previewer when calling reports from forms. U need to set a parameter named 'MAXIMIZE' to do that.
    I m attaching a code sample for u. This is working in my production environment.
    DECLARE
    pl_id ParamList;
    BEGIN
         pl_id := Get_Parameter_List('setProposal');
         IF NOT Id_Null(pl_id) THEN
              Destroy_Parameter_List( pl_id );
         END IF;
         pl_id := Create_Parameter_List('setProposal');
    // This parameter is set to hide parameter form at run time     
         Add_Parameter(pl_id, 'PARAMFORM', TEXT_PARAMETER, 'NO');
    // This parameter is used to maximize previewer window at run // time
         Add_Parameter(pl_id, 'MAXIMIZE', TEXT_PARAMETER, 'YES');
    Run_Product(REPORTS, 'sample.rep', SYNCHRONOUS, RUNTIME,
    FILESYSTEM, pl_id, NULL);
    END;
    Feel free to contact me if u need anymore assistance.
    Take care and bye

  • Folder of application builder(*.exe) with run-time DLL

    My application consists of main.vi, subvi folder, and example folder.
    In addition, I have to add the run-time libraries for add-on tool kit (advanced signal processing, lvwa.dll) which should be located in the root folder.
    (For exe application, can I set the location of DLLs to not the root folder but "DLL folder"?)
    In my several trials, I can't maintain the hierachy of "example folder".
    Instead of my intension, the NI application builder copied the files in the folder to the support directory.
    Can I locate the "example folder" to the root folder by using NI application builder?
    In summary, I want to get the folder structure by application builder.
    main.exe, DLL folder, Example Folder.
    메시지가 08-08-2008 01:30 AM에 labmaster에 의해 편집되었음

    Hey Labmaster,
    What version of LabVIEW are you using?
    I am not too clear as to what you are trying to do. You can create folders and add anything from your project when creating an installer under the Source Files section in its properties.
    It might be easier if you'd attach a screen shot of what you are doing or trying to do.
    Aashish M
    Applications Engineer
    National Instruments
    http://www.ni.com/support/

  • CVI Run time engine installation

    Hi,
    We are using TestStand extensively and in our installation package will be
    installing the CVI RTE (run-time engine). Where can I find exactly which
    files (DLL's especially) are installed by the CVI RTE setup.exe?
    Iain

    Iain,
    The CVI RTE installer installs CVIRT.dll and CVIRTE.dll in your Windows\System
    directory (Win98/95) or Windows\System32 directory (Win2000/NT). It also
    creates a CVIRTE directory in the same.
    You can get the latest CVI RTE installer from ftp://ftp.ni.com/support/labwindows/
    It consists of 2 floppy disks.
    By default, the TestStand 1.0.x engine installer utility will install the
    CVI 5.0.1 RTE. You can have the TS engine installer install the latest CVI
    RTE by replacing the CVIRTE directory in your TestStand\Setup\Engine\ directory
    *before* running the TS Engine Installation Wizard.
    Hope this helps,
    Paul
    "Iain Simpson" wrote:
    >>Hi,>>We are using TestStand extensively and in our installation package
    will be>installing the CVI RTE (run-ti
    me engine). Where can I find exactly
    which>files (DLL's especially) are installed by the CVI RTE setup.exe?>>Iain

  • LabWindows/CVI 2009 Run-Time Engine update

    I wanted to let everyone know that NI has released an udpated CVI 2009 Run-Time Engine. Information on what bug(s) this update fixes can be found here. If you are currently not using the CVI 2009 Run-Time Engine, you do not need to install this update.
    This is an updated installation of the CVI Run-Time Engine, not a patch. If you download and install this update it will upgrade whichever version of the CVI Run-Time Engine you currently have to version 9.1.0.428 (CVI 2009 released with version 9.1.0.427). One way to find out which version of the CVI Run-Time Engine you have installed is to view the version number of c:\windows\system32\cvirte.dll. If you install version 9.1.0.428, any installer distributions that you create from any version of the CVI ADE will include version 9.1.0.428.
    If you have not yet installed LabWindows/CVI 2009, it's recommended that you install this update, either before or after you install CVI 2009.
    Luis

    To be clear, the original problem that you reported ("Attempt to free pointer to memory not allocated by malloc() or calloc()") might very have been the problem that this patch fixed, which was in fact new to 2009. But that problem only happens if there were actual plots in the graph.
    However, after looking at the "dynamic memory is corrupt" isse some more, it turns out that it is actually expected behavior, believe it or not. This is a limitation of easytab controls, caused by how they use callback chaining in their implementation. Whenever a panel or a control has its callback chained, you cannot change the callback, or make a copy of it after the chaining takes place. This is described in the EasyTab_ConvertFromCanvas function help ("...For the same reasons, do not call DuplicatePanel or DuplicateCtrl on any of these panels or controls after the Easy Tab control has been created.").
    As you probably have read elsewhere, easytab controls are quite obsolete. They were a stopgap "solution" to the problem of there not being a native tab control in the CVI user interface library. Native tab controls were finally added in CVI 8.0, and so we recommend that, if possible, users update their code to use these instead.
    Luis

  • NI 5660 Driver DLL Errors when using Teststand 2010 and LabVIEW Run-Time Engine 2010

    This problem seems similar to the post "Resource not found error in executable on developmen​t machine." but I didn't want to repost under that thread because I only happened upon it by chance and none of my searches brought me there... so I made a more descriptive Subject.
    I am working on a system that uses a PXI Chassis with a NI 5600 Downconverter and a NI 5620 high speed digitizer, among other PXI Cards. 
    I inherited working code written in LabVIEW 2010, running with the LabVIEW Run-Time Engine 2010.  The code was using a custom executive and my task was to rewrite the test using TestStand 2010.  I reused the majority of the old code.  The old code used NI-5660 to control the 5600 and 5620.  When I run my sequence using the LV Development System and TestStand, it runs without any issues.  When I change the adapter over to LabVIEW Run-Time Engine 2010, all of my NI5660 VIs become broken due to DLL issues.  It warns that the nipxi5600u​.dll was not initialized correctly.  Many of the errors are associated with the NI Tuner and NI Scope. After this LabVIEW will crash randomly, and the seqeunce will not work in TestStand even when back with the LV Development Adapter.  The only way to recover after this is to restart the computer - TestStand automatically reverts back to the development system, the VIs are no longer broken and the sequence works again. 
    I have all of my VIs associated with a project. After reading a little bit about DLLs and TestStand, I found all of the DLLs in the dependencies section of my project and added them to my TestStand workspace.  I also used Dependency Walker to track down the problems with the nipxi5600u​.dll, the 2 DLL files that it said were not found already existed in the same folder as the original DLL (C:\Windows\System32).  I have also performed a Mass Compile to make sure everything was running in LV 2010.  If I skip the steps involving the 5660, my entire sequence runs fine. 
    The previous code was running with the LabVIEW Run-Time Engine without any issues.  Is there just a step I am missing?  Has anyone seen anything like this before?  I can send screenshots of errors to provide more detail if necessary. 

    I have tried some more things and still can't get it to work.  I have added the VIs mentioned in the Notes On Creating Modulation Executables KB both to the TestStand workspace and the LabVIEW project holding all of my VIs.  This did not change the results. 
    When I try to run my sequence, The first error I get is shown in Error 1445.bmp.  This happens when I try to use the NI 5660 initialize.vi.  If I click ignore, the next error I see is shown in Error -20551.bmp.  When I try to open the VI to look at it, I get the 2 DLL errors shown in Error loading nipxi5600u.bmp and Error loading nidaq32.bmp.  When I close TestStand, I get the error LabVIEW Fatal Error.bmp. 
    Attachments:
    Error1445.JPG ‏164 KB
    Error -20551.JPG ‏174 KB
    Error loading nipxi5600u.JPG ‏9 KB

  • How to prevent prompt to install CVI Run-Time Engine?

    The LabVIEW laptop for my client got messed up, so I spent several hours making it forget everything it ever knew about NI software.  I started by uninstalling all NI applications, then manually deleted all the folders that the uninstaller leaves behind, then ran a couple of registry cleaners to sweep out as much NI as possible, and finally ran regedit to see what was left.  In the end there were only some legacy drivers that regedit would not let me delete.
    Then I installed 8.6.1 from DVD, carefully selecting only the options we needed; LabVIEW core, cRIO, FPGA, PID, and the minimum set of drivers the installer would let me get away with.  Note that no Labwindows/CVI option boxes were checked.  When the installation was complete, I rebooted the machine and launched LabVIEW, which immediately prompted me to install the LabWindows/CVI 8.5.1 (not 8.6.1) Run-Time Engine.  I dutifully fed it my 8.6.1 DVD, which caused LabVIEW to crash.  After 3 reboot/retry cycles with the same result, I decided to appeal to the forum for help.
    What is causing LabVIEW to think I need the CVI Run-Time Engine (and a down-rev version, at that), and how do I convince LabVIEW that I do not?
    Jeff

    Thanks for the reply!  OK, so LabVIEW needs the CVI RTE even though I'm not using any CVI features.  I can live with that.  I downloaded LabWindows/CVI Run-Time Engine 8.5 from the NI web site and tried to install it.  After I confirmed that I accepted whatever that license agreement says, the installer told me that "No software will be installed or removed."
    Then I opened LabVIEW, and it went through the same "The feature you are trying to use..." popup and tried to install the CVI RTE.  The installation failed as usual, and LabVIEW crashed.
    A few minutes ago I found and ran CVTRTE.msi on the 8.6.1 distribution DVD.  I selected the "repair" option, which completed successfully.  After rebooting, I launched LabVIEW only to be greeted with the now-hated NI LabWindows/CVI 8.5.1 Run-Time Engine installer.
    The part of this that is so infuriating is that there appears to be no way for anyone to make a computer forget everything NI so you can start with a clean slate.
    Jeff
    Attachments:
    NoCanDo.jpg ‏28 KB

  • Announcement: LabWindows/CVI 2010 SP1 Run-Time Engine Updated

    A new version of the LabWindows/CVI 2010 SP1 Run-Time Engine (10.0.1.434) is now available for download. The new version includes Security Update 5Q5FJ4QW which resolves security vulnerabilities in components installed with LabWindows/CVI 2010 SP1 and earlier and LabVIEW 2011 and earlier. Further details can be found at KnowledgeBase Article 5Q5FJ4QW: How Does National Instruments Security Update 5Q5FJ4QW Affect Me? Installing the security update will have the same effect as installing the new version of the Run-Time Engine.
    The update can be downloaded from the Drivers and Updates page. The LabWindows/CVIRun-Time Engine is a free download.
    National Instruments
    Product Support Engineer

    The correct link should be this one
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • RoboHelp for Word Version 8-Run-time error 49-Bad DLL calling convention

    I just installed the trial version of RH8. I have RH5 installed. I also have Word97 installed. When I start RH8, the RH Explorer pane opens, but when it tries to open Word, the following error message appears: "Microsoft Visual Basic - Run-time error '49'. Bad DLL calling convention." Any ideas on what I can do to fix this problem?

    See Snippets on my site.
    See www.grainge.org for RoboHelp and Authoring tips
    Follow me @petergrainge

  • Run Time Error 429 - ActiveX Controls CRAXDRT.DLL Dependancy

    Post Author: mhamlyn
    CA Forum: Deployment
    After upgrading from Crystal Reports 11.0 to 11.5 we have found that when deploying an application and bundling it in Install Shield we continually get an error when trying to view crystal reports:
    Run-time error '429':ActiveX component can't create object
    From what we can see this is partly caused by the incorrect setup of the craxdrt.dll dependancey file, point to previous versions of business objects i.e.
    C:\Program Files\Common Files\Business Objects\3.0\bin
    Where it should be
    C:\Program Files\Common Files\Business Objects\3.5\bin
    Even after editing this file and amending the correct locations we still get this error. Has anybody had any success in resolving this. There are lots of forum posts but no diffinitive answers!
    This is an extremelly frustrating problem!
    PLEASE HELP!!!!

    Hi Shane,
    Here is another way to create PDF with Macro using another API than Distiller. This API is faster too.
    Probably this post is not of interest anymore but here is how I have done it:
    1. Download PDFCreator: http://sourceforge.net/projects/pdfcreator/
    2. Use the following Macro:
    Option Explicit
    Sub printPDFmacro()
    'Author : Ken Puls (www.excelguru.ca)
    'Macro Purpose: Print to PDF file using PDFCreator
    ' (Download from http://sourceforge.net/projects/pdfcreator/)
    ' Designed for early bind, set reference to PDFCreator
    Dim pdfjob As PDFCreator.clsPDFCreator
    Dim sPDFName As String
    Dim sPDFPath As String
    '/// Change the output file name here! ///
    sPDFName = "Facture-" & nclient2 & " le " & Format(Date, "yyyy-mm-dd") & ".pdf"
    sPDFPath = "E:\Partenaire Scolaire\Comptabilite\Factures"
    PDFFileName2 = sPDFPath & "\" & sPDFName
    Set pdfjob = New PDFCreator.clsPDFCreator
    With pdfjob
    If .cStart("/NoProcessingAtStartup") = False Then
    MsgBox "Can't initialize PDFCreator.", vbCritical + _
    vbOKOnly, "PrtPDFCreator"
    Exit Sub
    End If
    .cOption("UseAutosave") = 1
    .cOption("UseAutosaveDirectory") = 1
    .cOption("AutosaveDirectory") = sPDFPath
    .cOption("AutosaveFilename") = sPDFName
    .cOption("AutosaveFormat") = 0 ' 0 = PDF
    .cClearCache
    End With
    'Print the document to PDF
    ActiveSheet.PrintOut copies:=1, ActivePrinter:="PDFCreator"
    'Wait until the print job has entered the print queue
    Do Until pdfjob.cCountOfPrintjobs = 1
    DoEvents
    Loop
    pdfjob.cPrinterStop = False
    'Wait until PDF creator is finished then release the objects
    Do Until pdfjob.cCountOfPrintjobs = 0
    DoEvents
    Loop
    pdfjob.cClose
    Set pdfjob = Nothing
    end sub
    Have any questions, just have to poke me.
    Michael

  • Does CVI install the LabVIEW Run-Time Engine?

    Hello,
    running the NI Update Service suggests to download a 226 MB patch for the LabVIEW 2012 Run-Time Engine... (all I installed knowingly was CVI2012)
    --> How can I check if the computer has this engine installed, what is the file name to search for (and is it needed by CVI)?
    Thanks!
    Solved!
    Go to Solution.

    Hello,
    1) You can use Measurement And Automation Explorer (MAX) to see the National Instruments Softwares installed:
    2) Some CVI softwares use the Labview runtime.
    By example, when you use the CVI Menu: Help / Find Examples... , you launch NIExampleFinder.exe which uses the labview runtime:
    3) When you install the NI-VISA library, the software C:\VXIPNP\WinNT\NIvisa\NIvisaic.exe is also installed. This utility is a Labview Software.
    I think it's difficult to avoid the Labview runtime on a computer with NI softwares installed...

  • Fatal Run-Time - Unknown Fault - on any CVI program close

    I have been trying to track down a few what seem like phantom Fatal Run Time Errors on my program closes.
    I am running LabWindows/CVI 2010 Full 10.0.1 (419)
    I originally posted here -> http://forums.ni.com/t5/LabWindows-CVI/EasyTab-ConvertFromCanvas-memory-leak/m-p/3084769#M69465
    As I thought this was related to tabs, where my resource tracker shows 'unclosed' resources.
    Now I am opening a different program and have found that even though I put my return 0; at the top of my main loop, I still get a fatal run time error.
    The error is exactly:
    FATAL RUN-TIMe ERROR
    Unknown source position, thread id 0x00001BB4 
    The program has caused a 'Unknown' fault at 0x748A4F11
    This occurs every time I run my program in the CVI IDE.
    There are no allocated resources in my resources window.
    Searching for either address in my map file brings no results.
    Thanks,
    Nick

    Hi ngay528,
    I have attached a link below to one of our discussion forums that walks through using the Resource Tracking feature of LabWindows/CVI. Again, sometimes this particular error is caused by leaving resources open at the end of an application, so this feature can help us identify those resources if that is the case. Please follow the steps listed in the solution of the thread (message number 4, marked in green). 
    FATAL RUN-TIME ERROR: Unknown source position, thread id 0x00000EB4: The program has caused a 'General Protection' fault at 0x00459B9D:
    http://forums.ni.com/t5/LabWindows-CVI/FATAL-RUN-TIME-ERROR-Unknown-source-position-thread-id/m-p/16...
    Thomas N.
    Applications Engineer
    National Instruments

  • Run time error: Templates and DLL�s

    I am developing on a Sun Solaris box in C++. I have a function that I want to be dynamically linked at run time. CALLEDB.cc is my function. CALLINGA.cc is my user's source. In CALLINGA.cc is the function prototype
    extern void CALLEDB(thing1 &, thing2 &, thing3 &);
    CALLEDB.cc is compiled with
    CC -pic -c CALLEDB.cc -D _SOLARIS -library=iostream -mt -limqb23ss -limqs23ss -lmqm -lmqmcs -lmqmzse -lsocket -lnsl -ldl -o CALLEDB.o -v -g
    it is linked using
    ld -G -o CALLEDB.so CALLEDB.o
    the calling program is compiled and linked like this
    CC CALLINGA.cc CALLEDB.so -D _SOLARIS -library=iostream -mt -limqb23ss -limqs23ss -lmqm -lmqmcs -lqmzse -lsocket -lnsl -ldl -o CALLINGA.o -v -g
    first I compile CALLEDB
    then I link CALLEDB
    then I compile and link CALLINGA
    I get a fatal error message back from the ld
    Undefined first referenced
    symbol in file
    IO010<someobject>::ropen(const char *) blahblahblah
    IO010<someobject>::readmsg020(int, thing&) blahblahblah
    IO010<someobject>::IO010<someobject>(void) blahblahblah
    IO010<someobject>::~IO010<someobject>(void) blahblahblah
    ld: fatal: Symbol referencing errors
    those four methods use templates and I think the problem I have is
    that it can't find the template library that the original compile of the CALLEDB creates
    Templates.DB
    I thought I found a work around. I commented out the couple lines of code that used those methods and went through all three scripts sucessfully. I could execute the CALLINGA program and it executed the CALLEDB function sucessfully. Then I recompiled and linked the CALLEDB with the methods turned on again. CALLINGA ran ok, CALLEDB ran ok unless it tried to run those tem-plated functions. I would get a run time Abend.
    Does anyone know what I need to do to use both Templates and DLLs.
    Thanks for your assistance

    Check for .dll files Go to C:\Program Files (x86)\iTunes and C:\Program Files\iTunes and look for .dll files. If you find QTMovie.DLL, or any other .dll files, move them to the desktop. Reboot your computer. Note: Depending on your operating system, you may only have one of the listed paths.
    So they want me to put all of the DLL files to desk top?  I dont have any that have QTmovie
    I have:
    In itunes .resources folder:
    itunes.dll
    itunesRegistry
    In itunesHelper.resources  folder
    ituneshelper.dll
    In Itunes main folder: ie. program files (x86) Itunes
    gnsdk_dsp.dll
    gnsdk_musicid.dll
    gnsdk_sdkmanager.dll
    gnsdk_submit.dll
    iAdCore.dll
    itunes.dll
    itunesadmin.dll
    ituneshelper.dll
    itunesoutlookaddin.dll
    Sorry I'm not a real computer dude but would like to resolve and not lose all my music etc.
    Thanks
    G

  • Has NI plans to develop CVI for WinCE run time engine?

    Has NI  plans to develop  CVI  for WinCE run time engine?

    At this point, LabWindows/CVI does not have plans to support Windows CE. There are many reasons we do not have plans for support, but two main reasons are:
    Windows CE uses a different kernel from other Windows operatings systems.
    Windows CE does not support the full WinAPI.
    National Instruments
    Product Support Engineer

  • Run-time error 339 mozctl.dll

    I cannot run some business software because I keep getting Run-time error 339 component 'mozctl.dll" or one of its dependencies not correctly registered: a file is missing or invalid. I have used 3 different registry cleanup programs that are supposed to fix it and none do. I have uninstalled Firefox and reinstalled Firefox and nothing seems to help
    == This happened ==
    Every time Firefox opened
    == Every time I try to run my tax software that tries to check for updates. ==
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; YPC 3.0.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; yie8)

    Colin,
    Have you tried the shipping examples? Do these work for you, or do they give the same error? Also, it may help to manually add a refence to the driver under Project -> References -> Browse -> nidaq32.dll.
    Hope this helps,
    Ryan V.
    Ryan Verret
    Product Marketing Engineer
    Signal Generators
    National Instruments

Maybe you are looking for

  • Vendor Invoice - Outgoing Payment -How to apply cash discount automatically

    Hi Folks, My Vendor is 400000 - whose payment terms is : 0002 I posted a vendor invoice using FB60 : where i checked the payment terms is 0002 3% Cash Discount within 14 days                                                                 2% Cash dis

  • Hi, I'm a bit worried about safety now. I just sold an old Apple G4 laptop to a random guy because it was completely broken.

    It won't start up.  Now I'm scared that that person can manage to reboot the laptop and steal all my personal information. Is that likely/ possible?  I looked at what sort of information is stored in one of my user accounts, and it's mainly applicati

  • Software Updates in an Untrusted Forest

    Hi all, I've build a SCCM2012R2 site with 2 forests involved. They are UNTRUSTED. Forest 1 contains a primary site with SQL and a secondary across WAN distribution point. This all worked great for Applications and Window Updates. The second untrusted

  • Where do I find my downloaded apps?

    I have been on App World and downloaded a number of apps for my new Playbook but cannot locate them anywhere on my device? I have even rebooted the device and still cannot find them.  Help?! Solved! Go to Solution.

  • Morroring of serial interface....??

    Hi.. Is it possible to mirror a WAN interface on the router.Means if the packets are coming on one serial interface can go to another mirrored serial interface at the same time. i need to analyze A WAN link with out putting the analyzer in between th