Tags: activex, automation, developed, labview, object, programming, server, share, team, variant, visual
ActiveX Server Object. Automation Open.
In our team we have developed an ActiveX server Object. This COM Object was
developed with MS Visual C++. With LabVIEW, I like to share variant data (fo
r example:1D Float Array values as variant). With Matlab and MS Excel, its&
nbsp;no problem to use
the functions of the COM Object and to share data with it. With L
abVIEW there are some problems.
Here is a short description of what I have done:
1.) Copy the COM object to windows\system32 directory
2.) Registration of theCOM Object (regsvr32.exe comobject.dll)
3.) Start LabVIEW
4.) Create New VI and place ActiveX refnum control on the frontpanel.
5.) Choose ActiveX class (rightclick on the ActiveX refnum control, and choo
se the new registrated comobject.dll)
6.) On the diagram, I connect the ActiveX server object with the "automation
7.) Connect the ActiveX refnum of the automation open.vi with an invoke node
8.) Choose a method of the ActiveX Object. LabIEW now shows automatically al
l input and output functions of the choosed method.
To share strings with the COM objects is easy, but with variant data&nb
sp; we have some problems. Sometimes the Windows system crashes.
Did anybody has experiences with developed MS COMobjects (develope
d with MS Visual C++) and LabVIEW?
After we had developed the ActiveX server object, we used all methods and fu
nctions with Matlab and with MS-Excel without a problem. To use the sam
e methods with LabVIEW causes a lot of problems. Why? In all three
cases we used always varia
nt data types. Are the variant data types different between Excel, Matlab an
Leave a comment...
- 3 Comments
- Hi Mike,
thank you for your reply.
The reason for using variants is, that we like to use the COM Object as an u
niversal object, which is able to share data (vectors, enum, ...) with LabVI
EW, Matlab and Excel.
My collegue, who has developed the COM object, told me that the COM object c
ould not handle 2D arrays.
Did any guidelines exists? Guidelines for developing COM Objects w
hich can be used with LabVIEW? What kind of datatypes can be shared wit
h the COMobject and so forth ...?
Peter#1; Tue, 06 May 2008 17:56:00 GMT
- I am not aware of any guidelines as I have never been involved in developing
a COM object--just using them. Most variants that I recall interacting with
right off hand are scalar values--though there is one place where I pass an
ADO method a 1D array of v
ariants. Which might be solution for you, have the input be an array of vari
The place I would start is on MS's website, therir documentation of these so
rts of things can be very complete. For example, the ADO documentation is ex
I also seem to remember reading somewhere that MS was going to be phasing-ou
t variants in the future. Sorry, but I don't remember the details, or where
I read it.
Mike...#2; Tue, 06 May 2008 17:57:00 GMT
- Hi Mike,
I want to share a 1 D DBL Array (instead of a variant) with a CO
M Object. But it dont work. LabVIEW dont understand that the COM objects u
ses 1D Array. MS Excel is able to share 1D Arrays with the COMobject, but La
bVIEW not. Have you an
y idea, how to share 1D Arrays between a COM and LabVIEW?
Peter#3; Tue, 06 May 2008 17:58:00 GMT