Documentation

Simulink Real-Time C/C++ API

Alphabetical List By Category

Standalone Operation

Control and Instrumentation with C

Configuration and Execution of Real-Time Application with C

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

Signal Monitoring and Tracing with C

xPCGetNumSignalsReturn number of signals
xPCGetSigIdxfromLabelReturn array of signal indices
xPCGetSigLabelWidthReturn number of elements in signal
xPCGetSignalReturn value of signal
xPCGetSignalIdxReturn index for signal
xPCGetSignalNameCopy name of signal to character array
xPCGetSignalsReturn vector of signal values
xPCGetSignalWidthReturn width of signal
xPCAddScopeCreate scope
xPCSetScopeSet properties of scope
xPCRemScopeRemove scope
xPCGetNumScopesReturn number of scopes added to real-time application
xPCGetScopeGet and copy scope data to structure
xPCGetScopeListGet and copy list of scope numbers
xPCGetScopesGet and copy list of scope numbers
xPCScAddSignalAdd signal to scope
xPCScRemSignalRemove signal from scope
xPCScGetNumSignalsGet number of signals in scope
xPCScGetSignalListCopy list of signals to array
xPCScGetSignalsCopy list of signals to array
xPCScGetTypeGet type of scope
xPCScSetAutoRestartScope autorestart status
xPCScGetAutoRestartScope autorestart status
xPCScSetDecimationSet decimation of scope
xPCScGetDecimationReturn decimation of scope
xPCScSetNumPrePostSamplesSet number of pre- or posttriggering samples before triggering scope
xPCScGetNumPrePostSamplesGet number of pre- or post-triggering samples before triggering scope
xPCScSetNumSamplesSet number of samples in one data acquisition cycle
xPCScGetNumSamplesGet number of samples in one data acquisition cycle
xPCScGetStartTimeGet start time for last data acquisition cycle
xPCScSetTriggerLevelSet trigger level for scope
xPCScGetTriggerLevelGet trigger level for scope
xPCScSetTriggerModeSet trigger mode of scope
xPCScGetTriggerModeGet trigger mode for scope
xPCScSetTriggerScopeSelect scope for triggering another scope
xPCScGetTriggerScopeGet trigger scope
xPCScSetTriggerScopeSampleSet sample number for triggering scope
xPCScGetTriggerScopeSampleGet sample number for triggering scope
xPCScSetTriggerSignalSelect signal for triggering scope
xPCScGetTriggerSignalGet trigger signal for scope
xPCScSetTriggerSlopeSet slope of signal that triggers scope
xPCScGetTriggerSlopeGet trigger slope for scope
xPCScSoftwareTriggerSet software trigger of scope
xPCScStartStart data acquisition for scope
xPCScStopStop data acquisition for scope
xPCIsScFinishedReturn data acquisition status for scope
xPCScGetDataCopy scope data to array
xPCScGetStateGet state of scope
xPCTgScGetGridGet status of grid line for particular scope
xPCTgScGetModeGet scope mode for displaying signals
xPCTgScGetViewModeGet view mode for target computer display
xPCTgScGetYLimitsCopy y-axis limits for scope to array
xPCTgScSetGridSet grid mode for scope
xPCTgScSetModeSet display mode for scope
xPCTgScSetViewModeSet view mode for scope
xPCTgScSetYLimitsSet y-axis limits for scope
xPCErrorMsgReturn text description for error message
xPCGetLastErrorReturn constant of last error
xPCSetLastErrorSet last error to specific character string constant
scopedataType definition for scope data structure

Signal Logging with C

xPCAddScopeCreate scope
xPCSetScopeSet properties of scope
xPCRemScopeRemove scope
xPCGetNumScopesReturn number of scopes added to real-time application
xPCGetScopeGet and copy scope data to structure
xPCGetScopeListGet and copy list of scope numbers
xPCGetScopesGet and copy list of scope numbers
xPCScAddSignalAdd signal to scope
xPCScRemSignalRemove signal from scope
xPCScGetNumSignalsGet number of signals in scope
xPCScGetSignalListCopy list of signals to array
xPCScGetSignalsCopy list of signals to array
xPCGetNumSignalsReturn number of signals
xPCGetSigIdxfromLabelReturn array of signal indices
xPCGetSigLabelWidthReturn number of elements in signal
xPCGetSignalReturn value of signal
xPCGetSignalIdxReturn index for signal
xPCGetSignalLabelCopy label of signal to character array
xPCGetSignalNameCopy name of signal to character array
xPCGetSignalsReturn vector of signal values
xPCGetSignalWidthReturn width of signal
xPCScGetTypeGet type of scope
xPCScSetAutoRestartScope autorestart status
xPCScGetAutoRestartScope autorestart status
xPCScSetDecimationSet decimation of scope
xPCScGetDecimationReturn decimation of scope
xPCScSetNumPrePostSamplesSet number of pre- or posttriggering samples before triggering scope
xPCScGetNumPrePostSamplesGet number of pre- or post-triggering samples before triggering scope
xPCScSetNumSamplesSet number of samples in one data acquisition cycle
xPCScGetNumSamplesGet number of samples in one data acquisition cycle
xPCScGetStartTimeGet start time for last data acquisition cycle
xPCGetNumOutputsReturn number of outputs
xPCGetNumStatesReturn number of states
xPCGetLogModeReturn logging mode and increment value for real-time application
xPCGetOutputLogCopy output log data to array
xPCGetStateLogCopy state log values to array
xPCGetTETLogCopy TET log to array
xPCGetTimeLogCopy time log to array
xPCMaxLogSamplesReturn maximum number of samples that can be in log buffer
xPCNumLogSamplesReturn number of samples in log buffer
xPCNumLogWrapsReturn number of times log buffer wraps
xPCSetLogModeSet logging mode and increment value of scope
xPCScSetTriggerLevelSet trigger level for scope
xPCScGetTriggerLevelGet trigger level for scope
xPCScSetTriggerModeSet trigger mode of scope
xPCScGetTriggerModeGet trigger mode for scope
xPCScSetTriggerScopeSelect scope for triggering another scope
xPCScGetTriggerScopeGet trigger scope
xPCScSetTriggerScopeSampleSet sample number for triggering scope
xPCScGetTriggerScopeSampleGet sample number for triggering scope
xPCScSetTriggerSignalSelect signal for triggering scope
xPCScGetTriggerSignalGet trigger signal for scope
xPCScSetTriggerSlopeSet slope of signal that triggers scope
xPCScGetTriggerSlopeGet trigger slope for scope
xPCScSoftwareTriggerSet software trigger of scope
xPCScStartStart data acquisition for scope
xPCScStopStop data acquisition for scope
xPCIsScFinishedReturn data acquisition status for scope
xPCScGetDataCopy scope data to array
xPCScGetStateGet state of scope
xPCFSCDChange current folder on target computer to specified path
xPCFSDirGet contents of specified folder on target computer
xPCFSDirItemsGet contents of specified folder on target computer
xPCFSGetErrorGet text description for error number on target computer file system
xPCFSGetPWDGet current folder of target computer
xPCFSMKDIRCreate folder on target computer
xPCFSRMDIRRemove folder from target computer
xPCFSDirSizeReturn size of specified folder listing on target computer
xPCFSDirStructSizeGet number of items in folder
xPCFSDiskInfoInformation about target computer file system
xPCFSOpenFileOpen file on target computer
xPCFSCloseFileClose file on target computer
xPCFSWriteFileWrite to file on target computer
xPCFSReadFileRead open file on target computer
xPCFSRemoveFileRemove file from target computer
xPCFSFileInfoReturn information for open file on target computer
xPCFSGetFileSizeReturn size of file on target computer
xPCFSScGetFilenameGet name of file for scope
xPCFSScGetWriteModeGet write mode of file for scope
xPCFSScGetWriteSizeGet block write size of data chunks
xPCFSScSetFilenameSpecify name for file to contain signal data
xPCFSScSetWriteModeSpecify when file allocation table entry is updated
xPCFSScSetWriteSizeSpecify that memory buffer collect data in multiples of write size
xPCErrorMsgReturn text description for error message
xPCGetLastErrorReturn constant of last error
xPCSetLastErrorSet last error to specific character string constant
scopedataType definition for scope data structure
lgmodeType definition for logging options structure
dirStructType definition for file system folder information structure
diskinfoType definition for file system disk information structure
fileinfoType definition for file information structure

Parameter Tuning with C

xPCGetNumParamsReturn number of tunable parameters
xPCGetParamDimsGet row and column dimensions of parameter
xPCGetParamIdxReturn parameter index
xPCGetParamNameGet name of parameter
xPCSetParamChange value of parameter
xPCGetParamGet parameter value and copy it to array
xPCLoadParamSetRestore parameter values
xPCSaveParamSetSave parameter values of real-time application
Was this topic helpful?