pingHdlSim - Block cosimulation until HDL simulator is ready

Syntax

pingHdlSim(timeout)
pingHdlSim(timeout, 'portnumber')
pingHdlSim(timeout, 'portnumber', 'hostname')

Description

pingHdlSim(timeout) blocks cosimulation by not returning until the Simulink server is loaded or until the specified timeout occurs. pingHdlSim returns the process ID of the HDL simulator or -1 if a timeout occurs. You must enter a timeout value.

This function is useful if you are trying to automate a cosimulation and you need to know that the Simulink server has loaded before your script continues the simulation.

pingHdlSim(timeout, 'portnumber') tries to connect to the local host on port portnumber, and times out after timeout seconds you specify.

pingHdlSim(timeout, 'portnumber', 'hostname') tries to connect to the host hostname on port portname. It times out after timeout seconds you specify.

Examples

The following function call blocks further cosimulation until the Simulink server is loaded or until 30 seconds have passed:

pingHdlSim(30)

If the server loads within 30 seconds, pingHdlSim returns the process ID. If it does not, pingHdlSim returns -1.

The following function call blocks further cosimulation on port 5678 until the Simulink server is loaded or until 20 seconds have passed:

pingHdlSim(20, '5678')

The following function call blocks further cosimulation on port 5678 on hostname msuser until the Simulink server is loaded or until 20 seconds have passed:

pingHdlSim(20, '5678', 'msuser')
  


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