Starting the MATLAB Server

If the MATLAB server is not running, start it:

  1. Start MATLAB.

  2. In the MATLAB Command Window, call the hdldaemon function with property name/property value pairs that specify whether the Link for ModelSim interface is to

    Use the following syntax:

    hdldaemon('PropertyName', PropertyValue...)
    

    The following table explains when and how to specify property name/property value pairs.

    If Your Application Is To...Do the Following...
    Operate in shared memory modeOmit the 'socket', tcp_spec property name/property value pair. The interface operates in shared memory mode by default. You should use shared memory mode if your application configuration consists of a single system and uses a single communication channel.
    Operate in TCP/IP socket mode, using a specific TCP/IP socket portSpecify the 'socket', tcp_spec property name and value pair. The tcp_spec can be a socket port number or service name. Examples of valid port specifications include '4449', 4449, and MATLAB Service. For information on choosing a TCP/IP socket port, see Choosing TCP/IP Socket Ports.
    Operate in TCP/IP socket mode, using a TCP/IP socket that the operating system identifies as availableSpecify 'socket', 0 or 'socket', '0'.
    Return time values in seconds (type double) Specify 'time', 'sec' or omit the parameter. This is the default time value resolution.
    Return 64-bit time values (type int64) Specify 'time', 'int64' .

The following function call starts the server in TCP/IP socket mode, using port number 4449, with a time resolution of seconds (the default).

hdldaemon('socket', 4449)

You also can start the server from a script. Consider the following function call sequence:

dstat = hdldaemon('socket', 0)
portnum = dstat.ipc_id

The first call to hdldaemon specifies that the server use TCP/IP communication with a port number that the operating system identifies and returns connection status information, including the assigned port number, to dstat. The statement on the second line assigns the socket port number to portnum for future reference.


Learn more about the latest releases of MathWorks products:

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS