LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

AutomationOpen and Matlab

Solved!
Go to solution

Dear all,

 

I need to call Matlab from Labview using ActiveX

The "Matlab Script Node" (which use activeX) works, but i need more control 

over the connection, so I must use the AcitiveX Vis directly.

 

Problem: I always get the same error using AutomationOpen vi: 

 error -2147221164 : Class not registered in Matlab ActiveX Example.vi

 

I tried to unregister/register the matlab automation server (using /UnRegServer and  /RegServer).

As expected, the matlab server (MLApp.DIMLapp) actually disapear/reapear from the Labview "select activeX class"dialog

But at the end I still have the same error -2147221164

 

The strange thing is that the matlab script node works, meaning that ActiveX link is ok.

But AutomationOpen always fail...

 

note: I am using Labview  8.5.1 and Matlab 7.6.0.324 (R2008a)

 

0 Kudos
Message 1 of 7
(4,905 Views)

Did you ever thought about the Simulation Interface Toolkit ?

 

You can also try to register the Matlab dll with the command regsrv32 "C:\path_to_shared_lib\shared_lib.dll"

 

Christian

 

0 Kudos
Message 2 of 7
(4,902 Views)

Hi friends

 

I am Joseph from London newly visited this site. I amappreciate your thought.

 

Joseph

 

0 Kudos
Message 3 of 7
(4,899 Views)

Dear Christian

Thanks for your reply.

I am using Object oriented matlab code (not simulink), so I don't think that the Simulation Interface Toolkit could help me.

I tried to register Matlab using Matlab.exe /RegServer  : no improvement

I don't think I can use regsrv32 with matlab.

Anyway matlab bin directory contains more than 500 dll, and I have no idea which one must be registered....

 

 

cheers,

julien

 

0 Kudos
Message 4 of 7
(4,883 Views)
Solution
Accepted by topic author julien charton

AutomationOpen now works with Matlab !!

But I don't know why...

 

It may be related to a test I did in Visual basic:

  Dim Matlab As MLApp.MLApp
  Dim Result As String
  Matlab = New MLApp.MLApp
  Result = Matlab.Execute("myVariable=0" )

This test worked, and maybe it has somehow "repair" the ActiveX configuration for MLApp ...

Message Edited by julien charton on 02-25-2009 07:16 AM
0 Kudos
Message 5 of 7
(4,878 Views)

Hi ,I have seen you question and answers many times ,but i still dont know how the activex works......

i expect you can give me some suggrstions.

 

0 Kudos
Message 6 of 7
(4,448 Views)

Hi Julien,

 

I am having the exact same problem that you did a while back. How did you fix this issue? Which dll's did you register and how?

 

Thanks

CLA
0 Kudos
Message 7 of 7
(3,578 Views)