Main Content

extmodeWaitForHostRequest

Wait for request from development computer to start or stop external mode simulation

Description

example

errorCode = extmodeWaitForHostRequest(timeoutInMicroseconds); waits for a start or stop request from the development computer and times out when the timeout value is reached.

Use this function with other external mode functions to enable communication between Simulink® and the target application during an external mode simulation. Use the function during initialization because the function is a blocking function.

Examples

Set Up External Mode Communication

For a pseudo-code example that shows how you can provide external mode communication by using the function with related functions, see External Mode Abstraction Layer.

Input Arguments

collapse all

Specifies the timeout value. If the value is set to EXTMODE_WAIT_FOREVER, the function waits indefinitely. If '-w' is not extracted by extmodeParseArgs(), the function has no effect.

Output Arguments

collapse all

Error code, returned as an extmodeErrorCode_T enumeration with one of these values:

  • EXTMODE_SUCCESS (0) –– No error detected.

  • EXTMODE_INV_ARG (-1) –– Arguments invalid.

  • EXTMODE_TIMEOUT_ERROR (-100) –– External mode timeout error detected.

Version History

Introduced in R2018a