NI Tutorial 4039 En

Embed Size (px)

DESCRIPTION

national instrucment

Citation preview

  • 1/4 www.ni.com

    1.

    Creating Executables with the LabVIEW Application BuilderPublish Date: Jul 17, 2014

    Table of Contents

    Creating an Executable

    Refer to the (linked below) and the (linked below) for the most recentLabVIEW Help LabVIEW Application Builder User Guideversion of these instructions.The LabVIEW 5.1 Application Builder marked a significant change in the way you create executables from your LabVIEW VIs.Previous versions of the Application Builder used a three-step process to create applications: save your VIs into a LabVIEWLibrary (LLB) file (using the "Save With Options" feature), build the executable using this LLB file, and then create a distribution kitfor your application. Each executable that you built included the LabVIEW Run-Time Engine (LVRTE), which meant that even asimple program would be at least 2 MB in size (the size of the LVRTE).As of LabVIEW 5.1, you just tell the Application Builder what your main VI is and it does the rest, dynamically including all of yoursubVIs and any functions/VIs from LabVIEW that you need in your application. The exception is that you must specify anydynamically-loaded VIs or external code that you use, during the build process. The LabVIEW Run-Time Engine is no longerincluded with every executable, so you can have multiple executables on the same target machine, but only require one instanceof the LVRTE (for each unique version of LabVIEW) to run them. This decreases the size of your executables and gives you moreflexibility with your applications.The LabVIEW 6i (6.0) Application Builder is very similar to the LabVIEW 5.1 and 5.1.1 versions with a few differences:

    LabVIEW 6i (6.0) allows you to create dynamic link libraries (DLLs) on Windows platforms or shared libraries on MacOS/UNIXplatforms.The 3D Graph, DataSocket, and NI Reports support files are now part of the LabVIEW Run-Time Engine installation onWindows platforms.There is a "Help" button that opens the LabVIEW Help files for the steps involved in creating an executable and/or DLL/sharedlibrary.

    1. Creating an Executable

    You have a number of options available to you when creating an executable and these are described in the following paragraphs.You can store these options with the "Save" button.

    Initial Application Builder ScreenUse this screen to name the application and select the directory where the built application will be created.

    The Source TabThe Application Builder needs to know what your main VI is, so use the "Add Top Level VI" button to specify this VI. Any subVIsthat you have in your application will be included automatically. The LabVIEW 5.1 and 5.1.1. Application Builders also require youto use the "Add Dynamic VI" button to specify dynamically-loaded VIs (e.g., VIs that you load using VI Server) and the "AddSupport Files" button to specify any external code (e.g., DLLs or help files) that your application uses. (Note that VIs added asdynamic will become part of the executable, as well as their subVIs.) You may use the "Custom Destinations" button to createadditional subfolders for your support files.

  • 2/4 www.ni.com

    The LabVIEW 5.1 and 5.1.1 Application Builder includes the daqdrv (for data acquisition) and serpdrv (for serial communication)support files by default. The LabVIEW 6i Application Builder no longer requires daqdrv. Regardless of your Application Builder andLabVIEW version, you must always install the appropriate driver files on the target machine. For example, if your applicationcommunicates with a DAQ board and a GPIB board, then you must install NI-DAQ and NI-488.2 on your target machine.

    The VI Settings TabYou can verify the VIs that will be included in your executable with this screen. The list includes individual settings for each VI. Tochange the settings for a VI, such as whether panels and diagrams are removed or whether users can see the menu or abort theVI, use the "Edit Build Settings" button. As of the LabVIEW 5.1 Application Builder, you have the option to scale your front panelsto the resolution of the target system. (No more oversized controls on those smaller monitors.)

    The Applications Settings TabThe Application Builder now allows you to change the icon of your executable to any icon file (.ico), but you will need an icon editor(not provided) to create this file. Also, your executable may be an ActiveX server. Please note that you will need to run theexecutable to register it as an ActiveX class with the Windows operating system.

  • 3/4 www.ni.com

    The Installer TabBy default, no installer is created; to create an installer, check the "Create Installer" checkbox. One new feature of the installer isthat you can now choose for the installer not to segment files, if you plan to ship the installer on a CD. The installer can only saveto the hard drive, but if you select segmented files, it will save the compressed files to a "Disks" directory along with the setupprogram. Then, you can copy Setup.exe and Data.001 to the first disk, Data.002 to the second disk, and so forth.

    For the LabVIEW 5.1 and 5.1.1 Application Builders, the setup program does not include the LabVIEW Run-Time Engine, whichhas its own setup program in a directory called RunTime. The Run-Time Engine can be copied onto two 1.4 MB floppies; copyeverything except "data2.cab" to the first disk, and then place "data2.cab" on the second disk.

    Note: If you want your executable to use the same settings that LabVIEW uses (e.g., font settings, print settings, etc.),then you must create an ini file for your executable. See KnowledgeBase 0I4E2303 linked below.

    The "Advanced" button allows you to do things like run your executable immediately after it installs on the target system. For theLabVIEW 5.1 and 5.1.1 Application Builders, if you use DataSocket, NI Reports, and/or 3D Graphs, then you also need to selectthose features from the "Advanced" button. For LabVIEW 6i, they are included with the LabVIEW Run-Time Engine. Running the Executable

    After you have pressed the "Build" button and Application Builder finishes writing the executable to disk, you are ready to run it.Regardless of your Application Builder and LabVIEW version, you must always install any required driver files on the targetmachine. For example, if your application communicates with a DAQ board and a GPIB board, then you must install NI-DAQ andNI-488.2 on your target machine. (You may see a crash or a message that a VI was not found, if the drivers that support yourapplication are not installed.) Creating Distribution Disks

    See KnowledgeBase 1JMAJEFP (linked below) for information about creating distribution disks with the LabVIEW 5.1 and 5.1.1

  • 4/4 www.ni.com

    See KnowledgeBase 1JMAJEFP (linked below) for information about creating distribution disks with the LabVIEW 5.1 and 5.1.1Application Builders.For LabVIEW 6i, the image files for your distribution disks will be in disks subdirectory within the destination directory that youspecified in the initial Application Builder screen. You can copy them to 1.4 MB floppy disks by copying the Setup.exe file and theData.001 file to the first disk, and then each Data.00x to a different disk, resulting in N setup disks for your application (where N isthe number of data files generated during the build process). The LabVIEW Run-Time Engine is included and will automaticallylaunch its own installer as part of the setup program for your application. Also, it will detect whether the LabVIEW Run-TimeEngine is already installed on the machine and give you options to Modify, Repair, or Remove it.Related Links:

    LabVIEW HelpManual: LabVIEW Application Builder User GuideKnowledgeBase 0I4E2303: Using Your LabVIEW Preferences with a Stand-Alone ExecutableKnowledgeBase 1JMAJEFP: Application Builder for LabVIEW 5.1 (or Higher) - Creating Distribution Disks