Hello,
I am new to QuickOPC, but so far I find it quite good.
But I am having speed problems, I am reading 18 items using easyDAClient1.ReadItem() from a DCOM server in a WCF Service. It reads the correct values, but does it slowly (something like 100ms or less I estimate). After I read 18 it is a second or two which is too slow for the rest of my system.
I am reading 18 items
Bucket Brigade.0:1
Bucket Brigade.0:2
Bucket Brigade.0:3
...
Bucket Brigade.0:8
...
Bucket Brigade.1:8
Bucket Brigade.3:1
Bucket Brigade.4:1
I find it takes 1-2 seconds to read these. I believe that in some of your demo program it is doing things a lot faster.
I have looked through the sample programs a little bit, I may be missing something, but am I doing something wrong? Below is a function that wraps easyDAClient1.ReadItem(), at the bottom is the initialization that I am doing.
private int read_int_value(string MachineNameString, string OPCServerString, string itemString)
{
DAVtq vtq = null;
try
{
vtq = easyDAClient1.ReadItem(
MachineNameString, // machineNameTextBox.Text,
OPCServerString, //"Matrikon.OPC.Simulation.1", //serverClassTextBox.Text,
itemString //"Bucket Brigade.Int1" //itemIdTextBox.Text
);
}
catch (OpcException ex)
{...}
if there is no error I convert vtq.Value to an integer (or float) and return it from this function.
//output coil booleans
for (i = 0; i < 8; i++)
{
itemStr = itemString + ".0:" + (i + 1);
tagData = read_int_value(MachineNameString, OPCServerString, itemStr);
Console.WriteLine("read value="+tagData+" from:" + itemStr);
}
//input status booleans
for (i = 8; i < 16; i++)
{
itemStr = itemString + ".1:" + (i - 8 + 1);
tagData = read_int_value(MachineNameString, OPCServerString, itemStr);
Console.WriteLine("read value=" + tagData + " from:" + itemStr);
}
And once at the beginning I instantiate and initialize easyDAClient1
public Service()
{
Console.WriteLine("entered Service::Service()");
//easyDAClient = new EasyDAClient();
this.easyDAClient1 = new OpcLabs.EasyOpc.DataAccess.EasyDAClient();
// easyDAClient1
//
this.easyDAClient1.InstanceParameters.Mode.AllowAsynchronousMethod = true;
this.easyDAClient1.InstanceParameters.Mode.AllowSynchronousMethod = true;
this.easyDAClient1.InstanceParameters.Mode.DesiredMethod = OpcLabs.EasyOpc.DataAccess.DAReadWriteMethod.Asynchronous;
this.easyDAClient1.InstanceParameters.HoldPeriods.ItemDetach = 5000;
this.easyDAClient1.InstanceParameters.HoldPeriods.ServerDetach = 30000;
this.easyDAClient1.InstanceParameters.HoldPeriods.TopicRead = 120000;
this.easyDAClient1.InstanceParameters.HoldPeriods.TopicWrite = 120000;
this.easyDAClient1.InstanceParameters.Timeouts.BrowseAccessPaths = 60000;
this.easyDAClient1.InstanceParameters.Timeouts.BrowseNodes = 60000;
this.easyDAClient1.InstanceParameters.Timeouts.BrowseProperties = 60000;
this.easyDAClient1.InstanceParameters.Timeouts.BrowseServers = 60000;
this.easyDAClient1.InstanceParameters.Timeouts.GetProperty = 60000;
this.easyDAClient1.InstanceParameters.Timeouts.ReadItem = 60000;
this.easyDAClient1.InstanceParameters.Timeouts.WriteItem = 60000;
this.easyDAClient1.InstanceParameters.UpdateRates.ReadAutomatic = 10000;
this.easyDAClient1.InstanceParameters.UpdateRates.WriteAutomatic = -1;
//this.easyDAClient1.ItemChanged += new System.EventHandler<OpcLabs.EasyOpc.DataAccess.EasyDAItemChangedEventArgs>(this.easyDAClient1_ItemChanged);
}
Thank-you,
Mark