Labview DATABASE INTERFACING for ROBOTIC CONTROL

Labview DATABASE INTERFACING for ROBOTIC CONTROL

LabVIEW™ DATABASE INTERFACING FOR ROBOTIC CONTROL

Netsanet Gebregziabher

Submitted to the faculty of the School of Informatics

in partial fulfillment of the requirements

for the degree

Master of Science

in Chemical Informatics (Laboratory Informatics Specialization)

Indiana University

May 2006

1

Accepted by the Faculty of Indiana University, in partial fulfillment of the requirements for the degree of Master of Science in Chemical Informatics

(Laboratory Informatics Specialization)

______

Douglas G. Perry, Ph.D., Chair

______

Mahesh Merchant, Ph.D.

______

Narayanan Perumal, Ph.D.

1

Dedication

I would like to dedicate this work to Jesus Christ and my family. It is through God that I have learned to stand still and learn from this world. It is through my family that I have learned to appreciate God, education, and life.

1

Acknowledgements

I would like to thank everyone who has been a help at Indiana University-Purdue University Indianapolis (IUPUI) throughout my two years at the School of Informatics.

Dr. Douglas Perry, you have been an example of patience, encouragement, and kindness. From the moment I met you till now, you have not changed in your willingness to see a student succeed. You are the type of teacher and advisor many, including myself, are grateful to know in life.

Dr. Mahesh Merchant, your ability to give straight forward advice while reflecting a quiet and open attitude about learning is an attitude asset I will carry with me always. I appreciate all the new software and industry expectations you taught in class that I know I will use in the workforce.

Dr. Narayanan Perumal, your friendly manner and direct approach to teaching databases helped me to value this new technology. I have always appreciated your willingness to be open to any new thoughts a student brings to the table.

Silpa Wairatpanij, I am really grateful to have encountered someone such as yourself in life. You have such openness to learning new thing while never belittling others. Your insight and dedication to your work has been an example. I am glad I know you.

Elisabeth Hinshaw-Osgood, Mary O’Neill, Dale Ray, Roberta D. Sarcyk, and many other staff members in the School of Informatics, I want to send a heart felt thank you. I am indebted to all the information you have provided throughout my educational journey at IUPUI.

Thank you.
ABSTRACT

Netsanet Gebregziabher

LabVIEW™ Database Interfacing for Robotic Control

The Zymark™ System is a lab automation workstation that uses the Caliper Life Sciences (Hopkinton, MA) Zymate XP robot. At Indiana University-Purdue University Indianapolis, a Zymate is used in a course, INFO I510 Data Acquisition and Laboratory Automation, to demonstrate the fundamentals of laboratory robotics. This robot has been re-engineered to function with National Instruments™ graphical software program LabVIEW™. LabVIEW is an excellent tool for robotic control. Based on changing conditions, it is able to dynamically use data from any source to modify the operating parameters of a robot. For dynamically changing information, storage of that information must be readily accessible. For example, there is a need to continuously store and update the calibration data of the robot, populate the setting of each axis and positioning inside the workplace, and also store robot positioning information. This can be achieved by using a database which allows for robotic control data to be easily searched and accessed. To address this need, an interface was developed which would allow full, dynamic communication between any LabVIEW program (called “virtual instruments,” or VIs) and the database. This has been accomplished by developing a set of subVIs that can be dropped into the calling robotic control VIs. With these subVIs, a user has the ability to create table and column information, delete a table, retrieve table information by clicking a particular table name on the user interface, or query using any SQL-specific combination of columns or tables within the database. For robot functionality, subVIs were created to store and retrieve data such as calibration data points and regression calculations.

1

Table of Contents

Tables

Chapter 1: Introduction

Chapter 2: Background

The fundamentals of LabVIEW, Database Connectivity Toolset™, the database

What is LabVIEW?

Operating LabVIEW

Database Connectivity Toolset™

Chapter 3: Methods

LabVIEW Communicating

Database Connection through Universal Data Link (UDL)

The Code of the subVI

Flowchart

Launching LabVIEW

Creating a UDL link

Creating Table and Column Information in Database

Retrieving TableInformation

Using subVIs to communicate with the database in one top-level VI

Chapter 4: Results

Inserting Data from Notepad into LabVIEW

3DArray.vi

Retrieving Slope/Intercept of robot positions in LabVIEW from text file in Notepad

Validation

Inserting Calibration Information from LabVIEW

Chapter 5: Discussion

Chapter 6: Conclusion

Limitations and Future Endeavors

References

Appendix

1

Table

Table 1 Definition of different ADO Object components

Figures

Figure 1: Text-based programming compared with LabVIEW’s source code.

Figure 2: Front panel and block diagram of VI.

Figure 3: The 'Control' palette of the front panel.

Figure 4: 'Function' palette in block diagram.

Figure 5: Icon/connector example for a DB Tools Open Connection.vi

Figure 6: ODBC OLE DB Provider’s communication pathway between ADO and a database.

Figure 7: ADO and Access Database communicate using OLE DB Provider.

Figure 8: Hierarchy of the ADO object.

Figure 9: Creating a UDL on the Windows interface.

Figure 10: A connection to a database using UDL file path.

Figure 11: OLE DB Provider for UDL.

Figure 12: Connection to UDL

Figure 13: A simple create connection VI that opens a file through a UDL Link.

Figure 14: Flowchart for Retrieve.vi

Figure 15: Flowchart for List Create Delete.vi.

Figure 16: LabVIEW icon for application link.

Figure 17: LabVIEW startup screen. Right click on new to open new blank VI.

Figure 18: UDL Link between LabVIEW and a database.

Figure 19 : Source code of UDL.vi connection information between LabVIEW and database.

Figure 20: Empty table name in database (Create Table & Column.vi)

Figure 21: Need unique table name in database (Create Table & Column.vi)

Figure 22: Column information in table put in database (Create Table & Column.vi).

Figure 23: Create table & column information in database (Create Table & Column.vi).

Figure 24: Create table and column information in database (List Create Delete.vi)

Figure 25: Listbox of table names and column (List Create Delete.vi)

Figure 26: Delete table from database (List Create Delete.vi).

Figure 27:Listbox for retrieving table (Retrieve.vi).

Figure 28: Execute Query (Retrieve.vi)

Figure 29: Communicating with Database.vi

Figure 30: UDL.vi (Communicating with Database.vi)

Figure 31: Disabled List Create Delete.vi & Retrieve.vi (Communicating with Database.vi)

Figure 32: List Create Delete.vi (Communicating with Database.vi)

Figure 33: Retrieve.vi (Communicating with Database.vi)

Figure 34: Communicating with Database.vi front panel and block diagram.

Figure 35: List Create Delete.vi front panel and block diagram.

Figure 36: Create Table & Column.vi.

Figure 37: Retrieve.vi's front panel and block diagram

Figure 38: Data points in Notepad to be used for robot calibration.

Figure 39: 3DArray.vi imports robot calibration data points from Notepad.

Figure 40: SubVI Slopeintercept3DData.vi inputs slope and intercept for robot calibration.

Figure 41: Independent verification in Microsoft Excel to validate the slope and intercept in LabVIEW’s subVI Slopeintercept3DData.vi.

Figure 42: Calibration Information in Database.vi.

Figure 43: Information in Calibration Information in Database.vi.

Figure 44: Calibration Information in Database.vi and the database.

Figure 45: Slope and intercept information created in database using Calibration Information in Database.vi.

1

Chapter 1: Introduction

Knowledge is continuously changing and growing exponentially in the technology rich twenty-first century. Tedious and labor-intensive assignments for the average person and business have been markedly reduced by using robots and computers to do the same work. Companies great and small have started using computer-controlled robots to do dangerous and repetitious projects for humans.

Robots are most useful in executing the same defined job repeatedly and in precisely the same fashion. When working on tasks that are continuously duplicated, these automated machines are able to overcome certain types of errors better than humans. Utilizing robots improves efficiency while lessening the likelihood for inaccuracies in a procedure.5 In industry, specifically the pharmaceutical industry, the higher throughput, greater reliability, and frequently far more cost-effectiveness attract companies to use these machines on the job. Companies such as Eli Lilly (Indianapolis, IN), a pharmaceutical corporation, utilize robots to do tedious and labor-intensive assays using machines like the Beckman Coulter’s Biomek 2000™. Beckman Biomek is a robot that can manipulate almost any type of liquid handling procedure. These procedures are done quickly and more competently when compared to a human who is given the same task. Some examples of liquid handling procedures are pipetting, diluting, and dispensing. Biomek 2000 can pipette, move plates around, and do various types of scientific assays that may take it a few hours, whereas a person doing the same task may take days if not a month to accomplish. This automated robot allows the researcher to have a less hands-on intervention concerning a particular repetitive and monotonous test, and focus more on the implications of the results of an experiment. This moves the focal point from just performing a tedious experiment and instead allows for researchers to focus more on understanding the overall picture of the data. This is one big reason that laboratory automation is very attractive to pharmaceutical corporations.

Another corporation, the Hershey Company (Hershey, Pennsylvania) utilized a specific robot to prepare chocolate formulation. The robot used was a Caliper Life Sciences (Hopkinton, MA) Zymate XP™. Hershey decided to contribute to the research potential of laboratory robots by donating one of its Zymark robots to the School of Informatics for the Laboratory Informatics Graduate Program at Indiana University-Purdue University Indianapolis (IUPUI). This robot is used in a course, INFO I510 Data Acquisition and Laboratory Automation. It is a good tool to demonstrate the fundamentals of laboratory robotics. This robot has been re-engineered to function with National Instruments™ (Austin, Texas) graphical software program, LabVIEW™ (Laboratory Virtual Instrument Engineering Workbench).

LabVIEW is an excellent tool for robotic control. This software is able to use data from various sources to modify the automation’s operating parameters. The robot user needs to quickly access and store any and all of this dynamically changing information. For example, there is a need to continuously store and update the calibration data of the robot, populate the setting of each axis and positioning inside the workplace, and also store robot positioning information. The solution to this problem was to create a database that will allow for robotic control data to be easily searched and accessed. LabVIEW’s front panel became the interface that allowed complete dynamic communication between its various Virtual Instruments (VIs, LabVIEW’s program) and the database that was formed. This was carried out by developing a set of subVIs (which will be explained later) that were dropped into the calling robotic control VIs. With these subVIs, the user has the facilities needed to create table and column information, delete a table, retrieve table information by clicking a particular table name on the user interface or query using Structured Query Language (SQL) any specific combination of columns or tables within the database. For robot functionality, a subVI was created for insertion of data into a database. Calibration information for the robot, including line values like slope and intercept, are now saved in a database.

Chapter 2: Background

The fundamentals of LabVIEW, Database Connectivity Toolset™, the database

This chapter focuses on defining key concepts such as what LabVIEW™ is and the fundamental concepts of database interactions by the LabVIEW Database Connectivity Toolset™ (DCT).

What is LabVIEW?

LabVIEW is an acronym for Laboratory Virtual Instrument Engineering Workbench. It is a computer software development application created by National Instruments™ (Austin, Texas) that aims to aid scientists and researchers in gathering and understanding data using computer programs. LabVIEW is a G graphical programming software that utilizes graphical objects to symbolize lines of code instead of the average programmers’ text-based languages. In the source code of this graphical program, data execution depends on the flow of data. What may take days in C++ or Java written code is cut down to hours in G programming. Add to this, LabVIEW has built a general purpose library of functions and subroutines for most programming tasks. The time saved allows the user to fully focus and understand how data is flowing. Even though some type of programming experience is useful, a novice in text-based programming language(s) can grasp the mechanics of LabVIEW because it is a graphical programming language utilizing iconic symbols to illustrate program action.

1

Figure 1 is an example of the similarity and difference between written code and LabVIEW source code.

Figure 1: Text-based programming compared with LabVIEW’s source code. [*]

1

Operating LabVIEW

The building blocks of the LabVIEW program are called Virtual Instruments. The name comes from the fact that the program emulates the appearance and tasks of physical instruments while still operating in the same capability as a text-based program. There are three key components to any VI: the front panel, the block diagram, and the icon and connector pane. The below figure shows the front panel and block diagram of a typical VI.

Figure 2: Front panel and block diagram of VI.

Front Panel

The front panel is the VI’s interactive interface built with controls (inputs) and indicators (outputs) that replicate conventional instruments, like thermostats or knobs, as may be found in the real world.

1

The controls that are built on the front panel are wide-ranging as seen in the ‘Control’ tool palette in Figure 3.

Figure 3: The 'Control' palette of the front panel.

Using the mouse and keyboard, the LabVIEW programmer grabs and drops the input data onto the interface panel.

1

Block diagram

The block diagram is the source code location for executing programs in LabVIEW and is equivalent to text-based programming such as C++. The block diagram has three central parts to its source code: nodes, wires, and terminals. This is the site where the wiring of graphical objects or terminals is connected to the functional nodes. Terminals are the controls (inputs) and indicators (outputs) of the block diagram. When compared with written source code, nodes are equal to statements, functions, and subroutines. An example of a node may be an addition function or a while loop. The addition function is considered a lower-level VI. It is part of the general purpose LabVIEW library of functions and subroutines for programming tasks. Execution of the program, with all three—nodes, terminals, and wires—can occur when wiring between the terminals and nodes has been connected to designate the flow of data. The terminals in the front panel have parallel terminals on the block diagram; thereby data continuously flows from the interface in the front panel to the source code in the block diagram and back to the interface. Figure 4 illustrates the ‘Function’ palette in the block diagram. Some subpalettes like ‘Database’ are subVIs which are used to perform subroutines like opening, closing, or inserting a database.

Figure 4: 'Function' palette in block diagram.

Icon/Connector

An icon symbolizes a VI in another block diagram. When an icon is placed in a foreign block diagram, it is there to act as a subroutine. A VI within another VI is called a subVI and is considered a lower-level call. A subVI connects with a top-level VI by means of a connector that passes data to outputs/indicators in the block diagram and receives data from inputs/controls in the front panel of the lower call terminal. The icon is the graphical representation of the subVI and may be likened to constraints of a subroutine in written code. To function as a subtask in a top-level call, there must be an icon and a connector as seen in Figure 5.

Figure 5: Icon/connector example for a DB Tools Open Connection.vi

1

The LabVIEW graphical program is both hierarchical and modular. Top-level and low-level calls, such as routines within a subroutine, are examples of this program’s hierarchical nature. Each subroutine, or subVI, can execute independently of the top-level VI. A subVI can be built upon other subVIs. For example, a programmer creates a VI, titled “List.vi,” which lists all tables currently existing in a database. If a user wants to create a new table, then a VI, titled “Create.vi” for creating new table name(s) and column information(s) is built. To view if this new table has been created in the database, “Create.vi” is inserted into the block diagram, or program source code of “List.vi.” The “Create.vi” has now become a subVI of “List.vi.”

1

Database Connectivity Toolset™

For the purpose of this project, the application program utilized with the LabVIEW Database Connectivity Toolset™ (DCT) is Microsoft Access Relational Database Management System for Windows. One can incorporate Structured Query Language (SQL) in addiction to the DCT’s Virtual Instruments found in the ‘Function’ palette.

Database Basics

The basic concept of the database is the organization of acquired data. The Jet database engine of MS Access is its Database Management System (DBMS). MS Access stores acquired data in tables. The tables are made up of record sets which consist of rows and fields (also known as columns). Each table must be uniquely named. A row may have empty cells or SQL NULL values.