LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement an ActiveX server in LabVIEW

My task is to implement an ActiveX server in LabVIEW 8.0 that will be called from a data management software (DXE).
The LV server will take care of data acquisition and control.
I have been looking for tutorials and example code at the NI developer zone and elsewhere without any progress. Information is either to general or code is to old (LV 5.1) to give any help.
Please, show me to a good example of an ActiveX server in LV 8 properly commented or with attached explanations.
Alternatively, suggest any tutorial, short course or books with practical instructions.
Specific information is most welcome.

I suppose that it is possible to write a ActiveX client in LabVIEW to verify the functions of the ActiveX server ?
0 Kudos
Message 1 of 8
(4,711 Views)
The short answer is:

You can't!

LV can't create an ActiveX server because it is incapable to build com objects

I'm not sure about the long answer but their might be workarounds with LV-dll's called by activex components which form an activeX server

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 2 of 8
(4,710 Views)
Actually, you can have an ActiveX server. It's an ActiveX control that you are unable to create with LabVIEW. If you have the development environment, then LabVIEW itself is the server but if you create an executable, then you can make that the server by going to the Advanced window of the app builder and checking the 'Enable ActiveX Server' box. If you look at the several shipping examples that demonstrate the VI Server, you will get an idea of all of the methods and properties that are exported by LabVIEW. I'm not familiar with DXE but there is also an example to control LabVIEW with c# at http://zone.ni.com/devzone/cda/epd/p/id/3838 and one that uses VB is at http://zone.ni.com/devzone/cda/epd/p/id/1182.
Message 3 of 8
(4,704 Views)
Thank You. Good to know that I am on the right track.
However, Your sentence "If You look at the several shipping examples..." make me little concerned. I am not able to find any example of a LV ActiveX server in my LV 8.0 installation. I would be very grateful of You can send me any.
0 Kudos
Message 4 of 8
(4,689 Views)
If you open the example finder and go to the Browse tab, expand the Programatically Controlling VIs topic and look under both 'Controlling Front Panel Objects' and Dynamically Loading and Calling VIs'. The examples that mention VI Server are the ones you want. VI Server is another word for the LabVIEW ActiveX server. The LabVIEW functions for acccessing it's own properties and methods are on the application Control palette. There is also extensive information in the on-line help under the VI Server topic.
Message 5 of 8
(4,679 Views)


@skalis wrote:
Thank You. Good to know that I am on the right track.
However, Your sentence "If You look at the several shipping examples..." make me little concerned. I am not able to find any example of a LV ActiveX server in my LV 8.0 installation. I would be very grateful of You can send me any.

Basically you can not create your own Active X server with your own object hierarchy and methods in LabVIEW. LabVIEW however can export a predefined Active X server interface that is just another access method to its internal VI server interface.
With this interface you can determine what VIs are available to control, load specific VIs from disk if you know their path and, execute those VIs and passing parameters to it and receiving outputs.

So if your software allows you to script the Active X access to an Active X server in some ways such as VBA or similar you should be fine. If your software expects a specific Active X interface you have to implement in the server application, you are out of luck with LabVIEW, without using an external component such as an extra Active X server DLL that translates between the expected interface and the exported LabIVEW interface. But this last method is quite likely not worth the hassle.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 6 of 8
(4,668 Views)


@rolfk wrote:


@skalis wrote:
Thank You. Good to know that I am on the right track.
However, Your sentence "If You look at the several shipping examples..." make me little concerned. I am not able to find any example of a LV ActiveX server in my LV 8.0 installation. I would be very grateful of You can send me any.

Basically you can not create your own Active X server with your own object hierarchy and methods in LabVIEW. LabVIEW however can export a predefined Active X server interface that is just another access method to its internal VI server interface.
With this interface you can determine what VIs are available to control, load specific VIs from disk if you know their path and, execute those VIs and passing parameters to it and receiving outputs.

So if your software allows you to script the Active X access to an Active X server in some ways such as VBA or similar you should be fine. If your software expects a specific Active X interface you have to implement in the server application, you are out of luck with LabVIEW, without using an external component such as an extra Active X server DLL that translates between the expected interface and the exported LabIVEW interface. But this last method is quite likely not worth the hassle.

Rolf Kalbermatter



While I did follow the link mentioned above and found the Interop.LabVIEW.dll that is included in the C# project for the purpose of calling VIs from C#, I am frustrated that these methods are 'buried' in a .dll that you have to go and find on the NI web site, and are not ActiveX methods that are available in an ActiveX Object that is installed when you install LV 8.20 PDS. 

Rolf, I don't know that you will get this email, but are you refering to the methods inside of the Interop.LabVIEW.dll in what you are saying above, and if so, how did you become aware of this .dll? 

Is anyone aware of any documentation for these ActiveX methods?

Thanks,

Wes


--------------------------------------------------------------------------------------
Wes Ramm, Cyth UK
CLD, CPLI
0 Kudos
Message 7 of 8
(4,551 Views)


@Wes Ramm wrote:

While I did follow the link mentioned above and found the Interop.LabVIEW.dll that is included in the C# project for the purpose of calling VIs from C#, I am frustrated that these methods are 'buried' in a .dll that you have to go and find on the NI web site, and are not ActiveX methods that are available in an ActiveX Object that is installed when you install LV 8.20 PDS. 

Rolf, I don't know that you will get this email, but are you refering to the methods inside of the Interop.LabVIEW.dll in what you are saying above, and if so, how did you become aware of this .dll? 

Is anyone aware of any documentation for these ActiveX methods?

That Interop DLL is presumably a .Net wrapper around the LabVIEW Active X server class. You asked for an Active X server interface not a .Net interface. But I guess if you want to access it from C# you might need to go the .Net route.
I only used the Active X server from applications that could directly interface to Active X. Don't have and don't really want to deal with .Net.

Rolf Kalbermatter



Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 8 of 8
(4,543 Views)