Hello There,
Hoping someone may be able to help with a problem I am experiencing using the Datasocket control (v4.00 (375)) connecting to various tags using Siemens OPC on a local PC in a custom VB project (phew!). I'm finding that the actual initial connection takes a very very long time, once connected, the tags update at a speed I would expect and run very nicely. At present I am connecting and disconnecting tags when changing between screens as. The code I'm using for the actual connection is:
For Repeat = 0 To UBound(URL)
If ((CurrentDataSocketForm.CWDataSocket.Count - 1) < UBound(URL)) Then Load CurrentDataSocketForm.CWDataSocket(CurrentDataSocketForm.CWDataSocket.ubound + 1)
CurrentDataSock
etForm.CWDataSocket(Repeat).ConnectTo URL(Repeat), cwdsReadWriteAutoUpdate
Next
and the disconnect (on form_unload):
For Repeat = 0 To NumberOfDataSocketsToDisconnect
CurrentDataSocketForm.CWDataSocket(Repeat).Disconnect
Next
I have one datasocket control on each screen (set as an array) and dynamically add a new one (or more) at run-time if needed. It doesn't seem to be the dynamic adding of the control (as I have tried by using the correct amount of controls on the screen) but rather the line that connects the URL and activates it. The URL(Repeat) is an array of addresses stored as : "opc://localhost/OPCServer.WinAC/"Q10.0" for example and as I said when connected they work great.
Is there something I'm doing obviously wrong here? This is the first time we are using a datasocket control over using code created by myself to connect, if I connect using my old code, then the connection speed is alot better. Any help would be very appreciated!
Thanks
,
Dan