Building Applications and Creating DLLs in LabVIEW

background image

ni.com

ni.com

Building Applications and

Creating DLLs in LabVIEW

Kyle P. Gupton

LabVIEW R&D Group Manager

Thurs Aug 17

12:00-1:15 p.m., 3:30-4:45

p.m.

Cedar (8C)

background image

ni.com

ni.com

Topics

Topics

 System requirements
 Project architecture
 Building the application or shared

library

 Creating the installer

 System requirements
 Project architecture
 Building the application or shared

library

 Creating the installer

background image

ni.com

ni.com

Development Requirements

Development Requirements

 Building applications and shared libraries

• LabVIEW Professional Development System

OR

• LabVIEW Base Package or Full Development

System + Application Builder

 Building shared libraries

• MPW ToolServer (Macintosh)
• GNU C Compiler (All UNIX platforms) OR
• Unbundled C Compiler (Solaris only)

 Building applications and shared libraries

• LabVIEW Professional Development System

OR

• LabVIEW Base Package or Full Development

System + Application Builder

 Building shared libraries

• MPW ToolServer (Macintosh)
• GNU C Compiler (All UNIX platforms) OR
• Unbundled C Compiler (Solaris only)

background image

ni.com

ni.com

Deployment Requirements

Deployment Requirements

 All applications or shared libraries built

in LabVIEW require the LabVIEW Run-
Time engine

 In LabVIEW 6i, this is true on all

platforms

 All applications or shared libraries built

in LabVIEW require the LabVIEW Run-
Time engine

 In LabVIEW 6i, this is true on all

platforms

background image

ni.com

ni.com

Project Architecture

Project Architecture

 All LabVIEW projects have a high-level

architecture

 Typical high-level architectures of

LabVIEW projects include:

• Top-level VIs only
• Top-level VIs and dynamically-called VIs

 Note that this architecture is

independent of how you save the VIs on
disk

 All LabVIEW projects have a high-level

architecture

 Typical high-level architectures of

LabVIEW projects include:

• Top-level VIs only
• Top-level VIs and dynamically-called VIs

 Note that this architecture is

independent of how you save the VIs on
disk

background image

ni.com

ni.com

Top-Level VIs Only

Top-Level VIs Only

 One or more top-level VIs
 All other VIs are subVIs of the top-level

VIs

 The simplest LabVIEW architecture

 One or more top-level VIs
 All other VIs are subVIs of the top-level

VIs

 The simplest LabVIEW architecture

background image

ni.com

ni.com

Top-Level VIs and Dynamic
VIs

Top-Level VIs and Dynamic
VIs

 Consists of one or more top-level VIs

with other VIs dynamically called via the
VI Server

 The dynamic VIs are not part of the

hierarchies of the top-level VIs

 Most advanced LabVIEW projects are a

variant of this architecture

 Consists of one or more top-level VIs

with other VIs dynamically called via the
VI Server

 The dynamic VIs are not part of the

hierarchies of the top-level VIs

 Most advanced LabVIEW projects are a

variant of this architecture

background image

ni.com

ni.com

Architectures and Build
Targets

Architectures and Build
Targets

 In an application, the top-level VIs run

when you launch the application

 In a shared library, the top-level VIs are

exported functions within the library

 In an application, the top-level VIs run

when you launch the application

 In a shared library, the top-level VIs are

exported functions within the library

background image

ni.com

ni.com

Building the Target

Building the Target

 Project architecture
 Prototypes for exported VIs (shared

library only)

 Desired packaging
 Other files needed

 Project architecture
 Prototypes for exported VIs (shared

library only)

 Desired packaging
 Other files needed

background image

ni.com

ni.com

Building an Application

Building an Application

 VIs that you build into the application

are classified as:

• Top-level VIs
• Dynamic VIs

 Your application must always have at

least one top-level VI

 VIs that you build into the application

are classified as:

• Top-level VIs
• Dynamic VIs

 Your application must always have at

least one top-level VI

background image

ni.com

ni.com

Building an Application
(cont.)

Building an Application
(cont.)

 Basic results of building an application

• Executable file
• ActiveX type library (if ActiveX server

enabled)

 Basic results of building an application

• Executable file
• ActiveX type library (if ActiveX server

enabled)

background image

ni.com

ni.com

Building a Shared Library

Building a Shared Library

 VIs that you build into a shared library

are classified as:

• Exported VIs
• Dynamic VIs

 Your shared library must always have at

least one exported VI

 VIs that you build into a shared library

are classified as:

• Exported VIs
• Dynamic VIs

 Your shared library must always have at

least one exported VI

background image

ni.com

ni.com

Building a Shared Library
(cont.)

Building a Shared Library
(cont.)

 For each exported VI, you specify the

following information

• Function name
• Calling convention
• Parameter list

 This information forms the prototype

used when calling the function from
another program

 For each exported VI, you specify the

following information

• Function name
• Calling convention
• Parameter list

 This information forms the prototype

used when calling the function from
another program

background image

ni.com

ni.com

Building a Shared Library
(cont.)

Building a Shared Library
(cont.)

 Basic results of building a shared library

• Shared library file
• Embedded type library on Windows

(sometimes)

• Header file
• Import library

 Basic results of building a shared library

• Shared library file
• Embedded type library on Windows

(sometimes)

• Header file
• Import library

background image

ni.com

ni.com

Desired Packaging

Desired Packaging

 LabVIEW can package the build target in

two forms

• Single file (executable or shared library)
• Single file and one VI library

 LabVIEW can package the build target in

two forms

• Single file (executable or shared library)
• Single file and one VI library

background image

ni.com

ni.com

Single File Package

Single File Package

 All VIs and their subVIs are embedded in

the resulting executable or shared
library file

 This can result in a rather large file

 All VIs and their subVIs are embedded in

the resulting executable or shared
library file

 This can result in a rather large file

background image

ni.com

ni.com

Executable and VI Library
Package

Executable and VI Library
Package

 Top-level (or exported) and dynamic VIs

are embedded in the resulting
executable or shared library file

 All subVIs are stored in a single VI

library

 Top-level (or exported) and dynamic VIs

are embedded in the resulting
executable or shared library file

 All subVIs are stored in a single VI

library

background image

ni.com

ni.com

Other Files Needed

Other Files Needed

 Your application or shared library can

require the presence of other non-VI
files, including –

• Preferences file (application only)
• Help files that your VIs call

 LabVIEW automatically includes run-

time menu (.mnu) files and DLL files
called via the Call Library Node

 Your application or shared library can

require the presence of other non-VI
files, including –

• Preferences file (application only)
• Help files that your VIs call

 LabVIEW automatically includes run-

time menu (.mnu) files and DLL files
called via the Call Library Node

background image

ni.com

ni.com

Application Preferences File

Application Preferences File

 Every application can have a

preferences file resembling the LabVIEW
preferences file

 If your application requires specific

LabVIEW preferences, you must
replicate these settings in the
preferences file for your application

 Every application can have a

preferences file resembling the LabVIEW
preferences file

 If your application requires specific

LabVIEW preferences, you must
replicate these settings in the
preferences file for your application

background image

ni.com

ni.com

VI Settings

VI Settings

 You can modify the settings for all VIs in

an application or shared library

 LabVIEW removes the diagrams from all

VIs and the panels from all non-user-
interface VIs by default

 You can modify the settings for all VIs in

an application or shared library

 LabVIEW removes the diagrams from all

VIs and the panels from all non-user-
interface VIs by default

background image

ni.com

ni.com

Other Options

Other Options

 Custom icon (Windows)

• Specify an icon (.ico) file to use for the

application icon or windows displayed by the
shared library

• Create this file in applications such as

LabWindows

/CVI and Microsoft Visual Studio

 ActiveX Server (Windows)

• Select whether to enable the ActiveX Server

capabilities for the application

• Specify the name of the server

 Custom icon (Windows)

• Specify an icon (.ico) file to use for the

application icon or windows displayed by the
shared library

• Create this file in applications such as

LabWindows

/CVI and Microsoft Visual Studio

 ActiveX Server (Windows)

• Select whether to enable the ActiveX Server

capabilities for the application

• Specify the name of the server

background image

ni.com

ni.com

Other Options (cont.)

Other Options (cont.)

 Default memory size (Macintosh)

• Specify the preferred memory size for the

application

 Default memory size (Macintosh)

• Specify the preferred memory size for the

application

background image

ni.com

ni.com

Creating the Installer
(Windows)

Creating the Installer
(Windows)

 You must include all files to be installed

in the source files list

 Any file in the distribution can receive

an associated program item

 By specifying custom destinations, you

can create directory structures during
installation

 You must include all files to be installed

in the source files list

 Any file in the distribution can receive

an associated program item

 By specifying custom destinations, you

can create directory structures during
installation

background image

ni.com

ni.com

Advanced Installer Settings

Advanced Installer Settings

 Run executable after installation

• This file must be one of the files installed in

the “Install Directory”

 Install LabVIEW Run Time Engine

 Enable this option to have installer also

install the LabVIEW Run Time Engine on the
target system

 Run executable after installation

• This file must be one of the files installed in

the “Install Directory”

 Install LabVIEW Run Time Engine

 Enable this option to have installer also

install the LabVIEW Run Time Engine on the
target system

background image

ni.com

ni.com

Installing Other Components

Installing Other Components

 Most applications require other software

• NI-DAQ
• NI-488.2
• NI-VISA
• ODBC drivers
• ActiveX controls

 You can launch installers for these with

a batch file

 Most applications require other software

• NI-DAQ
• NI-488.2
• NI-VISA
• ODBC drivers
• ActiveX controls

 You can launch installers for these with

a batch file

background image

ni.com

ni.com

Results of the Build Process

Results of the Build Process

 Directory that contains an image of your

complete file set

 Directory that contains disk images of

the installer

 Directory that contains an image of your

complete file set

 Directory that contains disk images of

the installer

background image

ni.com

ni.com

Demonstration

Demonstration

background image

ni.com

ni.com

Topics

Topics

 System requirements
 Project architecture
 Building the application or shared

library

 Creating the installer

 System requirements
 Project architecture
 Building the application or shared

library

 Creating the installer

background image

ni.com

ni.com

Question and Answer

Question and Answer


Document Outline


Wyszukiwarka

Podobne podstrony:
2008 5 SEP Practical Applications and New Perspectives in Veterinary Behavior

więcej podobnych podstron