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
- execute faster,
- need less RAM,
- have a guaranteed consistency of the VIs used (they can't be changed!),
- check VIs for errors prior to executing the code, and
- do not require a development license.
The following is required to build an application:
- LabVIEW runtime system, available from National Instruments (free), for each target system.
- 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).
- 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.
- Open the project explorer (see Fig. "View of Project Explorer").
- 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).
- Open "CS_Contents_User.vi", and add the CLASSNAME.contents.vi (here DS345.contents.vi) to the block diagram.
- 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").
- Save and close the CS_Contents_User.vi acknowledging to save all changed sub-VIs.
- Open an appropriate "Build Specification". Here you may start from the one with the name "CS_ApplicationSpecific".
- 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").
- 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").
- In the category "Advanced" do check the option "Pass all command line arguments to application".
- In the categoy "Additional Exclusions" I (db) always select "Remove as much as possible".
- 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.
- Close the build specification by pressing "OK".
- 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).
View of Project Explorer
ApplicationBuilder: Application Information
ApplicationBuilder: Source Files
- 18 Jan 2008