Creating a GUI

INSTRUCTIONS FOR BUILDING GUIs ON EQUIPMENT CONTROL SYSTEM. Back to TOP

Project Setup (Approach 1)

1. Copy the "GUI_Template_Project" folder from the "Documents\000 Labview Local\Developers Version\Interface" folder and paste in the same folder.

2.Rename the copied folder to GUI_yourguiname

3. Navigate inside the renamed folder and Open the "GUI_Template_Project.lvproj" file

4. When the project window opens, click on "File->Save As->Rename" and press "continue"

5. Rename the project to GUI_yourguiname.lvproj and click "OK"

6. Now, in the project window, under My Computer, right click on GUI_Template_VI.vi and click on "Rename"

7. Rename the VI to GUI_yourguiname.vi and click "OK"

Project Setup (Approach 2)

1. Navigate to 000 LabvIew local\Developers Version\Interface\GUI_GeneralTemplate folder

2. Launch the GUI_GeneralTemplate.lvproj file by double clicking.

3. When the project opens completely, expand the File menu and click on Save As...

4. Use the defaults in the next step and click continue

5. In the file dialog window, navigate to the 000 LabvIew local\Developers Version\Interface\folder and click on create New Folder. Name the folder as GUI_(your device). For example, if you are making a gui for a camera, name the folder as GUI_camera.

6. Navigate into the New folder using the dialog window before saving the project.

7. Use the same name as the folder for the project to be saved and hit Save button. Note: At this point your new saved project should be located in the new folder that was create in Step 5

8. Return to the GUI_GeneralTemplate.lvproj project window and open the GUI_GeneralTemplate.vi

9. When the VI opens completely, expand the File menu and click on Save As...

10. Click on Open additional copy and UNCHECK the "Add copyto GUI_GeneralTemplate.lvproject checkbox. Hit Continue

11. Using the file dialog window that opens, navigate to the 000 LabvIew local\Developers Version\Interface\GUI_(your device) folder

12. Name your VI as GUI_(your device).vi and HIT save. Note: Now the new VI should be in the new folder created in step 5

13. Close GUI_GeneralTemplate.lvproj window

14. Using Windows Explorer Navigate to the 000 LabvIew local\Developers Version\Interface\GUI_(your device) folder and launch the labview project.

15. After the project window launches completely, Right-Click on My Computer and click on Add -> File...

16. Using the File Dialog window, navigate to the 000 LabvIew local\Developers Version\Interface\GUI_(your device) folder and choose your newly saved GUI_(your device).vi

17. Hit "Add File"

18. Now open the GUI_(your device).vi.

CONGRATUALTIONS!!!! YOU ARE NOW SET UP TO EDIT YOUR FIRST GUI FOR THE EQUIPMENT CONTROL SYSTEM.

GUI Programming

The GUI_General Template.VI is a advanced VI that allows rapid development of GUIs for the ECS

FIRST VIEW:

1. The Front Panel of the Template has a String Control labelled as GUIdevice 1. The caption of this string control can be user defined.

2. The Block Diagram is essentially divided into two parts:

a. A preprogrammed section with blocks that are under password protection (Not to be used by general users)

b. The string control labelled as GUIdevice 1

WHAT DOES IT MEAN?

1. The string control called GUIdevice 1 is used to specify the Device with which the user wishes to send/receive data. i.e communicate

USE CASE 1:

The user wants to send/receive a numeric variable in the device, e.g. The Gain for a Camera called CamA (HOW TO SEND/RECEIVE DATA FROM DEVICE SPECIFIED IN THE GUIdevice 1 control)

1. Type "CamA" in the string control GUIdevice 1. Right click on the control and click on Data Operations -> Make Current Value Default

2. Drop a numeric control on the front panel

3. Label the control using the following format: (variable name::1) i.e. gain::1.

This means that the numeric control will be used to update the Gain Variable on the device specified in the string control GUIdevice 1 i.e. CamA

4. On the front panel, Right Click on the Control and click on Visible Items -> Label to Uncheck/Unselect. This will hide the Label of the numeric control.

5. Again, Right Click on the Control and click on Visible Items -> Caption to Check/Select. This will Display the Caption of the numeric control.

6. The caption can be user defined, i.e. Any useful name can be used.

USE CASE 2:

User wants to control other varaiables for the specified device.

1. The user should know the data type of the variable they want to control. i.e numeric, string enum etc

2. Drop the appropriate control with the matching data type on the front panel. If the control is an enum, create an enum that exactly matches the enum variable of the device.

3. Repeat step 3-6 from USE CASE .

USE CASE 3:

User wants to control variables from second device on same GUI

1. Copy and Paste the GUIdevice 1 string control on the front panel. Label it as GUIdevice 2.

2. If additional devices are required, repeat Step 1 and increment the GUIdevice count, i.e. GUIdevbice 3, GUIdevice 4 and so on

3. Type the names of the device required in the new device string control. (Refer to STEP 1 on USE CASE 1)

4. Add controls to the Front Panel that match the data type of the required variables from the second device.

5. Label the control using the following format: (variable name::2) e.g. gain::2

NOTE: Notice that the label of the new control now references the second device using the "::2".

6. Similarly, for a control that communicates with a variable from a third device specified in GUIdevice 3, the label should be "variablename::3" (without the double quotes)

7. Thus, a user can communicate with any number of devices and their corresponding variables from the same GUI.

USE CASE 4:

User wants to add additional code such as analysis or interlocking to develop a more advanced GUI

(Advanced LabVIEW Users)

1. The user can use the "Register for Dynamic Events" block with an event structure inside a while loop for making more advanced GUIs.

2. The Dynamic Events will register User Events that are triggered each time there is new data from the devices.

3. The User Events pass through the name of the device that received new data and triggered the event. This provides the user with a more detailed control over user events.

4. User can use control references, property nodes, local variables to further use data from device variables to improve GUI usability

BUILD GUI

1. Double click on the GUI_GeneralTemplate_Build under the Build Specifications section in your project window. This opens the Build properties window.

2. In the Information section, Change the Build Specification Name to GUI_(your device)

3. Change the Target Filename to GUI_(your device).exe

4. Set the Destination directory to 000 LabvIew local\Developers Version\Interface\builds\GUIs\GUI_(your device)

5. In the Source Files section, select all VIs (if any) in the Startup VIs section and click on the "left arrow" to clear the table.

6. Select the GUI_(your device).vi from the Project Files table and hit the "right key" next to the "Startup VIs" table.

7. In the Additional Exculsions section, uncheck the "Disconnect type definitions" and check all the remaining boxes.

8. In the Advanced Section, check the "Pass all command line arguments to application" check box. Leave all other as defaults.

9. Hit Build.