LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to connect to database from a VI which is running in Labview real time?

Hi,

 

I want to read and write data from a mysql database from labview which is running in a Labview Real - Time. is there a way to do it with out using multiple connections as suggested in http://zone.ni.com/devzone/cda/epd/p/id/6287 . Here i don't want a host VI.

 

thanks in advance

0 Kudos
Message 1 of 7
(3,301 Views)

I have absolutely no exprience with this, but I understand there are at least a couple of toolkits (By Raima and Saphir) which allow accessing DBs from RT targets.

 

Another alternative I can think of is if you can get your DB to expose the functions you want as a web service. I don't know if RT can call web services, but I would expect it should be possible. That way, you don't have to have the ADO infrastructure which most DB tools rely on.


___________________
Try to take over the world!
0 Kudos
Message 2 of 7
(3,292 Views)

Hello Yathi,

 

This depends largely on the version of RT you're using and what the OS supports- is this for VxWorks, Phar Lap/ETS, or LinuxRT?  Refer to:

 

KnowledgeBase 4LRA4IQ0: What Operating System is my Real-Time Controller Running and Why?

http://digital.ni.com/public.nsf/allkb/35F1FD98520D6E0E8625783A005AF557

 

I've seen solutions for VxWorks using the SQLite method described in the tutorial you linked.

 

Regards,

 

Tom L.
0 Kudos
Message 3 of 7
(3,242 Views)

The Raima package (http://www.ni.com/labviewtools/raima) supports a database on the real-time device itself. If mySQL is required, then Raima is not the solution. However, Raima databases can exist on real-time devices or Windows. The next release (later in November 2013) will also support the NI Linux Real-Time as well as the current VxWorks 6.3.


----------------------
Wayne Warren
CTO
Raima, Inc.
0 Kudos
Message 4 of 7
(3,212 Views)

Hi Wayne,

 

Is the Raima package available for NI RT-targets running the Phar Lap/ETS OS?

 

Regards,

Roger

0 Kudos
Message 5 of 7
(3,164 Views)
I have recently worked on an application that communicates with a database through a PHP script running on a webserver. The LabVIEW application uses the HTTP Client VIs to 'POST' data to the PHP script which then in turns handles the database communications. The POST data includes the data I want to send and a 'command' variable which tells the PHP script which function to run. You can also return/request data - it's essentially very similar to the LabVIEW web services.

(You can use PHP, any other server side programming language, or indeed any other programming language)

My feeling is to use a 'handler' application to receive the data from the RT device, process it and put it into the database. I think that makes it much more flexible (if you need to change database, it's structure or how the data is entered) than if you were to communicate with the database directly - but it does require having/setting up an extra software 'layer' (the handler script / application).

LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 6 of 7
(3,157 Views)

Sorry, Roger, but we haven't yet made a decision to port our database to Phar Lap. At best this would be later next year.


----------------------
Wayne Warren
CTO
Raima, Inc.
0 Kudos
Message 7 of 7
(3,151 Views)