Building Applications

Why building an application.

For the end user, one would like to run CS in the LabVIEW runtime environment rather than in the development environment. This is recommended, since real binaries
  1. execute faster,
  2. need less RAM,
  3. have a guaranteed consistency of the VIs used (they can't be changed!),
  4. check VIs for errors prior to executing the code, and
  5. do not require a development license.

Requirements

The following is required to build an application:
  1. LabVIEW runtime system, available from National Instruments (free), for each target system.
  2. For each target system running a DSCInterface process you need a runtime license for the DSC module. You have to buy the license from National Instruments (at GSI: included in our Campus license).
  3. For building an application, the application builder for LabVIEW from National Instruments is required within the development system.

Steps for building an application

There are many ways how-to-build an application. The following method is recommend and an example how-to include the device class for an arbitrary waveform generator DS345 into the build.
  1. Open the project explorer (see Fig. "View of Project Explorer").
  2. Open the CLASSNAME.contents.vi (here DS345.contents.vi) and make sure it is executable. Then close the CLASSNAME.contents.vi (see Fig. "DS345.contents.vi).
  3. Open "CS_Contents_User.vi", and add the CLASSNAME.contents.vi (here DS345.contents.vi) to the block diagram.
  4. In case the added class has inherited from other classes that are not part of the base package, those (here: CSApplicationBaseClasses.contents.vi) should also be added to the CS_Contents_User.vi (see Fig. "CS_Contents_User.vi").
  5. Save and close the CS_Contents_User.vi acknowledging to save all changed sub-VIs.
  6. Open an appropriate "Build Specification". Here you may start from the one with the name "CS_ApplicationSpecific".
    1. In the category "Application Information" edit the required information. For the version information I (db) always use the version numbers with major, minor, and fix of the CS version on which the build is based. Each individial application that is built gets an individual build number (see Fig. "ApplicationBuilder: Application Information").
    2. In the category "Source Files" make sure to have included "CS_Contents_User.vi", "CS_Contents_Main.vi" as well as all required shared libraries as "Dynamic VIs and Support Files". Use "CS_Start.vi" as "Startup VIs" (see Fig. "ApplicationBuilder: Source Files").
    3. In the category "Advanced" do check the option "Pass all command line arguments to application".
    4. In the categoy "Additional Exclusions" I (db) always select "Remove as much as possible".
    5. There are other things like setting the icon of the application etc. Moreover, you should think about a policy of choosing a proper target folder for the binaries created.
  7. Close the build specification by pressing "OK".
  8. In the Project Explorer, right-click on the build specification you just edited and select "Build".

Note: If you can't create an object of your class in the runtime system, check the VI templates (*.vit) of your class. VI Properties->Window Appearance->Custom->Show Front Panel when called. This flag must be marked. The same holds for all VIs that are used as GUI panels.

Note: In LabVIEW version 8.20, VI templates (*.vit) must not be part of a library. Otherwise the compiled binary will not work properly (SRQ 508638). In case your application uses VI templates, you must have them outsided libraries somewhere in your project. I (db) always use a dedicated virtual folder "VI templates" that contains all VITs of my project.

Note: If you use VI templates (*.vit), as an example for a GUI class, you also must add the VIT to the CLASSNAME.contents.vi. Make sure you have really added the VIT itself and not an instance created from the VIT. On the connector pane, the VIT will be marked by a blue "T" (see Fig. "AFGBaseGUI.contents" as an example).

Figures

View of Project Explorer

view of project explorer

DS345.contents.vi

DS345.contents.vi

CS_Contents_User.vi

CS_Contents_User

ApplicationBuilder: Application Information

ApplicationBuilder: Application Information

ApplicationBuilder: Source Files

ApplicationBuilder: Source Files

ApplicationBuilder: Advanced

ApplicationBuilder - Advanced

AFGBaseGUI.contents.vi

AFGBaseGUI.contents.vi

-- DietrichBeck - 18 Jan 2008
Topic revision: r4 - 2008-09-25, DietrichBeck
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding GSI Wiki? Send feedback | Legal notice | Privacy Policy (german)