Wait until specified event ID is obtained or time-out occurs


output = waitForHdlClient(TimeOut,EventID)


waitForHdlClient(TimeOut,EventID) waits for the expected HDL simulator event ID to arrive at the MATLAB® server (hdldaemon) before processing continues. If the expected event ID arrives before the number of seconds specified by the TimeOut parameter, the value returned by the HDL simulator is the HDL simulator process identification (PID). Otherwise, the returned value is –1.

waitForHdlClient(TimeOut) waits for EventID = 1 for TimeOut seconds.

waitForHdlClient waits for EventID = 1 for 60 seconds.

output = waitForHdlClient(TimeOut,EventID) returns the process identification (PID) in output. Although you are not required to provide an output variable, MATLAB returns an error if a time-out occurs and the output argument is not specified.

Input Arguments


Number of seconds to wait for a response from the HDL simulator


The HDL simulator event ID. EventID must be a positive number less than the maximum value of a 32-bit signed integer. The value should match the event ID sent by the notifyMatlabServer command in the HDL simulator.

EventID can be either a scalar or vector value. If EventID is a vector, the function return a value only if all elements of the vector have been collected or if a time-out occurs. The returned output value is the same size as the event ID, and each element of the output variable is the detected PID of the HDL simulator that sends the corresponding event ID element.

Output Arguments


Output variable for holding returned value from call to waitForHdlClient. Contains either the HDL simulator process identification (PID) or –1 if an error occurs.


Wait for event ID 2 for 120 seconds.

>> hdlpid = waitForHdlClient(120, 2);
Was this topic helpful?