Documentation

Simulink Real-Time C/C++ API

Alphabetical List By Category

Model Preparation

External Code Integration

Custom I/O Drivers

Custom Driver
xpcPCIDevice Type definition for PCI configuration space structure
xpcTime Type definition of time structure
xpcAllocPhysicalMemory Allocate physical memory
xpcBusyWait Wait for specified length of time in seconds
xpcFreePhysicalMemory Free physical memory
xpcGetElapsedTime Return time since system boot
xpcGetPCIDeviceInfo Return information for PCI device
xpcInpB Read 8-bit data from data register
xpcInpW Read 16-bit data from data register
xpcInpDW Read 32-bit data from data register
xpcIsModelInit Return real-time application load state
xpcOutpB Write 8-bit data to data register
xpcOutpW Write 16-bit data to data register
xpcOutpDW Write 32-bit data to data register
xpcReserveMemoryRegion Return virtual address that corresponds to physical address and mark region as readable/writable
xpcShowPCIDeviceInfo Display contents of PCIDevice structure
xpcSubtractTime Return difference between two times

Control and Instrumentation From Outside MATLAB

Control and Instrumentation Using C

Configuration and Execution of Real-Time Application Using C

xPCInitAPI Initialize Simulink Real-Time DLL
xPCGetAPIVersion Get version number of Simulink Real-Time API
xPCFreeAPI Unload Simulink Real-Time DLL
xPCRegisterTarget Register target with Simulink Real-Time API library
xPCDeRegisterTarget Delete target communication properties from Simulink Real-Time API library
xPCOpenConnection Open connection to target computer
xPCCloseConnection Close RS-232 or TCP/IP communication connection
xPCOpenSerialPort Open RS-232 connection to Simulink Real-Time system
xPCOpenTcpIpPort Open TCP/IP connection to Simulink Real-Time system
xPCClosePort Close RS-232 or TCP/IP communication connection
xPCReOpenPort Reopen communication channel
xPCReboot Reboot target computer
xPCTargetPing Ping target computer
xPCGetTargetVersion Get Simulink Real-Time kernel version
xPCLoadApp Load real-time application onto target computer
xPCUnloadApp Unload real-time application
xPCIsAppRunning Return real-time application running status
xPCSetEcho Turn message display on or off
xPCGetEcho Return display mode for target message window
xPCSetLoadTimeOut Change initialization timeout value between development and target computers
xPCGetLoadTimeOut Return timeout value for communication between development and target computers
xPCGetAppName Return real-time application name
xPCStartApp Start real-time application
xPCStopApp Stop real-time application
xPCSetSampleTime Change real-time application sample time
xPCGetSampleTime Return real-time application sample time
xPCSetStopTime Change real-time application stop time
xPCGetStopTime Return stop time
xPCAverageTET Return average task execution time
xPCGetExecTime Return real-time application execution time
xPCGetSessionTime Return length of time Simulink Real-Time kernel has been running
xPCIsAppRunning Return real-time application running status
xPCIsOverloaded Return target computer overload status
xPCMaximumTET Copy maximum task execution time to array
xPCMinimumTET Copy minimum task execution time to array
xPCSaveParamSet Save parameter values of real-time application
xPCLoadParamSet Restore parameter values
xPCErrorMsg Return text description for error message
xPCGetLastError Return constant of last error
xPCSetLastError Set last error to specific string constant

Signal Monitoring and Tracing Using C

xPCGetNumSignals Return number of signals
xPCGetSigIdxfromLabel Return array of signal indices
xPCGetSigLabelWidth Return number of elements in signal
xPCGetSignal Return value of signal
xPCGetSignalIdx Return index for signal
xPCGetSignalName Copy name of signal to character array
xPCGetSignals Return vector of signal values
xPCGetSignalWidth Return width of signal
xPCAddScope Create new scope
xPCSetScope Set properties of scope
xPCRemScope Remove scope
xPCGetNumScopes Return number of scopes added to real-time application
xPCGetScope Get and copy scope data to structure
xPCGetScopeList Get and copy list of scope numbers
xPCGetScopes Get and copy list of scope numbers
xPCScAddSignal Add signal to scope
xPCScRemSignal Remove signal from scope
xPCScGetNumSignals Get number of signals in scope
xPCScGetSignalList Copy list of signals to array
xPCScGetSignals Copy list of signals to array
xPCGetNumScSignals Returns number of signals added to specific scope
xPCScGetType Get type of scope
xPCScSetAutoRestart Scope autorestart status
xPCScGetAutoRestart Scope autorestart status
xPCScSetDecimation Set decimation of scope
xPCScGetDecimation Return decimation of scope
xPCScSetNumPrePostSamples Set number of pre- or posttriggering samples before triggering scope
xPCScGetNumPrePostSamples Get number of pre- or post-triggering samples before triggering scope
xPCScSetNumSamples Set number of samples in one data acquisition cycle
xPCScGetNumSamples Get number of samples in one data acquisition cycle
xPCScGetStartTime Get start time for last data acquisition cycle
xPCScSetTriggerLevel Set trigger level for scope
xPCScGetTriggerLevel Get trigger level for scope
xPCScSetTriggerMode Set trigger mode of scope
xPCScGetTriggerMode Get trigger mode for scope
xPCScSetTriggerScope Select scope to trigger another scope
xPCScGetTriggerScope Get trigger scope
xPCScSetTriggerScopeSample Set sample number for triggering scope
xPCScGetTriggerScopeSample Get sample number for triggering scope
xPCScSetTriggerSignal Select signal to trigger scope
xPCScGetTriggerSignal Get trigger signal for scope
xPCScSetTriggerSlope Set slope of signal that triggers scope
xPCScGetTriggerSlope Get trigger slope for scope
xPCScSoftwareTrigger Set software trigger of scope
xPCScStart Start data acquisition for scope
xPCScStop Stop data acquisition for scope
xPCIsScFinished Return data acquisition status for scope
xPCScGetData Copy scope data to array
xPCScGetState Get state of scope
xPCTgScGetGrid Get status of grid line for particular scope
xPCTgScGetMode Get scope mode for displaying signals
xPCTgScGetViewMode Get view mode for target computer display
xPCTgScGetYLimits Copy y-axis limits for scope to array
xPCTgScSetGrid Set grid mode for scope
xPCTgScSetMode Set display mode for scope
xPCTgScSetViewMode Set view mode for scope
xPCTgScSetYLimits Set y-axis limits for scope
xPCErrorMsg Return text description for error message
xPCGetLastError Return constant of last error
xPCSetLastError Set last error to specific string constant
scopedata Type definition for scope data structure

Signal Logging Using C

xPCAddScope Create new scope
xPCSetScope Set properties of scope
xPCRemScope Remove scope
xPCGetNumScopes Return number of scopes added to real-time application
xPCGetScope Get and copy scope data to structure
xPCGetScopeList Get and copy list of scope numbers
xPCGetScopes Get and copy list of scope numbers
xPCScAddSignal Add signal to scope
xPCScRemSignal Remove signal from scope
xPCScGetNumSignals Get number of signals in scope
xPCScGetSignalList Copy list of signals to array
xPCScGetSignals Copy list of signals to array
xPCGetNumScSignals Returns number of signals added to specific scope
xPCGetNumSignals Return number of signals
xPCGetSigIdxfromLabel Return array of signal indices
xPCGetSigLabelWidth Return number of elements in signal
xPCGetSignal Return value of signal
xPCGetSignalIdx Return index for signal
xPCGetSignalLabel Copy label of signal to character array
xPCGetSignalName Copy name of signal to character array
xPCGetSignals Return vector of signal values
xPCGetSignalWidth Return width of signal
xPCScGetType Get type of scope
xPCScSetAutoRestart Scope autorestart status
xPCScGetAutoRestart Scope autorestart status
xPCScSetDecimation Set decimation of scope
xPCScGetDecimation Return decimation of scope
xPCScSetNumPrePostSamples Set number of pre- or posttriggering samples before triggering scope
xPCScGetNumPrePostSamples Get number of pre- or post-triggering samples before triggering scope
xPCScSetNumSamples Set number of samples in one data acquisition cycle
xPCScGetNumSamples Get number of samples in one data acquisition cycle
xPCScGetStartTime Get start time for last data acquisition cycle
xPCGetNumOutputs Return number of outputs
xPCGetNumStates Return number of states
xPCGetLogMode Return logging mode and increment value for real-time application
xPCGetOutputLog Copy output log data to array
xPCGetStateLog Copy state log values to array
xPCGetTETLog Copy TET log to array
xPCGetTimeLog Copy time log to array
xPCMaxLogSamples Return maximum number of samples that can be in log buffer
xPCNumLogSamples Return number of samples in log buffer
xPCNumLogWraps Return number of times log buffer wraps
xPCSetLogMode Set logging mode and increment value of scope
xPCScSetTriggerLevel Set trigger level for scope
xPCScGetTriggerLevel Get trigger level for scope
xPCScSetTriggerMode Set trigger mode of scope
xPCScGetTriggerMode Get trigger mode for scope
xPCScSetTriggerScope Select scope to trigger another scope
xPCScGetTriggerScope Get trigger scope
xPCScSetTriggerScopeSample Set sample number for triggering scope
xPCScGetTriggerScopeSample Get sample number for triggering scope
xPCScSetTriggerSignal Select signal to trigger scope
xPCScGetTriggerSignal Get trigger signal for scope
xPCScSetTriggerSlope Set slope of signal that triggers scope
xPCScGetTriggerSlope Get trigger slope for scope
xPCScSoftwareTrigger Set software trigger of scope
xPCScStart Start data acquisition for scope
xPCScStop Stop data acquisition for scope
xPCIsScFinished Return data acquisition status for scope
xPCScGetData Copy scope data to array
xPCScGetState Get state of scope
xPCFSCD Change current folder on target computer to specified path
xPCFSDir Get contents of specified folder on target computer
xPCFSDirItems Get contents of specified folder on target computer
xPCFSGetError Get text description for error number on target computer file system
xPCFSGetPWD Get current folder of target computer
xPCFSMKDIR Create new folder on target computer
xPCFSRMDIR Remove folder from target computer
xPCFSDirSize Return size of specified folder listing on target computer
xPCFSDirStructSize Get number of items in folder
xPCFSDiskInfo Information about target computer file system
xPCFSOpenFile Open file on target computer
xPCFSCloseFile Close file on target computer
xPCFSWriteFile Write to file on target computer
xPCFSReadFile Read open file on target computer
xPCFSRemoveFile Remove file from target computer
xPCFSFileInfo Return information for open file on target computer
xPCFSGetFileSize Return size of file on target computer
xPCFSScGetFilename Get name of file for scope
xPCFSScGetWriteMode Get write mode of file for scope
xPCFSScGetWriteSize Get block write size of data chunks
xPCFSScSetFilename Specify name for file to contain signal data
xPCFSScSetWriteMode Specify when file allocation table entry is updated
xPCFSScSetWriteSize Specify that memory buffer collect data in multiples of write size
xPCErrorMsg Return text description for error message
xPCGetLastError Return constant of last error
xPCSetLastError Set last error to specific string constant
scopedata Type definition for scope data structure
lgmode Type definition for logging options structure
dirStruct Type definition for file system folder information structure
diskinfo Type definition for file system disk information structure
fileinfo Type definition for file information structure

Parameter Tuning Using C

xPCGetNumParams Return number of tunable parameters
xPCGetParamDims Get row and column dimensions of parameter
xPCGetParamIdx Return parameter index
xPCGetParamName Get name of parameter
xPCSetParam Change value of parameter
xPCGetParam Get parameter value and copy it to array
xPCLoadParamSet Restore parameter values
xPCSaveParamSet Save parameter values of real-time application
Was this topic helpful?