Control NI multisim with COM from Matlab
11 views (last 30 days)
Show older comments
I am working with NI multisim and have an issue with a few of the commands using a COM interface. I can get it to connect and run certain commands but I have not been able to change values via matlab. This part of the code seems to work:
% Open interface to multisim
msim = actxserver('MultisimInterface.MultisimApp');
%conect
msim.Connect;
%set circuit
Circuit = msim.OpenFile('filename.ms13');
%request inputs from multisim
inputs = Circuit.EnumInputs('SimulationIOAll');
I can successfully request the value of resistor R1 from the circuit using this command:
Circuit.RLCValue('R1')
But I cannot change the value of R1 from matlab. For reference, within VB I can change the resistor value with this command
Circuit.RLCValue("R1") = 2
in matlab when I try the same command I get the following response:
No public field RLCValue exists for class
Interface.NI_Circuit_Design_Suite_Multisim_13.0.IMultisimCircuit.
I think this is because it is trying set an equality in matlab whereas in VB it seems to be sending this command to multisim somehow.
Any help is appreciated. The helpfile for this command is here http://zone.ni.com/reference/en-XX/help/375482A-01/multisim/rlcvalue/#wp270431 and the helpfile for the API is here http://zone.ni.com/reference/en-XX/help/375482A-01/TOC275.htm
2 Comments
Juan Serrano
on 16 Mar 2020
Hi, what version of Matlab and MultiSim did you used? I've been tried to run the code:
% Open interface to multisim
msim = actxserver('MultisimInterface.MultisimApp');
But matlab show this error:
Error using feval
Server Creation Failed: Clase no registrada
Error in actxserver (line 86)
h=feval(['COM.' convertedProgID], 'server', machinename, interface);
Thank you!
Anvar V A
on 14 Jun 2020
After a long search I found the solution for connecting.
You need 32 bit Matlab software. Last 32 bit version of matlab is from 2015. so install 32 bit Matlab 2015 and then connect. It will work.
Answers (0)
See Also
Categories
Find more on Use COM Objects in MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!