-1

I have got two PC connected on Local LAN. On client PC data is written using LabVIEW. So how to access the same database on server PC using LabVIEW.

kosist
  • 2,868
  • 2
  • 17
  • 30

2 Answers2

1

i am assuming you are using the database connectivity toolkit. In this case, you'll need to use an ODBC server. This comes by default installed in the windows PC. Then you will configure the ODBC to point your SQL database. For this you will need the IP of the PC where the Database is running. Every PC on the local network can access the database if you know the IP address , database name and password. Here is a manual. You can see from section 3 onwards how to create the ODBC data source and then how to use it from LabVIEW: https://silo.tips/download/database-connectivity-toolset-user-manual

1

In a nutshell, open a DB connection in your local PC o in a remote PC is the same. You should only change the connection parameters. Anyway, some details must be taken into account.

Assuming that you are using a MS-SQL server, follow these points:

  • Be sure that your SQL server is accessible from the other PC. Follow this guide: Configure remote access SQL

  • I suggest you to use SQL Server Management Studio (SSMS) to check if your database is accessible.

  • In LabVIEW, use the Database Connection Toolkit to access to your DB. I suggest you to create a .UDL file and to use this file to open the DB connection.

To create an UDL file:

  • Create a new file wherever you want.
  • Rename its extension to .udl.
  • Double click on the udl file and configure it
  • Test DB connection
  • in LabVIEW, you will need to use the DB Tools Open Connection VI. Wire your udl file path in the connection information input. Use the code snippet below for details. You can also drag and drop the picture in LabVIEW block diagram in order to have the code ready to use.

DB snippet

Fourier
  • 111
  • 4
  • On client PC there is already a UDL file, can I use the same file to access database or should I create a new UDL file on server – Govind Parab Aug 15 '22 at 07:31
  • I suggest you to have the UDL file in the local PC where your application is running. If you are 2 appllications in your 2 PCs, use 2 UDL files. As starting point, you can copy the UDL file from a PC to the other one then try if connection works fine. – Fourier Aug 15 '22 at 08:18