Hi
I am currently using Measurement Studio 7.0 Eval to connect to an OPC
server, which has anywhere from 100 up to 8000 tags I need to read
(update rate is not critical, up to 5s ok, and some tags don't change
or rarely change after initial connection). However, I initially read
two tags that I use to discover the names of the tags I will be using.
There are also a number of tags that always have a fixed name which I
can read fine.
However, after binding the tags of the dynamically created bindings, my
pc takes enormous strain. I've tried increasing the update interval
above 1 second but it doesn't make a difference. I suspect this problem
is related to how I'm obtaining my data or the calls I'm using. I
create the dynamic bindings in a loop as follows:
....
((System.ComponentModel.ISupportInitialize)(this.CSMDataSocketSource)).BeginInit();
for (i=0; i < tMax; i++)
{
if (status[i] == '1')
{
System.Windows.Forms.TabPage newDevicePage = new TabPage();
newDevicePage
= BuildDeviceTabPane(i);
newDevicePage.Text = "Device "+i;
this.deviceTabControl.Controls.Add(newDevicePage);
devices.Add(new System.Windows.Forms.TreeNode("Device "+i));
deviceCount++;
}
}
((System.ComponentModel.ISupportInitialize)(this.CSMDataSocketSource)).EndInit();
....
Currently, I have a bunch of forms containing items such as labels etc,
with each element being bound, via a dataSocketSource, to a unique OPC
url. Is there a way of doing a group read of this data via some kind of
object instead of having to bind and url-specify each element. I
currently do this binding as below, for example:
NationalInstruments.Net.DataSocketBinding
networkRunning = new NationalInstruments.Net.DataSocketBinding();
networkRunning.Name = "networkRunning";
networkRunning.Url =
serverURL+"network_Running"+"?UpdateRate="+OPC_UPDATE_RATE;;
this.CSMDataSocketSource.Bindings.Add(networkRunning);
this.networkRunningLED.DataBindings.Add(new
System.Windows.Forms.Binding("Value", this.CSMDataSocketSource,
"networkRunning"));
I've also looked at using the DataSocket but don't see that as being
very useful if I have to specify a dataSocket, and resulting update
event handler per tag I want to read. There must be a better way of
doing this which has not yet occured to me.
Any ideas/feedback is most appreciated!