09-23-2005 06:19 PM
--------------
Public
Sub dsSetup16()
'Fill DataS Array with the 16 DataSocket objects
Then later update and retrieve DataSocket vaules like this.
oDataSocket(1).Update()
myValue = oDataSocket(1).Data.Value
Great idea - but not so great in reality as nothing happens?
Any suggestions/ corrections - someone must have tried to do this before.
Tia,
Jeppe
09-26-2005 05:10 PM
Hi Jeppe,
Im not sure what may be happening here but I wanted to ask a couple questions. If you create just one datasocket (and not an array) do you get any data? Second, if not, do receive any data when you use the actual datasocket control instead of creating it programmatically? Finally, what version of Measurement Studio are you using?
The more we can narrow the problem down, the faster we can figure out a solution.
09-26-2005 08:45 PM
Hi Caroline,
Thanks for getting involved.
My Mstudio is version 7.1 plugged into VS2003.
From my local Sales rep I received a FieldPoint demo app written VS2003. It was based on the above COM code structured in a module and a form.vb. The form has no DataSocket control. During run-time you call the SelectUrl and browse to read 1 opc item/ 1 channel. The demo works but is based on 1 OPC item and a form in which an item is selected by the user.
The ultimate goal for me is to have a configurable back-end windows service - reading up to 8 FP-AI-111(16ch) and logging their values in a SQL database.
A front-end app is to provide visualization, reporting, configuration features etc. - but the back end datalogger would need to run regardless.
It should not be that difficult - but with multiple datasockets in an array I am not sure how to call the Constructor and ID each instance. Or if I would need to write a new class to create what in VB6 is an 'Array of Controls'?
Tia,
Jeppe
09-28-2005 08:10 AM
You can create an array of these datasockets. Any propperties you would like to change. You can change them within the properties page of the control and then just copy the code from what is autogenerated when you change the property.
Hope this helps.