enableservice

www.kxcad.net Home > CAE Software Index > MATLAB Index >


Your Ad Here

Enable, disable, or report status of Automation server

Syntax

state = enableservice('AutomationServer',enable)
state = enableservice('AutomationServer')
enableservice('DDEServer',enable)

Description

state = enableservice('AutomationServer',enable) enables or disables the MATLAB Automation server.

If enable is logical 1 (true), enableservice converts an existing MATLAB session into an Automation server. If enable is logical 0 (false), enableservice disables the MATLAB Automation server.

state indicates the previous state of the Automation server. If state = 1, MATLAB was an Automation server. If state is logical 0 (false), MATLAB was not an Automation server.

state = enableservice('AutomationServer') returns the current state of the Automation server. If state is logical 1 (true), MATLAB is an Automation server.

enableservice('DDEServer',enable) enables the MATLAB DDE server. You cannot disable a DDE server once it has been enabled. Therefore, the only allowed value for enable is logical 1 (true).

Examples

Enable an Automation Server Example

Enable the Automation server in the current MATLAB session:

state = enableservice('AutomationServer',true);

Next, show the current state of the MATLAB session:

state = enableservice('AutomationServer')

MATLAB displays state = 1 (true), showing that MATLAB is an Automation server.

Finally, enable the Automation server and show the previous state by typing

state = enableservice('AutomationServer',true)

MATLAB displays state = 1 (true), showing that MATLAB previously was an Automation server.

Note the previous state may be the same as the current state. As seen in this case, state = 1 shows MATLAB was, and still is, an Automation server.

  


© 1984-2007 The MathWorks, Inc. Terms of Use Patents Trademarks Acknowledgments

Your Ad Here