Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Read multiple items on OPC server

I'm new to OPC and Measurement Studio for Visual C++. In my Visual C++ application, I need to read multiple (hundreds) items from an OPC server and would like to know the best approach to this. Do I need to create one CNiDataSocket object for each item that needs to be accessed? Is there a limit as to the number of CNiDataSocket objects in one application? Any implication on performance? Your kind help is greatly appreciated.
0 Kudos
Message 1 of 2
(3,038 Views)
"Do I need to create one CNiDataSocket object for each item that needs to be accessed?"

A DataSocket object can only be connected to one item at a time. If you need real-time update notifications for each item, you will need to create one DataSocket object for each item. If you just need to do simple reads for each item, you could use one object to connect, read, disconnect, and repeat for each item.

"Is there a limit as to the number of CNiDataSocket objects in one application?"

Other than limits imposed by the system (i.e., memory), no.

"Any implication on performance?"

I would guess that having hundreds of simultaneous open connections would have an impact on performance, but I haven't tried it to see what the impact would
be. If you decide to go this route, I'd be interested to hear your results.

- Elton
0 Kudos
Message 2 of 2
(3,038 Views)