extmodeEvent
External mode event trigger
Description
informs the external mode abstraction layer of the occurrence of an event.errorCode
= extmodeEvent(eventId
, simulationTime
)
eventId
is the sample time ID of the model, for example, 0
for base rate, 1 for first subrate, and so on.
The function:
Samples all signals associated with a given sample time.
Stores signal values in a new packet buffer.
Passes the packet buffer to the underlying transport layer for subsequent transmission to the development computer.
Use this function with other external mode functions to enable communication between Simulink® and the target application during an external mode simulation.
For correct sampling of signal values, run the
function immediately after
for the corresponding
sample time ID. You can invoke the function with different sample time IDs in
separate threads because the function is
thread-safe.model
_step()
The extmodeBackgroundRun
function performs the transmission of signal
values to the development computer.
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
Output Arguments
Version History
Introduced in R2018a