Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Database

Hi,
 
I am a new user in Labview and my applcation isn't very complicated I guess. I collect temperature data through the RS-232 to Laview, where I want to present the data in graphs and tables. After the aqusition, I want to save my data in a database, so I can look it up when ever I want. Is it a good solution to use VISA? Do I have to use SQL, or is there an easeier way to write to and use a database? (I will have the database on a server, connected to the PC by the network).
 
I appriciate all help I can get.
 
Thank you!
0 Kudos
Message 1 of 7
(4,348 Views)
You're going to have to use VISA for your serial application and I think SQL/ADO is the best way to interface to a database. SQL is a language that you ue to perform queries on a database and ADO is a technology from Microsoft that is use to make a connection. If you are using Microsoft Access, you have the option of using ActiveX but that is far slower, requires Access to be installed, might not be portable between different versions of Access, and you could not easily move to a real database such as SQL Server, Oracle, MySQK, etc.
0 Kudos
Message 2 of 7
(4,338 Views)
Hi, and thank you for your help. My task is to modify an old program (written in Labview 5.1), where a temperature sensor is measuring the temperature and the program in Labview is collecting it. Old measurements should be saved in the database. One sensor can have diffrent measurements, i.e. I can have data from sensor A collected yesterday and today and will maybe do one tomorrow. A sensor B might just have one measurement.
 
I have tried to find some information about SQL and writing to databases in general.... how does it work? I have lookied at this old program, but I can't find the path wich tells where the database is saved, do you know where that is done? And in this old program they use the VI "Connect.vi", is that an old version of VISA, i.e. the VI that establishes the connection through the serial port? Is it "The Labview Database Connectivity Toolset" that I should use? Maybe there are some example codes in the toolkit....
 
thank you for your help, please take a look at the old program and tell me is you see some major changes that can make it easier.
 
Regards
Frida
0 Kudos
Message 3 of 7
(4,325 Views)
VISA and serial ports have absolutely nothing to do with databases. The database VIs in your program are from an old toolkit called SQL Toolkit. This has been replaced with the Database Connectivity Toolkit though if you still have the old one, you can still use it. The difference is that the DCT uses ADO (look up on Microsoft web page) to connect to a database. They both use SQL to insert data and perform queries on a database. The DCT has some higher level functions that make this easier and hide the actual SQL language commands. With the SQL Toolkit, you had to be fairly proficient in the SQL language to get anything done. I have never used the DCT. I used to use the SQL Toolkit and I now use TestStand for my test manager and it has it's own database tools. When I write a standalone LabVIEW application that requires connection to a database, I use LabSQL from http://www.jeffreytravis.com/lost/labsql.html. It also requires knowledge of SQL but I'm comfortable with that and LabSQL is free.
 
The connect VI in your example, connects to a data source called "temperaturprov". This may or may not be the name of the actual database. In the Windows control panel, you should have the ODBC administrator. It is here that the data source name is created and pointed to an actual database. The actual database can be located locally or on a server. From your example, there is no way to know.
 
SQL stands for Structured Query Language. It's a standard for database access. You can have the same queries for different databases (i.e. Access, SQL Server). It has such commands as SELECT (to retrieve rows that meet conditions), INSERT (add rows to a table), UPDATE (modity existing records), etc. I don't have any links ahndy but if you were to Google "SQL tutorial", I'm sure you would find a lot of information.
0 Kudos
Message 4 of 7
(4,323 Views)
In the Windows control panel, you should have the ODBC administrator. It is here that the data source name is created and pointed to an actual database.
 
It is possible to connect to a database without going through this step.
 
On my LabVIEW project that connected to an Access database on a different PC on the network,
I used what is a called a ODBC DSN-less connection.
 

 

Message Edited by nyc on 02-15-2006 10:10 AM

0 Kudos
Message 5 of 7
(4,310 Views)
Dennis was referring to the VI posted by Frida.  The temperaturprov.vi appears to use a DSN named temperatureprov.  This can be found in the ODBC control panel applet that Dennis was describing. 


----
I am the founder of CnCSoftwareSolutions. When not cleaning up baby drool, I write about test data or work on Vision, a tool for understanding your test data. Visit me at www.cncsoftwaresolutions.com
0 Kudos
Message 6 of 7
(4,291 Views)

Yes, I understood that is what Dennis K was doing.

I was just offering an alternative for using ODBC in case Frida ends up having to re-write the

database connection VIs.

0 Kudos
Message 7 of 7
(4,284 Views)