Error -2147220221: The DataSocket operation Timed-out with remote OPC Server

Updated Dec 22, 2023

Reported In

Software

  • OPC Servers
  • OPC DA Connect
  • LabVIEW

Operating System

  • Windows

Issue Details

I am using the DataSocket functionality to read data from an OPC Server. When the OPC server is local it works fine, but when I am trying to connect to external Server the Timeout Error (-2147220221) is showing.

time out datasocket1.png
Error:-2147220221. Check parameters. Error: The DataSocket operation timed-out. 


However, the DS_SelectURL does display the variables that exist on the remote OPC Server. 

Solution

The DataSocket protocol has an OPC layer, which allows you to read and write to an OPC server using DataSocket. This function is available for LabVIEW 5.1 and upper.
But sometimes client can't connect to server, and timeout error is showing up. 

There is a service called Remote Registry that must be running on server.

For Configuring this function, please follow the instructions below:

  1. In Windows Start Search enter and choose Service option. 
  2. From Service Window scroll till Remote Registry option :                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     kb11.png
  3. From opened Remote Registry Properties window set the Startup Type to Automatic:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                KB12.png                                              
  4. Save the changes. 

Now you will be able to establish the connection.