LabVIEW DataSocket Program Does Not Run as an Executable

Updated Jan 24, 2023

Reported In

Software

  • LabVIEW

Other

   

Issue Details

My LabVIEW VI that uses DataSocket communication runs fine in the LabVIEW Development Environment, but when I build it into an executable, it will not run properly.  

Solution

There are several possible reasons may cause a VI that uses DataSocket communication would not work correctly as an executable: 
  1. In order to run a DataSocket application, you must have NI DataSocket installed on the system. To confirm NI Datasocket is installed, check if the following folder exists:

Start»All Programs»National Instruments»Datasocket

If you need to install DataSocket on a computer, then you can do it two ways. The first is to download the latest LabVIEW Run-Time Engine. The LabVIEW Run-Time Engine package includes several installers, including NI DataSocket. You can also build an installer using the LabVIEW Application Builder that includes NI DataSocket as an additional installer, as seen below.

  1. If your VI programmatically opens and closes the DataSocket server on your computer, as the shipping examples do, then a specific file needs to be included in the built application. The following is the default path to the file that needs to be included:

<LabVIEW 20xx>\vi.lib\platform\dataskt.llb\DataSocket Server Control.vi

This VI must be first be added to your LabVIEW Project and then added to the "Always Include" section of the source files category in the application Build Specification Properties, or the executable will not programmatically open the DataSocket Server. This file by default will only open the DataSocket Server programmatically. However, it can easily be duplicated and changed to close the DataSocket Server.
  1. Incorrect Windows DCOM settings can prevent an executable from successfully opening a DataSocket connection. Many DCOM connection problems can be overcome by disabling DCOM authentication for your application by adding the following line to the executable's INI file:

ole.AuthnLevel = 1

Note: The executable's INI file should be located in the same directory as the executable as should be named Your Application name.ini.

Additional Information

For more information on how to create an installer that includes NI DataSocket, refer to Distributing a LabVIEW Application Built with DataSocket .