COM Object needs to be initialized properly
Mostrar comentarios más antiguos
I am connecting to a COM object (Bode Analyzer 100 from Omicron). However, since I am making a GUI, I need to initialize these variables to be empty so that I can pass them from function to function. However when I do, matlab complains that they are not the right type of variable. What type is this?
These are the 3 commands I use:
automationInterface = actxserver('OmicronLab.VectorNetworkAnalysis.AutomationInterface')
bode = automationInterface.Connect();
OnePortMeasurement=bode.Impedance.CreateOnePortMeasurement;
Thanks, Sarah
6 comentarios
Geoff Hayes
el 29 de Ag. de 2018
Sarah - can you show the line (or lines) of code that are responsible for generating the error? Are you creating your GUI with GUIDE and so are updating the handles structure with these three variables? Please clarify.
ADragon
el 29 de Ag. de 2018
Hi Sarah, as Geoff mentions it would be helpful to know how the error is generated. By the way, the setappdata and getappdata functions are very handy in passing data among GUI windows. Also, unless you are using an older version of Matlab, the actxserver function will try to connect to a running instance of the called application (OmicronLab... in your case). So technically, you could define automationInterface in each one of your functions and not pass anything. AD
Sarah Crimi
el 29 de Ag. de 2018
Geoff Hayes
el 29 de Ag. de 2018
Sarah - do you have any code that explicitly closes the connection when you close the GUI (via the x button)? If not, then that could be what is missing and you will need to put some code that does this in the GUI close function.
sandeep singh
el 26 de Nov. de 2018
Hello
Even i am trying to connect, but i want to know whether it is connected using serial com port
Sarah Crimi
el 28 de En. de 2019
Respuestas (0)
Categorías
Más información sobre Use COM Objects in MATLAB en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!