how to include COM API in m scripts?

4 次查看(过去 30 天)
Hello,
I am trying to automate dSPACE Configuration desk. I need to find the way to include the dSPACE COM API into m scripts. your support is greatly appreciated.Thank you

回答(1 个)

Madheswaran
Madheswaran 2025-2-23
Hi Ghamdan,
You can use 'actxserver' to creates a local OLE Automation server, where 'progid' is the programmatic identifier (ProgID) of an OLE-compliant COM server, for your case it is 'dSPACE Configuration Desk'. The function returns a handle to the default interface of the server. Make sure MATLAB and dSPACE Configuration Desk are installed, and dSPACE Configuration Desk provides OLE Compliant COM interface.
Here's a simple example of how to create and release a COM server connection:
configdesk = actxserver('progid'); %Replace 'progid' with Program ID for dSPACE Configuration Desk
% ... Your automation tasks go here ...
delete(configdesk); % When done, release the COM server
To find the list of COM Server Program ID of all programs that provides COM interface and installed in your computer, refer to this answer: https://mathworks.com/matlabcentral/answers/126654-how-to-know-the-com-server-program-id-of-various-applications-to-use-in-matlab
For detailed information about the API methods and properties available to interact with dSPACE Configuration Desk through COM automation, please refer to the dSPACE Configuration Desk documentation.
For more information on how to use the COM Interfaces with MATLAB, refer to the following documentations:
  1. https://mathworks.com/help/matlab/using-com-objects-in-matlab.html
  2. https://mathworks.com/help/matlab/ref/com.html
Hope this helps!

类别

Help CenterFile 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!

Translated by