02-12-2009 09:40 PM
Hey all...I'm pretty experienced LabVIEW programmer but I'm in somewhat new territory here with communicating with a server/website.
We are going to have an online SQL database that stores all data that we record for our application. That database is going to have a web-based front end that will allow users to add/edit records.
On the other end, we are going to have a LabVIEW application running on a PC that will allow its users to acquire/input data, and also add/edit records for the SQL database as well. So basically a web-based client and a LV application client, which will most likely differ in functionality.
There are going to be multiple PCs running LabVIEW client applications (let's assume upwards of 20 for now). The idea would be that the user could:
I have played around with the database connectivity toolkit and was able to communicate with the SQL databases online, no problem. But, I'm not sure if that is the best way to do this yet because....
Here are our challenges/constraints/specifications:
Well we need this to be as low bandwidth intensive as possible as each LV client will be using a GPRS(cell phone) data connection to the internet which is pay per use. Here are my thoughts on this so far:
The data types that we are working with include all standard types (numeric, text, timestamps) and also includes images (jpg) and sound files (mp3) and potentially video in the future.
Thanks and I'm looking for any and all feedback. Let me know if the problem is still fuzzy...I will try to describe in better detail.
-Aaron
02-12-2009 09:53 PM
How often would you need to update the database and/or LabVIEW client? Would it help if you could do it once per day? Another thought is to zip a file with the info to be inserted in the database to save bandwidth. The server would have to unzip and interpret the file...
02-12-2009 09:57 PM - edited 02-12-2009 09:59 PM
MattBradley wrote:How often would you need to update the database and/or LabVIEW client? Would it help if you could do it once per day? Another thought is to zip a file with the info to be inserted in the database to save bandwidth. The server would have to unzip and interpret the file...
Good question!
The data being sent from the LabVIEW client can have different levels of priotirty associated with it. If it's high priority, it would need to be updated to the database as close to real-time as possible. Data that is lower priority could all be bundled together in a single file and sent 1x per day/2x per day/1x per week/etc....
02-12-2009 10:04 PM
02-12-2009 10:18 PM
MattBradley wrote:
Next question: Can the clients (easily) talk to each other -- if they can make a single file for updating the server, that could help, too. In any case, my first thought would be to put the different priority data in different directories. Have another labview (or even a different software package) running in the background, looking for new data (more often in the high priority directories). When it sees something, copy it to the server. When the server confirms the file has arrived, delete the original one. On the server side, it would have to let the client know it received the file and then unzip it/translate it/whatever and insert it into the database. Sound good so far? -Matt
Matt,
Sounds good so far. Interesting idea of putting it in different directories, although I'd like to minimize file I/O as much as possible, especially between different VIs. I'm also intrigued by using .zip files to cut down on file size.
No, the clients won't easily be able to talk to each other. All messaging between clients will go through the server as well.
I guess I'm really looking for how to practically implement this as well. Like what VIs (protocol) should I be using to get the data to the server? TCP/UDP/SMTP/FTP/SQL connection/etc...I have little experience making apps communicate with a website/webserver.
-Aaron
02-12-2009 10:41 PM
Aaron,
I was thinking that putting it in a file would help in terms of zipping it to save space. Then you could read it as a binary file and use the internet toolkit to send it with a TCP write. Each client would have its own port number. I think the only things you will need are the TCP open, TCP write, TCP read (for the server), and TCP close.
-Matt
02-27-2009 11:18 AM
I've been playing around with the "Web Services" examples and it seems like this might be the way to go. Anybody have any thoughts on this?
-Aaron
03-02-2009 03:03 PM
Hi ajf200!
I would agree the Web Services is a good option. Have you seen this Developer Zone article on Web Services: Web Services in LabVIEW ? If you have LabVIEW Full or Professional Development Systems, Web Services is installed with LabVIEW.
Kristen H.