extmodeInit - Initialize external mode target connectivity - MATLAB (original) (raw)
Main Content
Initialize external mode target connectivity
Syntax
Description
[errorCode](#d126e36431) = extmodeInit([extmodeInfo](#d126e36371), [finalTime](#d126e36397));
initializes the external mode target connectivity, including the underlying communication stack.
Use this function with other external mode functions to enable communication between Simulink® and the target application during an external mode simulation.
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, seeExternal Mode Abstraction Layer.
Input Arguments
Model structure that contains information for the external mode simulation. RTWExtModeInfo
is defined in_`matlabroot`_/simulink/include/[rtw_extmode.h](https://mdsite.deno.dev/matlab:edit%28fullfile%28matlabroot,'/simulink/include/rtw%5Fextmode.h'%29%29)
.
If the model’s final simulation time in the external mode abstraction layer is initialized, then finalTime
is an output and the pointer location is updated with the initialized value. You might initialize the final simulation time through the '-tf '
option detected by extmodeParseArgs()
orextmodeSetFinalSimulationTime()
If the model’s final simulation time in the external mode abstraction layer is not initialized, then finalTime
is an input and the model’s final simulation time in external mode is updated accordingly.
Output Arguments
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_ERROR
(-12) –– External mode generic error detected.
Version History
Introduced in R2018a