External Interfaces/API    

Additional ActiveX Server Information

Launching the MATLAB ActiveX Server

For MATLAB to act as an automation server, it must be started with the /Automation command line argument. Microsoft Windows does this automatically when an ActiveX connection is established by a controller. However, if MATLAB is already running and was launched without this parameter, any request by an automation controller to connect to MATLAB as a server will cause Windows to launch another instance of MATLAB with the /Automation parameter. This protects controllers from interfering with any interactive MATLAB sessions that may be running.

Specifying a Shared or Dedicated Server

You can launch the MATLAB Automation server in one of two modes -- shared or dedicated. A dedicated server is dedicated to a single client; a shared server is shared by multiple clients.

The mode is determined by the Program ID (ProgID) used by the client to launch MATLAB. The ProgID, Matlab.Application, (or the version-specific ProgID, Matlab.Application.5) specifies the default mode, which is shared. To specify a dedicated server, use the ProgID, Matlab.Application.Single, (or the version-specific ProgID, Matlab.Application.Single.5). The term Single refers to the number of clients that may connect to this server.

Once MATLAB is launched as a shared server, all clients that request a connection to MATLAB by using the shared server ProgID will connect to the already running instance of MATLAB. In other words, there is never more than one instance of a shared server running, since it is shared by all clients that use the ProgID that specifies a shared server.

Each client that requests a connection to MATLAB using a dedicated ProgID will cause a separate instance of MATLAB to be launched, and that server will not be shared with any other client. Therefore, there can be several instances of a dedicated server running simultaneously, since the dedicated server is not shared by multiple clients.


 MATLAB ActiveX Automation Methods Using MATLAB As a DCOM Server