Building An Application and An Installer in Labview: NOTE: The Professional Labview Development License Program Is
Building An Application and An Installer in Labview: NOTE: The Professional Labview Development License Program Is
Building An Application and An Installer in Labview: NOTE: The Professional Labview Development License Program Is
12/09/21 Danny Vu 2
BUILDING AN APPLICATION and AN INSTALLER in LabVIEW
14
14. Your final directory should be as shown so far
15. Move the whole high level directory that contains
all files in step 14 and transfer to the client PC that do not
have LabVIEW Development Program Installed.
16. Open the Installer folder and double click on setup.exe to install
your Main_Test_Program to the client PC.
17.Test Your Main_test_Program.
main.lvproj
Build Folder
Installer Folder
12/09/21 Danny Vu 3
1 Example of Test Application
1
Note: If SAI User Interface V1.0 needs to be
upgraded. Consider to do as follows:
1. copy the same file and change the original file
name as SAI User Interface V1.0_XX
2. Open the copied version and go to file>>save
so that the new version also link to subvis of the
original file.
12/09/21 Danny Vu 4
Calling Codes From Other Languages
• Calling dynamic linked libraries, or DLLs (apply only to Windows; for Mac OS and Linux,
you can call Frameworks.
1 System Exec.vi
<<Example>>
12/09/21 Danny Vu 5
Using Call Library Function Node-DLL
• DLLs are small, compiled libraries in a .dll file that encapsulate some functionality and
export a set of functions that other applications like LabVIEW can call.
• What you need is a set of document describe what the functions are and how the data
should be passed to and from them.
• The table below are usually helpful to understand the data types return of a function from
one platform to the other.
12/09/21 Danny Vu 6
Building .dll file in LabWindows-CVI
Objective: Write a C code program in WindowCVI and build a *.dll file. Using LabVIEW to
call this .dll
Implementation:
2
1.Open NI LabWindow CVI program and create a folder on desktop name test
2.Create a New >> Project. Go to File>>Save Untitled project as Temperature.prj
3.Select File >> New >> Source(*.C) to create an untitled1.C program and save the untitled1 as
Temperature.c 3
4.Enter the C code program as shown below
12/09/21 Danny Vu 7
Using Call Library Function Node-DLL
5. Now we need to add the Temperature.c file into the Tempearture.prj file so that we can
compile the code to ensure the program works. Right click Temperature.prj and select Add
Exsiting File…
6. Add File Project window display, select Temperature.c
and press ADD button and then hit OK.
7. Build >> Compile File to compile your code. 6
8. Build >> Create Debuggable Executable.
7
8
9. Put a break in your code to watch the I/O display and exit CVIWindows (Run>>toggle breakpoint)
9
10
Building a Temperature.DLL
10. File >> New >> Project From Template…select Dynamic Link and
enter TempDLL in project name box. Press OK.
11. This will create 4 files TempDLL in your root directory.
12. Open TempDLL.c and replace the code
12
12/09/21 Danny Vu 8
Using Call Library Function Node-DLL
13
Implementation:
1.Open labVIEW
2.Function>>Connectivity>>Call Library Function Node
3.Right Click >>Configure
4.Set Function as shown below and hit OK
Objectives: Calling lvanlys.dll into LabView using Library Function Node. The
Lvanlys.dll takes an array of numerics referenced by point xH and calculates the mean,
placing its value in the memory location referenced by the pointer mean. If there is an
error, its numeric code is referenced by the pointer dsperr.
Note: you have to provide dummy inputs to the arguments, even if they represent outputs, so
that LabVIEW knows what kind of data type you are using (due to the fact that these
parameter types were configured as “Adapt to Type”.
Ex: ANSI
First C
#include <stdio.h> /*include information about standard ANSI library Program
Preprocessor: this component reads lines in your source codes. #include is use to read whole source file,
12/09/21 Danny Vu 13
ANSI C – The For Statement
1 1
LOWER, UPPER, and STEP are symbolic constants,
Not variables, so they do not appear in declarations.
Symbolic constant names written in upper case so
they can be readily distinguished from lower case
variable names.
12/09/21 Danny Vu 14
HOW TO READ CONTENTS FROM A TEXT FILE 1
Objectives: to read contents from text file, FastLoad-5.txt without popping up the
control path.
Objective: Connect all wires to the create virtual channels.vi using short cut.
Implementation:
Danny Vu 16
Type Def Control
Type Def.ctl is used to update all the VIs that are used this type def.
Strict Type Def.ctl update all the VIs and its physical appearances.
In a new blank VI, create a Enum Control and Add elements into the
1
Enum
12/09/21 Danny Vu 17
Advanced Type Def Control
In Customize mode, you can use to resize, color, and replace the
various picture components of the control.
12/09/21 Danny Vu 19
Using Property Node
This example changes the value of the numeric control. Key Focus use to set the active cursor inside
the field.
1 2 3
12/09/21 Danny Vu 20
Using The Event Structures
The event structures allows you to write highly efficient code
that
waits for events to happen, rather than inefficient code that
periodically checks whether events have happened.
Placing a single event structure inside a while loop is the most
12/09/21 Danny Vu 22
Using Sending and Waiting on Notification
Just like queue, a notifier has an element data type that you can
define, but it can have only one element.
Unlike queue which has an array of elements.
Notifiers are very useful in situations where you only need to have
the latest message, and not all the messages.
12/09/21 Danny Vu 23
Using Tab Control User Interface
12/09/21 Danny Vu 24
Using Tab Control User Interface-Multiplot
Use bundle
12/09/21 Danny Vu 25
Using QUEUE
12/09/21 Danny Vu 26
Appended Path and Open Front Panel Window
12/09/21 Danny Vu 27