Gustavo Fernandes Posted December 19, 2007 Report Share Posted December 19, 2007 I am new to using external code. I'm trying to use some matlab code inside labview (without using mathscript). Downloaded several examples that use activex. Somehow "automation Open" returns: "Error 3005 occurred at Automation Open: Object specified is not creatable in FF_Run_Matlab_Script.vi" Code: http://forums.lavag.org/MathScript-Matlab-...view-t8875.html No guess about what is happenning. WinXP SP2 Labview 8.20 Norton internet security Matlab 2007b Thank you very much in advance. Quote Link to comment
Tomi Maila Posted December 19, 2007 Report Share Posted December 19, 2007 I've not coded our own Matlab tools by myself. However I checked how do we open ActiveX automation and it seems that for Automation Refnum input of Automation Open node we use constant to automation class MLApp.DIMLApp. Is this the same class you are trying to open an automation refnum for? Tomi Quote Link to comment
Aitor Solar Posted December 19, 2007 Report Share Posted December 19, 2007 What Tomi said, maybe you're using a non-creatable object. You can also generate your own COM object from Matlab to encapsulate the methods you want to use from LabVIEW. Saludos, Aitor Quote Link to comment
Gustavo Fernandes Posted December 19, 2007 Author Report Share Posted December 19, 2007 QUOTE(Tomi Maila @ Dec 18 2007, 01:56 PM) I've not coded our own Matlab tools by myself. However I checked how do we open ActiveX automation and it seems that for Automation Refnum input of Automation Open node we use constant to automation class MLApp.DIMLApp. Is this the same class you are trying to open an automation refnum for? Yes it is the same. My intial guess was that Norton was blocking it.QUOTE(Aitor Solar @ Dec 18 2007, 02:51 PM) What Tomi said, maybe you're using a non-creatable object. You can also generate your own COM object from Matlab to encapsulate the methods you want to use from LabVIEW. I have not enough knowledge to do that. I'll look around trying to find an example. I'll be happy if someone can point me a good example or tutorial. TiA. Quote Link to comment
Aitor Solar Posted December 20, 2007 Report Share Posted December 20, 2007 QUOTE(Gustavo Fernandes @ Dec 18 2007, 04:30 PM) I have not enough knowledge to do that. I'll look around trying to find an example. I'll be happy if someone can point me a good example or tutorial. TiA. Search for "COM Builder" in the MathWorks site, there are a lot of examples, and for modern versions look into the .NET Builder: http://www.mathworks.com/products/netbuilder/ Saludos, Aitor Quote Link to comment
Gary Rubin Posted December 20, 2007 Report Share Posted December 20, 2007 QUOTE(Gustavo Fernandes @ Dec 18 2007, 08:10 AM) I am new to using external code. I'm trying to use some matlab code inside labview (without using mathscript). Does the Matlab Script structure still exist in LV8.20? Why not use this? Quote Link to comment
James N Posted December 20, 2007 Report Share Posted December 20, 2007 You probably need to update the link to the Matlab ActiveX class. I get the same error message but I don't have Matlab installed on my office PC. Right click on the object and browse around until you find something that looks right.. and then works. It should show up in the pull down menu. -James Quote Link to comment
Gustavo Fernandes Posted December 20, 2007 Author Report Share Posted December 20, 2007 QUOTE(Aitor Solar @ Dec 19 2007, 08:21 AM) Search for "COM Builder" in the MathWorks site, there are a lot of examples, and for modern versions look into the .NET Builder: http://www.mathworks.com/products/netbuilder/ Hi Aitor, looks like the way to go. Time to learn how things works.QUOTE(Gary Rubin @ Dec 19 2007, 01:35 PM) Does the Matlab Script structure still exist in LV8.20? Why not use this? Gary, Thank you very much for your reply. Done that but somehow I'm having dificulties integrating it with my project. It works well in the small project but not in the big one, looks like labview take a large amount of time processing mathscipt before running, or something else I'm missing. Also the code has many variables and parameters. I would prefer to do it keeping the matlab code I wrote before and integrating it in labview (dll, activex, etc).QUOTE(James N @ Dec 19 2007, 02:38 PM) You probably need to update the link to the Matlab ActiveX class. I get the same error message but I don't have Matlab installed on my office PC. Right click on the object and browse around until you find something that looks right.. and then works. It should show up in the pull down menu. James, thank you. Already done that. I must be doing something wrong. I used activex before with excel and everything worked well. I would love to find what's wrong. Quote Link to comment
Gary Rubin Posted December 20, 2007 Report Share Posted December 20, 2007 QUOTE(Gustavo Fernandes @ Dec 19 2007, 01:25 PM) It works well in the small project but not in the big one, looks like labview take a large amount of time processing mathscipt before running, or something else I'm missing. Also the code has many variables and parameters. I would prefer to do it keeping the matlab code I wrote before and integrating it in labview (dll, activex, etc). I don't know if this still holds true for Labview 8x, but in Labview 7.1, there's something called a Matlab Script (under the Analyze > mathematics> formula) tools palette. This is different from Mathscript. Mathscript, as I understand it, has Labview compiling and executing M code (or at least a subset of it). The Matlab Script launches an instance of matlab, much as I would assume you're trying to do with activex. Quote Link to comment
Gustavo Fernandes Posted January 4, 2008 Author Report Share Posted January 4, 2008 QUOTE(Gary Rubin @ Dec 19 2007, 07:06 PM) I don't know if this still holds true for Labview 8x, but in Labview 7.1, there's something called a Matlab Script (under the Analyze > mathematics> formula) tools palette.This is different from Mathscript. Mathscript, as I understand it, has Labview compiling and executing M code (or at least a subset of it). The Matlab Script launches an instance of matlab, much as I would assume you're trying to do with activex. I was in hollidays. I wish everyone an happy new year 2008. Gary, thank you very much for your reply. I tried Mathscript but it is not what I'm looking for. I cannot copy paste my matlab code there. Too much work. I'll try to call for NI help. I hope I can find a solution. Quote Link to comment
Gary Rubin Posted January 4, 2008 Report Share Posted January 4, 2008 QUOTE(Gustavo Fernandes @ Jan 3 2008, 11:09 AM) I was in hollidays.I wish everyone an happy new year 2008. Gary, thank you very much for your reply. I tried Mathscript but it is not what I'm looking for. I cannot copy paste my matlab code there. Too much work. I'll try to call for NI help. I hope I can find a solution. Gustavo, Do you have this example? C:\Program Files\National Instruments\LabVIEW 7.1\examples\scriptnode\Fractal.llb\MATLAB Script - Fractal.vi Obviously yours won't be in a LabVIEW 7.1 directory, but the same example might be there in 8.5. If so, open this and run it. This is the structure that I'm talking about. I think you should be able to do anything here that you can do at the Matlab command prompt or in a script, including calling other functions. Try deleting the example matlab code and running 'bench', or calling your matlab code. I really think this is what you're looking for. I am able to paste Matlab code into that window and run it. Gary Quote Link to comment
Gustavo Fernandes Posted January 5, 2008 Author Report Share Posted January 5, 2008 QUOTE(Gary Rubin @ Jan 3 2008, 07:50 PM) Gustavo,Do you have this example? C:\Program Files\National Instruments\LabVIEW 7.1\examples\scriptnode\Fractal.llb\MATLAB Script - Fractal.vi Obviously yours won't be in a LabVIEW 7.1 directory, but the same example might be there in 8.5. If so, open this and run it. This is the structure that I'm talking about. I think you should be able to do anything here that you can do at the Matlab command prompt or in a script, including calling other functions. Try deleting the example matlab code and running 'bench', or calling your matlab code. I really think this is what you're looking for. I am able to paste Matlab code into that window and run it. Gary Thank you very much Gary. Yes it does work. With my particular code it works well if I run it alone. If I merge it with my big applicattion matlab takes a long time to save my application and to run it the first time. Besides I would prefer to run my matlab code, so I can change the matlab code and insert it into the application without compiling the code again. from NI "The error 3005 can occur if you have selected a non creatable object (not having the object, not having it registered...). If the error occurs in development computer try this steps: 1) On the front panel, open the Controls Palette and select Refnum»Automation Refnum. 2) Right-Click on the refnum and select ActiveX Class»Browse.... 3) Select Show Creatable Items only. 4) Select it." "How Do I Manually Register Type Libraries, ActiveX Controls, and ActiveX Servers? http://digital.ni.com/public.nsf/websearch...7A?OpenDocument " Somehow the object is creatable, I select it and got the error. I must be doing something very wrong. Looks like I have to learn more about activex. EDIT Looks like I must start matlab before running mathscript for the interaction to work. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.