"scharppe" wrote in message
news:506500000008000000A9580000-1027480788000@exchange.ni.com...
> I am new to DataSocket and OPC and have some fundamental questions.
> I need to monitor 40 input channels of a FieldPoint FP-1000 system
> using FP-DI-330 (24 Channels) and FP-AI-100(16 Channels). What is the
> best and fastest way to get updates on all of these channels?
> Should I use one CWDataSocket control and loop through all channels
> using CWDataSocket1.ConnectTo or should I use a control for every
> FP-DI-330 and FP-AI-100 module?
> Can I use a control for every one of the 40 channels?
> Is there a "global" channel that can be created to generate the
> OnDataUpdated event for multiple modules?
> Thank you in advance for your help.
I would sugg
est a control array. I can only speak for VB since I've not done
much in VC, but if you create a contol on the front panel, name it, then cut
and paste it to get as many copies as you need, all the controls can retain
the same name and they become elements of an array.
You then address them as cwDataSocket(n).value for example. When you use
events, the events then pass an index to your code to indicate which element
has fired the event.
It would be nice if you could just make one control named socket with an
index of zero and then do something like
dim sockets(40) as cwdatasocket
for i = 1 to 40
set sockets(i)=new socket
next i
Never tried this though and not much time to play at the mo.
Disconnecting after each read and reconnecting sound horrendously
inefficient.
--
Dr. Craig Graham, Software Engineer
Advanced Analysis and Integration Limited, UK