Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

How many CWDataSocket Controls needed on VB form

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.
0 Kudos
Message 1 of 5
(3,555 Views)
"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
0 Kudos
Message 2 of 5
(3,555 Views)
Thank you for your reply.
For the DI-330 I can connect to the "ALL" channel which returns 2 bytes of channel status.
For the AI-100, I will try your idea of a control array.
Another question I have is( I will also post it to a new thread) is the deadband setting suposed to work for the AI-100? I have tried the following code and the UpdateRate seems to work but the DeadBand setting has no effect
CWDS_AI7.ConnectTo "opc://localhost/National Instruments.OPCFieldPoint/FP Res\FP-AI-100 @7\Channel 0?UpdateRate=1000&DeadBand=50", cwdsReadAutoUpdate

Again thank you for your help,

Peter Scharpf
Brady Worldwide Inc.
Email: peter_scharpf@bradycorp.com
0 Kudos
Message 3 of 5
(3,555 Views)
Deadband is only applicable if you are using an Ethernet Network Interface Module such as the FP-1600 or FP-2000. Deadbands are supported for the AI-100 if you are using one of these modules. I'm not sure how the opc server handles deadband, though. If you have an ethernet FieldPoint system and you still can't get deadband to work, let me know.

Tony
National Instruments
Measurement Studio
0 Kudos
Message 4 of 5
(3,555 Views)
Thank you for your reply.
I am using an FP-1000 module so I assume DeadBand is not supported. I would be interested in trying to understand why it is not (if someone has a simple explanation).
I am able to compensate for the lack of deadband in my program to eliminate unnecessary data logging but it does nothing to cut down on the serial traffic not to mention PC resources. I need to keep the upDate rate high enough to catch items of intrest.
Thanks again,
0 Kudos
Message 5 of 5
(3,555 Views)