09-24-2019 05:04 AM
Hi,
I want Connect to a Remote SQL Database Using LabVIEW NXG, i know that there is no direct database communication functions.
Are there some options utilizing other functions within LabVIEW in conjunction with Web VIs, or exemple?
Solved! Go to Solution.
09-25-2019 07:04 AM - edited 09-25-2019 07:05 AM
Hello there. Posting a suggestion by Brandon Nguyen.
We don't currently have a direct to communicate with databases through Web VIs, but here are a few options:
1. Create a web service that handles the database communication, then use the WebVI to send HTTP requests to the web service to update/acquire database information. Kinda like this:
They can create the web service through LabVIEW (Current-Gen, not NXG) if they have that. We have an existing example for communicating between LabVIEW CG Web Services and Web VIs:
webvi-examples/Call3rdPartyWebService at master · ni/webvi-examples · GitHub
Keep in mind that while these are two separate entities for lack of a better word (a Web Service and a Web VI), they can still have everything in one 'spot' by hosting the web service, and using the Web VI build output as static files in the web service (these links are LabVIEW web service specific, but it should be the same idea with any other web service).
2. A bit of an expansion on the last suggestion, but use an existing web service that already talks to a database. If using SQL, we have some options here that should work:
PostgRest: GitHub - PostgREST/postgrest: REST API for any Postgres database
restSQL: restSQL Overview
And the idea is the same. Set up the web service that talks to the database, and use the HTTP VIs to get your Web VI to talk to it.
10-09-2019 08:57 AM
any idea when DB toolkit will be available?
10-16-2019 12:45 PM
Hi krzysztofszewczyk,
We're including the Database Connectivity API in the next release of LabVIEW NXG Professional, expected by the end of the year, so stay tuned!