LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Making a custom ActiveX server in Labview (wrapper?)

Hi,

I want to control a specialized camera with a Labview application (standalone exe). The camera has its own proprietary management sotware (or rather a server/service), which allows external control via ActiveX (it provides its own COM interfaces with properties and methods) and data is transferred via shared memory. All of this is reasonably easy to interface with Labview. However, this proprietary camera management server additionally requires every client application to implement an own COM interface (callback interface) with 2 simple methods for compliance reasons (basically watchdog functions). That is, the camera server expects a client app, which wants to control it, to provide a COM callback interface with the 2 methods, which the server will periodically call. Therefore, part of the initialization process (i.e. when a client app "connects" to the server first) is to call the server's "RegisterCallback" method and provide it with a pointer to the client app's callback interface. There is a way to override the callback requirement, so it's not a life-and-death issue, but I would like to implement it eventually for compliance.

 

Now as far as I know, this question has been addressed many times and the answer is (still) that Labview can't implement custom ActiveX/COM interfaces or methods for its own ActiveX server - it only provides a generic ActiveX interface which wraps some VIserver functions but can't be customized in any way. However, it seems to be not a problem at all in LabWindows/CVI, so that's...interesting.

 

I understand that this functionality (custom Activex/COM interfaces) most likely will never be a part of Labview, since ActiveX is dying and rightfully so. Therefore, I hoped to find a workaround. Probably the COM interface can be implemented in a DLL in another language and (optionally) communicate with the main Labview application via VIserver, sockets or anything else. In my particular case, I don't need the main application to be notified about the 2 ActiveX method calls by the server at all and the DLL only needs a start and stop function (to start/stop the ActiveX server from the main application). Since I don't have any proficiency in C/C++ to speak of to make a custom solution, I'm wondering whether there exists a wrapper/toolkit that lets you "build" simple custom Activex/COM interfaces which can be "launched" from another application.

0 Kudos
Message 1 of 4
(2,327 Views)

If your in luck, those required callbacks are handled though events.

 

LabVIEW can register for ActiveX callback events, through the Register Event Callback node. Those callbacks would get some sensible inputs (probably com objects) and you'd use those to communicate back to the main COM object.

 

To check, simply wire the COM reference to the Register Event Callback node. If you get events, it might just work.

0 Kudos
Message 2 of 4
(2,303 Views)

Hi,

Of course I looked for events first 🙂 - here I'm definitely out of luck. The camera management server actually does send out an event to inform client apps when the camera is in use, but the watchdog callback methods I mentioned have to be explicitly implemented by the clients as - well - methods through their own ActiveX interface. Why this watchdog functionality couldn't be implemented through events or any other simple means (like periodic polling by the client app) is beyond me, but they obviously didn't have Labview developers in mind :)... It is as it is...

0 Kudos
Message 3 of 4
(2,298 Views)

It was worth mentioning. Sorry it didn't work.

 

I don't think there are much options left, besides making a custom ActiveX object in C\C++\etc..

0 Kudos
Message 4 of 4
(2,293 Views)