martes, 14 de junio de 2011

LAVIEW II Read an Access database and generate a graph

Read an Access database and generate a graph of time using LabVIEW.

Read a table in an Access database and generate a graph. The table contains the temperature variations of a day. The table contains two data are given in time and temperature. Knowing the temperature and specific time generate a graph showing the data using the LabVIEW work environment 2010.




The first thing is to create an Access database. Within the database we created a table called data. Within the data we create two columns. One refers to the time and is given in a date format. The other refers to the temperature and is given in numerical form. The database must have extension. MDBs to work with it in LabVIEW.



The input data relating to temperature are fictional to make a graph with ups and downs. The graph contains a total of 17 variations of time intervals are recorded and 30 minutes from 1:00 to 9:00.
The operation code is as follows. Since just about reading Access data and then represented in the graph will need to run only once so there is no loop.
To open an Access file type extension. MDB must have a. UDL which contains the path of the database you want to support. Taking these parameters as the controls can open the database to start treating it.




the other side of the graph the is:



Once we have the use of the database open it and begin to treat it. The first function is to read the contents of a table in particular. Having created our database and data table. We know that the table is called "data" and put it as a fixed parameter as always read the same table.
After reading the table we get a variant type array. To view the table need not treat it with a simple viewer can see this content.




But in this case if we are interested in retrieving data from array and convert them to real numbers in order to display it on a graph. Out of the array will also need the dates and times.

To do the same select a column of the array. Knowing that the column 1 (starting from 0) contains numbers and column 2 contains the data. At that time only have to transform and save.

Download Exercise:
https://sites.google.com/site/franbc0100/termometroimportantisimo.rar?attredirects=0&d=1 

No hay comentarios:

Publicar un comentario