My LabVIEW Application Uses DataSocket and Does Not Work as an Executable

Updated Feb 5, 2024

Reported In

Software

  • LabVIEW

Other

   

Issue Details

  • My LabVIEW application uses DataSocket communication and executes correctly in the LabVIEW Development Environment. When I build an executable, the DataSocket communication does not work. How do I resolve this?
  • I tried to run an executable which has DataSocket communication, but communication failed and the LED at chart and Numeric indicator turn red color as follow:LED turns red 

Solution

There are several reasons that can cause a LabVIEW executable using DataSocket communication to not work correctly:
  1. NI DataSocket needs to be installed on the system.
Note: The LabVIEW 2017 Run Time Engine (RTE) installer was the last version to include DataSocket. 

To confirm NI DataSocket is installed, check the following:
  • Search the Start menu for DataSocket.
  • Open NI Package Manager and search the Installed packages for DataSocket,
If you need to install DataSocket on a computer, you can:
  1. If your LabVIEW application programmatically opens and closes the DataSocket server using DataSocket Server Control VI, it needs to be explicitly included in the built application:
  • Navigate to the following location and add the VI to the LabVIEW Project: <LabVIEW 20xx>\vi.lib\platform\dataskt.llb\DataSocket Server Control.vi
  • Add the VI 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.
  • If you want your application to close the DataSocket Server programmatically, duplicate DataSocket Server Control VI and change the Operation input to close.
  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 and should have the same name (i.e. 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 .