LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

starting out with database toolkit

I have been a student of LabVIEW for over 6 years, learning mostly on my own since training is at a premium for most employers (at least all that i have worked for).

 

My current employer has numerous test sets that write data to several csv files on our server. One of the first problems was when two test sets attempt to write to the file at the same time one of them gets an error. I have implemented a workaround by reading the error and putting that test set in a loop that waits for the file to be ready again then writes or reads as is necessary. This is a clunky solution for a problem that will just continue to grow as more and more test sets are added.

 

I have suggested a database instead of csv files and my employer bought me the LabVIEW database connectivity toolkit. By attempting to learn with trial and error I wrote small vis to write some data then read it back.  I AM LOST!  😞

 

Does anyone have a suggestion where to start to learn the basics on this stuff (without being sent for training), ie a database for dummies type of thing 😉

I have time and a small budget for books etc.

 

thanks for reading,

Dave

0 Kudos
Message 1 of 11
(3,676 Views)

did you go through the example finder.

Although a DB sounds intimidating, it is programatically (programming interface)  not to much different from any other io

 

1.  Open resource

2.  Use Resource

3.  Close resource

 

1.  open consists of opening a session to a database (this can be tricky) usually through a udl file or odbc data source.  Unlike file io, you ususally setup this connection string prior to your application.  UDLs are easy to use and test connections so make sure it works before writing your application.

 

2.  Using your db consists of adding or reading records,  this is usually done with a sql querry there are many resources for this,  a write is adding a record (ie one line of data in a csv) and read is retriving a record.  sql does have a learning curve

 

3.  when done close the connection just as you would close the file in the csv

 

There are great advantages to using the DB over the csv, mostly when searching or accessing the data concurrently from multiple applications, if these advantages are important to you then I would move to a DB for data storage.  You can still also save the data as csv in parallel until you get comfortable with DB io.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
Message 2 of 11
(3,670 Views)

+1 to falkpl.  Once you have your UDL set up and learned a few basic SQL commands it's pretty easy to read and write to a database.

 

This should tell you all you need to know to get going:  http://www.ni.com/pdf/labview/us/database_connectivity_toolkit.pdf

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
Message 3 of 11
(3,661 Views)

Thanks Falkpl,

I did bump around the examples before but got confused quickly when i got no good results. There were so MANY options when trying to open the session to begin with, i had/have no idea what i should start with. I'll give the UDL a shot per your suggestion. 

I am planning to spend some time on this over the weekend, i'll post results on monday. 

 

0 Kudos
Message 4 of 11
(3,653 Views)

cool info NIquist, i had that downloaded but i dont have Access so it didnt get me very far in creating the database 😞 good to put the link in this thread though.

thanks!

Dave

0 Kudos
Message 5 of 11
(3,642 Views)
0 Kudos
Message 6 of 11
(3,638 Views)

I moved away from access on windows to sqlserver express- its free, can be replaced with sqlServer which several big clients already use.  The interface isnt great but works well with win7 x64 and the db toolkit.

 

Learning curev wan not too steep took about 2 days to really understand it. 

 

A warning about access and x64 I had some trouble getting this working well and after switching to sql server I havent tried to use access again.

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 7 of 11
(3,636 Views)

For a really simple but extremely popular database look into SQLite

 

I managed to get SQL Server Express installed and working, but it has a steeper learning curve.

 

 

0 Kudos
Message 8 of 11
(3,634 Views)

dlong,

 

One big thing to consider when choosing a connection method is what will be required to deploy your application to another PC.  I use the string method because there are no extra configuration steps or files to copy.

0 Kudos
Message 9 of 11
(3,608 Views)

NI provides training course onLabVIEW Connectivity, however, using LabVIEW database connectivity toolkit to communicate databases is only a portion of the 2-day training course.

 

I would suggest to start with LabVIEW Database Connectivity Toolkit User Manual and LabVIEW 2010 Database Connectivity Toolkit Help for more information about using the Database Connectivity Toolkit

 

Shipping examples are also good resources.

 

 

Yupeng J.
0 Kudos
Message 10 of 11
(3,598 Views)