OPC DA to OPC server communication.|Classic OPC: DA, A&E, HDA, XML-DA, etc.|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
OPC DA to OPC server communication.
Avatar
RAVI KUMAR UPPADA UPPADA
New Member
Members
Forum Posts: 1
Member Since:
11/10/2025
sp_UserOfflineSmall Offline
1
11/10/2025 - 00:58
sp_Permalink sp_Print sp_EditHistory

Hello,

Historically, we have been using the JEasyOPC client on a Windows Server 2012 setup to retrieve switch information via the OPC DA protocol, with both the client and server running on the same machine. This configuration relied on DCOM, which is essential for OPC DA communication.
As part of our infrastructure modernization, we have migrated to a Linux-based environment. However, we are now facing a significant architectural challenge:

JEasyOPC is not supported on Linux, primarily due to its dependency on DCOM.
Our hardware supports only OPC DA, and not OPC UA, which limits our ability to adopt a fully modern OPC UA-based solution.

Given these constraints, we are exploring alternative architectures that would allow us to continue retrieving switch data while operating in a Linux environment.

Can you please suggest the Architecture on the OPC server and OPC client

 

Thanks.

Avatar
Randy Armstrong
Admin
Forum Posts: 1656
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
11/11/2025 - 07:15
sp_Permalink sp_Print

I don't understand why the 'hardware' supports OPC-DA only.

If you change your OS you will need new drivers for whatever h/w you have no matter what API is provided.

If you have a h/w that is only supported on windows then you will have bigger issues than OPC compatibility.

If your h/w has a lower level API that does work on Linux then your best best is to write a UA server that uses this lower level API.

Avatar
heittor Rodrigues
New Member
Members
Forum Posts: 1
Member Since:
11/10/2025
sp_UserOfflineSmall Offline
3
12/17/2025 - 06:32
sp_Permalink sp_Print

I am trying to establish communication from OPC DA to OPC. DCOM is already configured. I am using C#. How should I proceed? When I run my code, I get error messages such as “communication failure.” Could you share an example code for communication with the DLLs and libraries used?

Avatar
Randy Armstrong
Admin
Forum Posts: 1656
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
12/17/2025 - 10:15
sp_Permalink sp_Print
OPC-F code is here: https://opcfoundation.org/developer-tools/samples-and-tools-classic/net-api-sample-client-source-code/

I suggest you look for commercial SDKs because they may offer you more support.

..

using System;
using Opc;
using Opc.Da;

namespace OpcClientSimple
{
class Program
{
static void Main(string[] args)
{
// 1. Define the Server URL (Local or Remote)
// Format: opcda://[Hostname]/[ProgID]
string url = "opcda://localhost/Matrikon.OPC.Simulation.1";

Opc.IDiscovery discovery = new OpcCom.ServerEnumerator();
Opc.Server server = new Opc.Da.Server(new OpcCom.Factory(), null);

try
{
// 2. Connect to the Server
server.Url = new Opc.URL(url);
server.Connect();
Console.WriteLine("Connected to: " + server.Url);

// 3. Create a Group (Subscription)
SubscriptionState state = new SubscriptionState();
state.Name = "MyGroup";
state.Active = true;

Subscription subscription = (Subscription)server.CreateSubscription(state);

// 4. Add Items (Tags) to the Group
Item[] items = new Item[1];
items[0] = new Item(new ItemIdentifier("Random.Int4"));

items = subscription.AddItems(items);

// 5. Synchronous Read
ItemValueResult[] results = subscription.Read(subscription.Items);

foreach (ItemValueResult result in results)
{
Console.WriteLine($"Item: {result.ItemName} | Value: {result.Value} | Quality: {result.Quality}");
}

// 6. Cleanup
server.Disconnect();
}
catch (Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
}
}
}
}..

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 20
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1508
Posts: 5103