Main Content

waitForHdlClient

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

Description

pID = waitForHdlClient(timeout,eventID) waits for the expected HDL simulator eventID to arrive at the MATLAB® server before processing continues. If the expected eventID arrives before the number of seconds specified by timeOut the value returned by the HDL simulator is the HDL simulator process ID (PID).

example

pID = waitForHdlClient(timeout) waits for eventID = 1 for timeOut seconds.

pID = waitForHdlClient waits for eventID = 1 for 60 seconds.

Examples

Wait Until Specified Event ID Is Obtained or Time-Out Occurs

Wait for event ID 2 for 120 seconds.

>> ID = waitForHdlClient(120,2);

Input Arguments

collapse all

Number of seconds to wait for a response from the HDL simulator, specified as a positive scalar.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Event ID expected at the MATLAB server, specified as a scalar or vector. eventID must be a positive number less than the maximum value of a 32-bit signed integer. The value must match the event ID sent by the notifyMatlabServer command in the HDL simulator.

When specified as a vector the function returns a value when all the elements of the vector have been collected or a time-out occurs. The returned output value is the same size as eventID, and each element of the output variable is the detected pID of the HDL simulator that corresponds to the event ID.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Output Arguments

collapse all

Process ID of the HDL simulator, returned as a scalar or a vector. If a time-out occurs, the pID is returned as -1. The output value depends on the value of eventID.

eventID

pID

scalar

The function returns a scalar representing the detected PID of the HDL simulator.

vector

The function returns a vector the same size as eventID. Each element in the output vector is the detected PID of the HDL simulator. The output is returned only if all elements of the vector are collected or if a time-out occurs.

Version History

Introduced in R2012b