In order to access remote OPC server, the VB.NET code can remain mostly as it is for local servers, with the only change in the first argument to most method calls: An empty string ("") denotes a local machine, while anything else specifies an OPC server on that remote machine. The string can contain anything that the operating system recognizes as computer name - among others, a WINS name (e.g. "OPC-MACHINE-1"), a DNS name (e.g. "opc-machine-1.factory.local"), or a numeric IP address (e.g. "192.168.1.23").
The code to read a single value may then look like this:
' Create EasyOPC-DA component
Dim EasyDAClient As New OpcLabs.EasyOpc.DataAccess.EasyDAClient
' Read item value and display it in a message box
MessageBox.Show(EasyDAClient.ReadItemValue("OPC-MACHINE-1", "OPCLabs.KitServer.2", "Demo.Single"))
If you are using other method calls, the code change would be similar; send me relevant pieces of your code if you are unsure where and howto make the modifications, and I will suggest the necessary changes.
It also appears from your question that you may have run into some kind of permission problem. Let me state that this is VERY common with remote OPC access, which is based on DCOM and requires it be configured properly. The correct configuration depends on your requirements, and needs rather elaborate description. For this reason, I refer you to ready-made materials that were written on the subject, such as these:
support.softwaretoolbox.com/cg...
www.softwaretoolbox.com/xpsp2/...
<a href="
opcfoundation.org/DownloadFile.aspx?CM=3&RI=326&CU=1" target="_blank" rel="nofollow">
opcfoundation.org/DownloadFile...
Please follow the instructions; if you still have problems, let me know and indicate what you have done and what error are you getting.
Best regards,
Zbynek Zahradnik
P.S. A somewhat related thread in these forums:
www.opclabs.com/Support/Online...