I am trying to use some simple code I copied from Softwaretoolbox.com to connect to a remote OPC server and check a tag. I have installed the same server on my local computer and it works on the but will not connect to any remote machines I have put the server on. I have tested the remote OPC servers with other OPC clients from the machine I am running this code on and they connect fine here is the code
try
{
//create the OPC Client object
OpcLabs.EasyOpc.DataAccess.EasyDAClient easyDAClient1 = new OpcLabs.EasyOpc.DataAccess.EasyDAClient();
//declare the object that will hold all the info for the tag being read
OpcLabs.EasyOpc.DataAccess.DAVtq tag = new OpcLabs.EasyOpc.DataAccess.DAVtq();
//read the tag
tag = easyDAClient1.ReadItem("SISCO2", "SISCO.AXS4ICCP.3", "IBDR1:LocalStatus~NumCfgLinks"); //System.Text.RegularExpressions.Regex.Replace(watchServer, @"[^\w\.@-],", ""), System.Text.RegularExpressions.Regex.Replace(watchtag, @"[^\w\.@-],", ""));
//check that we have a value
if (tag.Value != null)
{
//display the value, quality as a string and timestamp
MessageBox.Show(string.Format("Value: {0}, Quality: {1}, Timestamp: {2}", tag.Value.ToString(), tag.Quality.QualityChoiceBitField.ToString(), tag.Timestamp.ToString()));
}
}
catch (Exception ex)
{
MessageBox.Show("Error: " + ex.Message.ToString());
}
}