ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Connect Labview to PostgreSQL

Hello

I have a demand to integrate my system in LabVIEW with a PostgreSQL database.
The database was created by the company's IT team, and they gave me some information from the bank, such as:

Host
Port
User/Owner
Passowrd
Database

I'm trying to establish communication with the database with this information but I'm not succeeding, can you help me?

0 Kudos
Message 1 of 8
(1,867 Views)

Can you share what have you done so far ? 

 

0 Kudos
Message 2 of 8
(1,865 Views)

Here is the VI, with the real data masked

0 Kudos
Message 3 of 8
(1,862 Views)

connection strings can be found here 

Message 4 of 8
(1,829 Views)

What I do is create a udl file with all the connection info. Do this by going to Tools-->Create Data Link.

Then I wire a path of that file to the input on the Open Connection.vi. This way I can test the connection in the udl interface and make sure I get the "Test connection succeeded" before I go to LabVIEW. Sort of like how you test the VISA connection in MAX before opening it in LabVIEW.

 

ooth_0-1723145312048.png

 

Message 5 of 8
(1,822 Views)

@ooth wrote:

What I do is create a udl file with all the connection info. Do this by going to Tools-->Create Data Link.

Then I wire a path of that file to the input on the Open Connection.vi. This way I can test the connection in the udl interface and make sure I get the "Test connection succeeded" before I go to LabVIEW. Sort of like how you test the VISA connection in MAX before opening it in LabVIEW.

 


As an addendum, the .udl is a simple text file, so you can copy the content and use as Connection string if you don't want to use the file.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 6 of 8
(1,793 Views)

Well I'll be. It is just a text file. At least the udl tool helps to get the connection string formatted correctly.

Message 7 of 8
(1,786 Views)

@ooth wrote:

Well I'll be. It is just a text file. At least the udl tool helps to get the connection string formatted correctly.


Oh yes, that's how i use it. 🙂

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 8 of 8
(1,767 Views)