LabWindows/CVI is a project-oriented development environment. You list the files that make up your project in the Project window, and LabWindows/CVI handles all of the compiling and linking for you. Project files can include ANSI C source, header files, user interface files, instrument drivers, DLLs, object files, or libraries.
This example displays the standard project components: a user interface file (.UIR), a C source file, and a header file. These files are currently empty. In this tutorial, you will build a simple program using these files. Most program development starts with a definition of the user interface.
Double-click on the SAMPLE.UIR file to open the LabWindows/CVI User Interface Editor.
!
BEGIN_TEXT
!
Introduction
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DEMOGUI1.AVI
0
2
2370
1800
5955
2790
2370
1800
5955
2790
BEGIN_TEXT
You are now looking at the User Interface Editor window. Here you will build a GUI for this example. You will define a new window and place controls and indicators for these windows, using the Create menu.
Your first step in building a user interface is to create a panel (or window) for your program.
Click on the Create menu and select Panel to create a window for your program.
!
BEGIN_TEXT
!
User Interface Editor Introduction
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DEMOGUI1.AVI
0
6
2610
1695
6240
1875
2610
1695
6240
1875
BEGIN_TEXT
After you create a panel, you can begin adding controls and indicators.
Click on the continue arrow for a tour of the controls and indicators available.
!
BEGIN_TEXT
!
User Interface Objects
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
-1
0
0
0
0
3
3
-1
3
0
0
DEMOGUI1.AVI
0
9
4470
2970
6495
2295
0
0
0
0
BEGIN_TEXT
The Numeric menu contains controls and indicators for specifying or displaying numeric data on your user interface. Notice that the controls and indicators in LabWindows/CVI are specifically designed for displaying technical data. You can choose from tanks, meters, gauges, thermometers, in addition to standard sliders, knobs, and numeric inputs.
Click on the arrow to continue the tour.
!
BEGIN_TEXT
!
Numeric Controls and Indicators
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
-1
0
0
0
0
3
3
-1
3
0
0
DEMOGUI1.AVI
0
10
4440
2955
6495
2070
0
0
0
0
BEGIN_TEXT
LabWindows/CVI has five different types of command buttons, or push buttons, that you can use on your GUI. One of the command buttons is a picture button (on the far right) which can display bitmap or icon images that can make your controls or toolbars more intuitive.
Click on the arrow to continue the tour.
!
BEGIN_TEXT
!
Command Buttons
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
-1
0
0
0
0
3
3
-1
3
0
0
DEMOGUI1.AVI
0
11
240
2865
6495
1980
0
0
0
0
BEGIN_TEXT
Toggle buttons have an on and off position, unlike command buttons which simply trigger an action. LabWindows/CVI has a variety of toggle controls, check boxes, and buttons that you can add to your GUI.
Click on the arrow to continue the tour.
!
BEGIN_TEXT
!
Toggle Buttons
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
-1
0
0
0
0
3
3
-1
3
0
0
DEMOGUI1.AVI
0
12
1245
4485
4470
1635
0
0
0
0
BEGIN_TEXT
You can add square or round LEDs as indicators on your GUI.
Click on the arrow to continue the tour.
!
BEGIN_TEXT
!
LED Displays
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
-1
0
0
0
0
3
3
-1
3
0
0
DEMOGUI1.AVI
0
13
1245
4485
4485
1770
0
0
0
0
BEGIN_TEXT
Binary switches provide another method for setting on/off states for your program from the GUI.
Click on the arrow to continue.
!
BEGIN_TEXT
!
Binary Switches
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
-1
0
0
0
0
3
3
-1
3
0
0
DEMOGUI1.AVI
0
14
225
3900
5655
3555
0
0
0
0
BEGIN_TEXT
Ring controls are similar to Numeric controls, except that you can specify your own values for the labels of ring controls. For example, instead of having a numeric slide control with the choices '1', '2', and '3', you can use a ring control and specify 'volts', 'amps', and 'ohms' as choices.
With the Picture Ring control (located in the lower right) you can specify a series of images (in .BMP, .OCX, and other formats) to be displayed. You can use a Picture Ring to display images representing on/off conditions, such as valves or switches, or you can index through a series of images for animation.
Click on the arrow to continue the tour.
!
BEGIN_TEXT
!
Ring Controls
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
-1
0
0
0
0
3
3
-1
3
0
0
DEMOGUI1.AVI
0
15
1605
3720
5595
1770
0
0
0
0
BEGIN_TEXT
LabWindows/CVI has a number of decorations to help you logically group and organize controls or indicators on your GUI.
Click on the arrow to continue the tour.
!
BEGIN_TEXT
!
Decorations
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
-1
0
0
0
0
3
3
-1
3
0
0
DEMOGUI1.AVI
0
16
225
4590
4815
2625
0
0
0
0
BEGIN_TEXT
You can add a Graph control to display waveform data on your GUI. The Strip Chart control displays real-time datapoints.
You have seen some of the controls and indicators that you can choose from in LabWindows/CVI. Now you can begin building a GUI.
Click on the arrow to begin learning to create a GUI.
!
BEGIN_TEXT
!
Graphs and Strip Charts
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
-1
0
0
0
0
3
3
-1
3
0
0
DEMOGUI1.AVI
0
18
255
4815
4740
2505
255
4815
4740
2505
BEGIN_TEXT
Now you will write a simple program that acquires and displays a waveform. You will start by building the GUI for the program. The first control to add to your GUI is a command button.
Select the Command Button entry and click on the first button type (in the upper left-hand corner) to add a Square Command Button to your GUI.
!
BEGIN_TEXT
!
Graphs and Strip Charts
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DEMOGUI1.AVI
0
22
345
4725
4560
1635
0
0
0
0
BEGIN_TEXT
Once you have added a control to the GUI, you can use the mouse to position it.
Click on the arrow to continue.
!
BEGIN_TEXT
!
Positioning Controls
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
-1
3
0
0
DEMOGUI1.AVI
0
25
300
4620
4725
2640
0
0
0
0
BEGIN_TEXT
You can customize the appearance and operation of any of the controls that you add to your GUI to fit your needs. You set attributes for each of the controls through a single, intuitive dialog box. You can double-click on any control to display the Edit dialog box for that control.
Double-click on the control labeled OK to edit its attributes.
!
BEGIN_TEXT
!
Editing the Command Button
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DEMOGUI1.AVI
0
27
915
4335
4860
3675
0
0
0
0
BEGIN_TEXT
In this dialog box, you can set every attribute of the command button to match the requirements of your application. For command buttons, you can specify shortcut keys, button appearance options, and label text options.
Perhaps the most important attributes of a control are its Source Code Connection attributes. In this example, the command button must trigger an acquisition. Therefore, we have named the button ACQUIRE. You use the Constant Name attribute to refer to the button in your source code.
Click on the arrow to continue.
!
BEGIN_TEXT
!
Control Edit Dialogs
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
ARR_L1B.BMP
ARR_L1_.BMP
37
241
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
-1
0
0
0
0
3
3
-1
3
0
0
DEMOGUI1.AVI
0
28
975
5100
4095
3240
0
0
0
0
BEGIN_TEXT
The Callback Function specified here is automatically invoked when a user clicks on the ACQUIRE button during program execution.
For this example, we have specified a callback function named AcquireData. Later in the tutorial, you will write the AcquireData function to acquire a waveform and plot it on a Graph control.
Click on the arrow to continue.
!
BEGIN_TEXT
!
Callback Function Name
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
ARR_L1B.BMP
ARR_L1_.BMP
63
272
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
-1
0
0
0
0
3
3
-1
3
0
0
DEMOGUI1.AVI
0
29
1950
1680
3810
2745
0
0
0
0
BEGIN_TEXT
Because this button must trigger an acquisition, we have changed the label on the command button to 'Acquire Data.' Notice that the changes we make to the button are automatically reflected in the Quick Edit Window, so you can decide if you like the changes.
Click on the arrow to continue.
!
BEGIN_TEXT
!
Button Label
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
ARR_R1B.BMP
ARR_R1_.BMP
256
392
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
-1
0
0
0
0
3
3
-1
3
0
0
DEMOGUI1.AVI
0
30
3975
2040
3945
1935
0
0
0
0
BEGIN_TEXT
All of the important attributes for the command button are set.
Click on the OK button to accept the changes and return to the GUI panel you are building.
!
BEGIN_TEXT
!
Accept the Changes
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DEMOGUI1.AVI
0
32
1860
4620
3855
2220
0
0
0
0
BEGIN_TEXT
Now we will add a Quit button to the GUI for you. When a user clicks on the Quit button during program execution, the program ends.
Click on the arrow and a new Command Button is added to your GUI.
!
BEGIN_TEXT
!
Adding a Quit Button
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
-1
3
0
0
DEMOGUI1.AVI
0
37
3105
4245
4440
1440
0
0
0
0
BEGIN_TEXT
Double-click on the button labeled OK to set its control attributes.
!
BEGIN_TEXT
!
Edit the New Command Button
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DEMOGUI1.AVI
0
39
2775
2055
4710
2190
0
0
0
0
BEGIN_TEXT
We have customized the new Command Button to make it a Quit button for you. When clicked on, the Quit button invokes a function named QuitProgram. The QuitProgram function ends program execution.
Click on the OK button to accept these attributes.
!
BEGIN_TEXT
!
Quit Button Attributes
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DEMOGUI1.AVI
0
41
2760
1215
4965
1665
0
0
0
0
BEGIN_TEXT
Now you must add a Graph control to your GUI.
Pull down on the Create menu to display the list of available GUI controls.
!
BEGIN_TEXT
!
Adding a Graph Control
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DEMOGUI1.AVI
0
43
4815
3165
5340
1185
0
0
0
0
BEGIN_TEXT
Select the Graph submenu and choose a Graph control.
!
BEGIN_TEXT
!
Adding a Graph Control
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DEMOGUI1.AVI
0
46
450
2835
5745
1770
0
0
0
0
BEGIN_TEXT
You can customize the Graph control the same way that you customize the Command Buttons, by double-clicking on the Graph to display its Edit dialog box.
Double-click on the Graph control now, to display its Edit dialog box.
!
BEGIN_TEXT
!
Customize the Graph Control
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DEMOGUI1.AVI
0
48
345
2655
6090
3390
0
0
0
0
BEGIN_TEXT
The Graph control has many attributes that you can customize. These simple, interactive dialog boxes replace hundreds of lines of graphics library calls in traditional C or BASIC programming environments. You set up your graph control through these dialog boxes, without doing any additional coding. Keep in mind that you can change each attribute you set in this dialog box with a function call during program execution -- you maintain the flexibility of programmatic control over your GUI.
Take a closer look at some of the attributes that you can set for the Graph control.
Click on the Y-Axis... button.
!
BEGIN_TEXT
!
Graph Control Attributes
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DEMOGUI1.AVI
0
50
3735
4275
5010
2010
0
0
0
0
BEGIN_TEXT
You can set all of the axis properties from this dialog box. Some of the properties that you can select include auto scaling, log scales, engineering units, and axis label precision.
Click on the OK button to return to the main Graph dialog box.
!
BEGIN_TEXT
!
Y-Axis Options
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DEMOGUI1.AVI
0
52
4950
4335
4140
1335
0
0
0
0
BEGIN_TEXT
Click on the OK button to return to the GUI you are building.
!
BEGIN_TEXT
!
Accept the New Settings
0
0
0
0
255
255
255
255
0
0
0
0
0
0
255
255
255
0
5
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
8
~~
~~
0
0
0
0
0
3
3
0
3
0
-1
DEMOGUI1.AVI
0
54
2760
4320
5055
2565
0
0
0
0
BEGIN_TEXT
You have completed the first step in writing a LabWindows/CVI application -- the GUI is complete. Before you start writing ANSI C source code, save the GUI file.
LabWindows/CVI GUIs are saved as binary files called User Interface Resource (.UIR) files.
Click on Save from the File menu to save your new GUI.