Wiki

This version is outdated by a newer approved version.DiffThis version (14 Dec 2020 10:16) was approved by Venkatesan Krishnamoorthy.The Previously approved version (26 Oct 2018 16:57) is available.Diff

This is an old revision of the document!


Click here to return to 'SigmaStudio Scripting' page.

SigmaStudio as a MATLAB® COM server

To use MATLAB as a SigmaStudio server client, both applications must be installed and running on the same machine.

In this configuration, MATLAB is a COM automation client and SigmaStudio (via SigmaStudioServer) becomes a COM automation server. For COM operation, the SigmaStudioServer must first be registered as a COM object.

Registering SigmaStudioServer as a COM object

Automatic COM object Registration

If you have installed SigmaStudio in its default directory (C:\Program Files\Analog Devices\SigmaStudio X.xx, where X.xx is the version), and your .NET framework is up to date, you may use the SigmaStudioServer Registration utility. Right-click here, and click “Save link as…,” then run the saved file as an administrator. You will need to enter the version of SigmaStudio (“3.17” for version 3.17, for example), as well as whether you're using 32- or 64-bit MATLAB.

SigmaStudio 3.16 and below

  1. Ensure that you have RegAsm.exe application available on your machine. It should be present in “C:\Windows\Microsoft.NET\Framework\v2.0.50727\”. If not installed, download and install the “.NET Framework 2.0 Software Development Kit (SDK)”, available from Microsoft.
  2. Open the command prompt (as administrator)
    • If using 32 bit MATLAB version, change the working directory to “C:\Windows\Microsoft.NET\Framework\v2.0.50727”
    • If using 64 bit MATLAB version, change the working directory to “C:\Windows\Microsoft.NET\Framework64\v2.0.50727”
  3. Execute the following command to register the assembly file: RegAsm “C:\Program Files\Analog Devices\SigmaStudio 3.xx\Analog.SigmaStudioServer.dll” /codebase

Note: here xx in 3.xx should be the current SigmaStudio version like 3.15.
You should get a “Type registered successfully” message after the assembly file has been registered.

SigmaStudio 3.17 onwards

  1. Ensure that you have RegAsm.exe application available on your machine. It should be present in “C:\Windows\Microsoft.NET\Framework\v4.0.30319”. If not installed, download and install the “.NET Framework 4.7 Software Development Kit (SDK)”, available from Microsoft.
  2. Open the command prompt (as administrator)
    • If using 32 bit MATLAB version, change the working directory to “C:\Windows\Microsoft.NET\Framework\v4.0.30319”
    • If using 64 bit MATLAB version, change the working directory to “C:\Windows\Microsoft.NET\Framework64\v4.0.30319”
  3. Execute the following command to register the assembly file: RegAsm “C:\Program Files\Analog Devices\SigmaStudio 3.xx\Analog.SigmaStudioServer.dll” /codebase

Note: here xx in 3.xx should be the current SigmaStudio version like 3.15.
You should get a “Type registered successfully” message after the assembly file has been registered.

Creating a SigmaStudioServer process in MATLAB

SigmaSetup.m
% SigmaSetup.m
% IMPORTANT: Launch the SigmaStudio application first!
 
% Add SigmaStudio installtion directory to path
path(path, 'C:\Program Files\Analog Devices\SigmaStudio 4.5');
 
% Intantiate SigmaStudio server and invoke the interface
ss = actxserver('Analog.SigmaStudioServer.SigmaStudioServer');
ss_server = ss.invoke('ISigmaStudioServer');
 
% Close the project
ss_server.CLOSE_PROJECT();
 
% Load sample project file
ss_server.OPEN_PROJECT( "C:\Users\SReddy2\Downloads\Matlab Test\MatLabTest.dspproj");
 
% Compile and download program to hardware
ss_server.COMPILE_PROJECT();
 
% Set the Gain Parameter
ss_server.PARAMETER_WRITE("IC 1",22, 8,24,2.0);


Launch SigmaStudio before running your client [Python or LabView/Matlab].


resources/tools-software/sigmastudio/usingsigmastudio/scripting/matlab.1606712737.txt.gz · Last modified: 30 Nov 2020 06:05 by Sanjeeva Reddy