LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving data in a database and publishing data to multiple clients

Hi there.  I'm using a bunch of Compact FieldPoint modules to read out a few hundred voltages, temperatures, currents, etc.  I acquire this data at about 1 Hz (pretty slow).  I would like to record this data to some sort of database on a cpu (running LV 8.0, connected to the FieldPoint mods), and serve the data to multiple (between 10 and 50) clients over the net, each running a compiled stand-alone "data grabber and viewer" application (which I'll have to write of course).  I'd like these external clients to basically be able to pick a certain variable from the database, and plot it for the last week (or something like that).  Presumably the standalone client would send some database query to the server.  The server would then send the data to the client, and the standalone client would receive the data and plot it as the user sees fit.  My question is how to implement this database?  Should I use the LabView "Database" Add-On to create a database to store the data? Is it better to just store the data as binary and write my own data fetching routine to handle queries?  How can I write this database to disk for permanent storage? Could this database be accessible outside of LabView?

Any help on this would be appreciated.  Thanks!

Jesse Wodin
Post Doctoral Researcher
Stanford Linear Accelerator Center
650-504-2512
0 Kudos
Message 1 of 6
(4,303 Views)

Imho, you'd be better off writing to a database and for that many clients, a real database like SQL Servier, MySQL, or Oracle. You could use the Database Connectivity Toolkit or LabSQL from http://www.jeffreytravis.com/lost/labsql.html. The toolkit provides a lot of functions that isolate you from learning the database programming language called SQL.

If you use an actual database, the client does not have to be written in LabVIEW. Data can be viewed with Access, Excel, and a host of web based apps.

0 Kudos
Message 2 of 6
(4,300 Views)
Greetings.

  The LabVIEW DSC Module sounds like an excellent solution to this problem.  In particular, DSC includes the Citadel database.  To use it, you simply enable datalogging on LabVIEW shared variables connected to the FieldPoint items you want to log.  The live and historical data will be available over the network to any client using the DSC RTS.  DSC includes a historical data viewer component that allows you to view and export data from local or remote databases.

  An alternative would be to write your own logger and viewer appliations that periodically writes variable values to an SQL database using the Database Connectivity Toolkit.  You could write client applications to retrieve data from this database and display the data. 
~~
0 Kudos
Message 3 of 6
(4,276 Views)
Yes, I was thinking of using the LabView Datalogging and Supervisory Control module.  Is this Citadel database the same as a MySQL database? Also, will anyone who wants to access this database have to buy the DSC runtime engine?  I don't really want all of the clients to have to pay for this. In this case, I believe that your second suggestion may work well... time to learn SQL.

Jesse


0 Kudos
Message 4 of 6
(4,263 Views)
Hi Jesse,

  The Citadel database is not a relational database.  It's highly optimized for storing lower-rate (non-waveform) channel-by-channel, or "trace" measurement data.  Another option you can consider is using DSC and Citadel on the server then writing a utility to export the data from Citdael to an SQL database.  --That would solve the problem of having to write a logger application from scratch.  You would only have to write the relatively simple application to export the data from Citadel and import it into a relational database.

  You could accomplish this two ways.  First, DSC includes a set of VIs that will retrieve historical data from Ciatdel.  You could use LabVIEW to parse this data and write it to a table in a relational database.  Second, Citadel actually includes a locally accessible ODBC interface.  (You can query Citadel using an SQL query from the local computer).  You could query Citadel using this interface, then write the result to a table in a relational database.

  To view Citadel in its native format or query a Citadel database using ODBC from a remote comptuer that comptuer would need to have a licensed DSC RTS installed.


~~
0 Kudos
Message 5 of 6
(4,246 Views)
Okay, this is certainly enough to get me started. Thanks!

Jesse
0 Kudos
Message 6 of 6
(4,235 Views)