Thanks Jeremy,
But your answers have prompted futher questions! Thanks for the help!!
>>Does LabView not handle activex events properly?
My experience has been that there are no fundamental problems with using ActiveX events with LabVIEW. This functionality was only introduced in LabVIEW 5.1. Does your question mean that you are currently having problems in this area? There are several posts on Developer Zone that relate to ActiveX events in LabVIEW - most problems that I have had have been resolved by running the LabVIEW application on a single thread, rather than multiple threads by default.
>>>I'm not using ActiveX events, so I can't say I'm having any problems. My question was generated by the fact that some Datasocket vi's were modified by NI to remove the "wait on activex event.vi" because of poor performance. Why was this removed, then?
Isn't running LabView on a single thread defeating the purpose? Won't performance suffer?
>>Isn't DataSocket just using ActiveX?
The short answer is no. ActiveX is currently a communication method used solely on the Windows platform. DataSocket is NOT platform specific, for example a VB application running under Windows could communicate using DataSocket to a LabVIEW application running under MacOS. DataSocket provides a simplied API for users wishing to share information between two or more applications. The underlying protocol (TCP/IP, ActiveX, ftp and so on) is hidden from the programmer, making the development of such applications a simpler task.
>>>I guess I don't understand. If Datasocket is not ActiveX, why is there a "Wait on ActiveX Event.vi" in the Datasocket Read vi's?
>>If my OPC server has an activex control to access the server, would it be better to use this control or to use datasocket?
The answer to this question depends a number of areas.
1. How much documentation is provided with the ActiveX control?
2. How much experience/comfort do you have using ActiveX objects inside of LabVIEW?
3. How much functionality is exported via the ActiveX control?
4. Might you need to port your application to another OS in the future?
5. How stable is the ActiveX interface provided? Microsoft went through a process of changing their ActiveX model for their Office applications (Word, Excel and so on) such that you needed to recompile/make mods to your software if you upgraded from Word 97 to Word 2000.
The DataSocket programming approach is very straightforward. Simply open a connection with the OPC server using a suitable URL (opc://xxxxxxx/xxxx) and then read and write to the appropriate tags/data items that have been created/exposed by the OPC server. Once you have finished, simply close the DataSocket connection. You do not have to be aware of the underlying actions that are taking place to allow communication to happen. It could be that the OPC server is not even located on the same PC - regardless of the set up, the DataSocket approach is the same.
>>>In theory, I guess that's great, but why I was asking about using the ActiveX control instead of Datasocket is because, as NI has posted, Labview can handle only a certain number of Datasocket OPC connections. Given that, I was trying to figure if the ActiveX control might give better performance with more OPC connections.