Configuration and Execution of Real-Time Application with C

Prepare and run real-time application

To run your real-time system in a repeatable manner, write programs with the C API. With these programs, load, configure, and execute the real-time application. You can:

  • Perform runs interactively or initiate automated runs and test sequences.

  • Tune parameters during, before, or after a run.

  • Acquire, view, and log signals on the development computer or target computer.


expand all

xPCInitAPIInitialize Simulink Real-Time DLL
xPCGetAPIVersionGet version number of Simulink Real-Time API
xPCFreeAPIUnload Simulink Real-Time DLL
xPCRegisterTargetRegister target with Simulink Real-Time API library
xPCDeRegisterTargetDelete target communication properties from Simulink Real-Time API library
xPCOpenConnectionOpen connection to target computer
xPCCloseConnectionClose TCP/IP communication connection
xPCOpenTcpIpPortOpen TCP/IP connection to Simulink Real-Time system
xPCClosePortClose TCP/IP communication connection
xPCReOpenPortReopen communication channel
xPCRebootRestart target computer
xPCTargetPingPing target computer
xPCGetTargetVersionGet Simulink Real-Time kernel version
xPCLoadAppLoad real-time application onto target computer
xPCUnloadAppUnload real-time application
xPCIsAppRunningReturn real-time application running status
xPCSetEchoTurn message display on or off
xPCGetEchoReturn display mode for target message window
xPCSetLoadTimeOutChange initialization timeout value between development and target computers
xPCGetLoadTimeOutReturn timeout value for communication between development and target computers
xPCGetAppNameReturn real-time application name
xPCStartAppStart real-time application
xPCStopAppStop real-time application
xPCSetSampleTimeChange real-time application sample time
xPCGetSampleTimeReturn real-time application sample time
xPCSetStopTimeChange real-time application stop time
xPCGetStopTimeReturn stop time
xPCAverageTETReturn average task execution time
xPCGetExecTimeReturn real-time application execution time
xPCGetSessionTimeReturn length of time Simulink Real-Time kernel has been running
xPCIsAppRunningReturn real-time application running status
xPCIsOverloadedReturn target computer overload status
xPCMaximumTETCopy maximum task execution time to array
xPCMinimumTETCopy minimum task execution time to array
xPCSaveParamSetSave parameter values of real-time application
xPCLoadParamSetRestore parameter values
xPCErrorMsgReturn text description for error message
xPCGetLastErrorReturn constant of last error
xPCSetLastErrorSet last error to specific character string constant


Simulink Real-Time C API

Complying with the coding requirements of the Simulink® Real-Time™ C API library.

Using the C API

Complying with the requirements for using the Simulink Real-Time C API.

C API Error Messages

Interpreting error codes produced by the C API.