viernes, 16 de mayo de 2014

(labVIEW) Database

I will explain how to make a database program with LABView to create and delete tables or write and read data and showing them in a multiplot waveform .

At first time, we have to create a database in Microsoft Access.















When we have a database created, the next step will be insert data and tables. In this case, I did 3 trables with the PRESSURE, TEMPERATURE and WIND SPEED, and I Inserted the data for 24 hours.














After doing this, we start with LABView.
The first step in LABView is create an .udl archive...
Click in Tools and Create Data Link...

















Now we have to click next, choose our database and click acept.


















The next step is to link the route of our udl with the program we're going to do to read and write to the database.

We now turn to the first part of the program, which will read the first three tables already created. This will index the data that come from tables and parse into an array that will read through a waveform chart with three graphs














And now we move to the second, and most important part of the program, where we will create and delete tables, write in the table, column and row you want.

To write to a table, it must be done through SQL code, and to write to the column and row you want, you must first create a reference column whenever we create a new table.

















To do this, when we activate the first case structure, we create a table, and using the for loop to created by constant first column with numbers from 0 to 99 as reference.

With this we create our first table with the column reference.

In the middle we have another case structure, which when activated it will delete the selected table.

In the largest case structure, is where we write in the table, column and row desired.

The complete SQL code would be: UPDATE TABLE SET COLUMN = "TEXT" WHERE ID = ROW, but we need table, column, and row are variable, so we do split and concatenate the end, getting the same result with our precious variables.

So here when we activate this case structure, write the text you want where you want.

Finally, these three case structures, serve to show or hide the graphical waveform chart you created at the beginning in Access.



VARIABLES:














And finally, we have the variables. Note the constant that is down to the left, it is the constant that makes creating table, the column reference is created. And others are simply initialized to 0, so that when you launch the program nothing written on them.


And now is the time to show the Front panel, where we execute the program.

















But this is not all the exercise. To finish, I’m going to show how to make an executable file (.exe) with LabView, which is what the customer really needs.

First, you have to include the VI file in a LabView Project and then you must click with the right button of the mouse on “Build Specifications”.
















When we have done this a window will be opened where u have to configure.


















And now we only have to open the .exe archive and work with our new database program.




No hay comentarios:

Publicar un comentario