Control NI multisim with COM from Matlab
12 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
Juan Serrano
2020 年 3 月 16 日
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
2020 年 6 月 14 日
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.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Use COM Objects in MATLAB についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!