how to include COM API in m scripts?

조회 수: 4 (최근 30일)
Ghamdan Kaid
Ghamdan Kaid 2020년 3월 25일
답변: Madheswaran 2025년 2월 23일
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