API Function and Method Reference


C API FunctionsProgram with C API functions
COM API MethodsProgram with COM API methods

C API Functions

Logging, Scope, and File System StructuresData structures for data logging and scopes
Communications FunctionsCommunicate between host and target PCs
Target Application FunctionsManipulate target applications
Data Logging FunctionsLog data
Scope FunctionsManipulate scopes
File System FunctionsManipulate file systems
Target Scope FunctionsManipulate scopes of type target
Monitoring and Tuning FunctionsMonitor and tune parameters and signals
Miscellaneous FunctionsManipulate miscellaneous xPC Target components

Logging, Scope, and File System Structures

dirStructType definition for file system directory information structure
diskinfoType definition for file system disk information structure
lgmodeType definition for logging options structure
scopedataType definition for scope data structure

Communications Functions

xPCCloseConnectionClose RS-232 or TCP/IP communication connection
xPCClosePortClose RS-232 or TCP/IP communication connection
xPCDeRegisterTargetDelete target communication properties from xPC Target™ API library
xPCGetLoadTimeOutReturn timeout value for communication between host PC and target PC
xPCOpenConnectionOpen connection to target PC
xPCOpenSerialPortOpen RS-232 connection to xPC Target™ system
xPCOpenTcpIpPortOpen TCP/IP connection to xPC Target™ system
xPCRebootReboot target PC
xPCRegisterTargetRegister target with xPC Target™ API library
xPCReOpenPortReopen communication channel
xPCSetLoadTimeOutChange initialization timeout value between host PC and target PC
xPCTargetPingPing target PC

Target Application Functions

xPCAverageTETReturn average task execution time
xPCGetAPIVersionGet version number of xPC Target™ API
xPCGetAppNameReturn target application name
xPCGetExecTimeReturn target application execution time
xPCGetSampleTimeReturn target application sample time
xPCGetStopTimeReturn stop time
xPCGetTargetVersionGet xPC Target™ kernel version
xPCIsAppRunningReturn target application running status
xPCIsOverloadedReturn target PC overload status
xPCLoadAppLoad target application onto target PC
xPCLoadParamSetRestore parameter values
xPCMaximumTETCopy maximum task execution time to array
xPCMinimumTETCopy minimum task execution time to array
xPCSaveParamSetSave parameter values of target application
xPCSetSampleTimeChange target application sample time
xPCSetStopTimeChange target application stop time
xPCStartAppStart target application
xPCStopAppStop target application
xPCUnloadAppUnload target application

Data Logging Functions

xPCGetLogModeReturn logging mode and increment value for target application
xPCGetNumOutputsReturn number of outputs
xPCGetNumStatesReturn number of states
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

Scope Functions

xPCAddScopeCreate new scope
xPCGetScopeGet and copy scope data to structure
xPCGetScopesGet and copy list of scope numbers
xPCIsScFinishedReturn data acquisition status for scope
xPCRemScopeRemove scope
xPCScAddSignalAdd signal to scope
xPCScGetDataCopy scope data to array
xPCScGetDecimationReturn decimation of scope
xPCScGetNumPrePostSamplesGet number of pre- or posttriggering samples before triggering scope
xPCScGetNumSamplesGet number of samples in one data acquisition cycle
xPCScGetSignalsCopy list of signals to array
xPCScGetStartTimeGet start time for last data acquisition cycle
xPCScGetStateGet state of scope
xPCScGetTriggerLevelGet trigger level for scope
xPCScGetTriggerModeGet trigger mode for scope
xPCScGetTriggerScopeGet trigger scope
xPCScGetTriggerScopeSampleGet sample number for triggering scope
xPCScGetTriggerSignalGet trigger signal for scope
xPCScGetTriggerSlopeGet trigger slope for scope
xPCScGetTypeGet type of scope
xPCScRemSignalRemove signal from scope
xPCScSetDecimationSet decimation of scope
xPCScSetNumPrePostSamplesSet number of pre- or posttriggering samples before triggering scope
xPCScSetNumSamplesSet number of samples in one data acquisition cycle
xPCScSetTriggerLevelSet trigger level for scope
xPCScSetTriggerModeSet trigger mode of scope
xPCScSetTriggerScopeSelect scope to trigger another scope
xPCScSetTriggerScopeSampleSet sample number for triggering scope
xPCScSetTriggerSignalSelect signal to trigger scope
xPCScSetTriggerSlopeSet slope of signal that triggers scope
xPCScSoftwareTriggerSet software trigger of scope
xPCScStartStart data acquisition for scope
xPCScStopStop data acquisition for scope
xPCSetScopeSet properties of scope

File System Functions

xPCFSCDChange current directory on target PC to specified path
xPCFSCloseFileClose file on target PC
xPCFSDirGet contents of specified directory on target PC
xPCFSDirItemsGet contents of specified directory on target PC
xPCFSDirSizeReturn size of specified directory on target PC
xPCFSDirStructSizeGet number of items in directory
xPCFSDiskInfoInformation about target PC file system
xPCFSGetErrorGet text description for error number on target PC file system
xPCFSGetFileSizeReturn size of file on target PC
xPCFSGetPWDGet current directory of target PC
xPCFSOpenFileOpen file on target PC
xPCFSReadFileRead open file on target PC
xPCFSRemoveFileRemove file from target PC
xPCFSRMDIRRemove directory from target PC
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
xPCFSWriteFileWrite to file on target PC

Target Scope Functions

xPCTgScGetGridGet status of grid line for particular scope
xPCTgScGetModeGet scope mode for displaying signals
xPCTgScGetViewModeGet view mode for target PC 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

Monitoring and Tuning Functions

xPCGetNumParamsReturn number of tunable parameters
xPCGetNumSignalsReturn number of signals
xPCGetParamGet parameter value and copy it to array
xPCGetParamDimsGet row and column dimensions of parameter
xPCGetParamIdxReturn parameter index
xPCGetParamNameGet name of parameter
xPCGetSigIdxfromLabel Return 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
xPCSetParamChange value of parameter

Miscellaneous Functions

xPCErrorMsgReturn text description for error message
xPCFreeAPIUnload xPC Target™ DLL
xPCGetEchoReturn display mode for target message window
xPCGetLastErrorReturn constant of last error
xPCInitAPIInitialize xPC Target™ DLL
xPCSetEchoTurn message display on or off
xPCSetLastErrorSet last error to specific string constant

COM API Methods

Communication Objects (xPCProtocol)Work with COM API communication objects
Scope Objects (xPCScopes)Work with COM API scope objects
Target Objects (xPCTarget)Work with COM API Target objects
File System Objects (xPCFileSystem)Work with COM API file system objects

Communication Objects (xPCProtocol)

xPCProtocol.CloseClose RS-232 or TCP/IP communication connection
xPCProtocol.GetLoadTimeOutReturn current timeout value for target application initialization
xPCProtocol.GetxPCErrorMsgReturn error string
xPCProtocol.InitInitialize xPC Target™ API DLL
xPCProtocol.isxPCErrorReturn error status
xPCProtocol.PortContain communication channel index
xPCProtocol.RebootReboot target PC
xPCProtocol.RS232ConnectOpen RS-232 connection to target PC
xPCProtocol.SetLoadTimeOutChange initialization timeout value
xPCProtocol.TargetPingPing target PC
xPCProtocol.TcpIpConnectOpen TCP/IP connection to target PC
xPCProtocol.TermUnload xPC Target™ API DLL from memory

Scope Objects (xPCScopes)

xPCScopes.AddFileScopeCreate new scope of type file
xPCScopes.AddHostScopeCreate new scope of type host
xPCScopes.AddTargetScopeCreate new scope of type target
xPCScopes.GetScopesGet and copy list of scope numbers
xPCScopes.GetxPCErrorGet error string
xPCScopes.InitInitialize scope object to communicate with target PC
xPCScopes.IsScopeFinishedGet data acquisition status for scope
xPCScopes.isxPCErrorGet error status
xPCScopes.RemScopeRemove scope
xPCScopes.ScopeAddSignalAdd signal to scope
xPCScopes.ScopeGetDataCopy scope data to array
xPCScopes.ScopeGetDecimationGet decimation of scope
xPCScopes.ScopeGetNumPrePostSamplesGet number of pre- or posttriggering samples before triggering scope
xPCScopes.ScopeGetNumSamplesGet number of samples in one data acquisition cycle
xPCScopes.ScopeGetSignalsGet list of signals
xPCScopes.ScopeGetStartTimeGet last data acquisition cycle start time
xPCScopes.ScopeGetStateGet state of scope
xPCScopes.ScopeGetTriggerLevelGet trigger level for scope
xPCScopes.ScopeGetTriggerModeGet trigger mode for scope
xPCScopes.ScopeGetTriggerModeStrGet trigger mode as string
xPCScopes.ScopeGetTriggerSampleGet sample number for triggering scope
xPCScopes.ScopeGetTriggerSignalGet trigger signal for scope
xPCScopes.ScopeGetTriggerSlopeGet trigger slope for scope
xPCScopes.ScopeGetTriggerSlopeStrGet trigger slope as string
xPCScopes.ScopeGetTypeGet type of scope
xPCScopes.ScopeRemSignalRemove signal from scope
xPCScopes.ScopeSetDecimationSet decimation of scope
xPCScopes.ScopeSetNumPrePostSamplesSet number of pre- or posttriggering samples before triggering scope
xPCScopes.ScopeSetNumSamplesSet number of samples in one data acquisition cycle
xPCScopes.ScopeSetTriggerLevelSet trigger level for scope
xPCScopes.ScopeSetTriggerModeSet trigger mode of scope
xPCScopes.ScopeSetTriggerSampleSet sample number for triggering scope
xPCScopes.ScopeSetTriggerSignalSelect signal to trigger scope
xPCScopes.ScopeSetTriggerSlopeSet slope of signal that triggers scope
xPCScopes.ScopeSoftwareTriggerSet software trigger of scope
xPCScopes.ScopeStartStart data acquisition for scope
xPCScopes.ScopeStopStop data acquisition for scope
xPCScopes.TargetScopeGetGridGet status of grid line for particular scope
xPCScopes.TargetScopeGetModeGet scope mode for displaying signals
xPCScopes.TargetScopeGetModeStrGet scope mode string for displaying signals
xPCScopes.TargetScopeGetViewModeGet view mode for target PC display
xPCScopes.TargetScopeGetYLimitsGet y-axis limits for scope
xPCScopes.TargetScopeSetGridSet grid mode for scope
xPCScopes.TargetScopeSetModeSet display mode for scope
xPCScopes.TargetScopeSetViewModeSet view mode for scope
xPCScopes.TargetScopeSetYLimitsSet y-axis limits for scope

Target Objects (xPCTarget)

xPCTarget.AverageTETGet average task execution time
xPCTarget.GetAppNameGet target application name
xPCTarget.GetExecTimeGet execution time for target application
xPCTarget.GetNumOutputsGet number of outputs
xPCTarget.GetNumParamsGet number of tunable parameters
xPCTarget.GetNumSignalsGet number of signals
xPCTarget.GetNumStatesGet number of states
xPCTarget.GetOutputLogCopy output log data to array
xPCTarget.GetParamGet parameter values
xPCTarget.GetParamDimsGet row and column dimensions of parameter
xPCTarget.GetParamIdxGet parameter index
xPCTarget.GetParamNameGet parameter name
xPCTarget.GetSampleTimeGet sample time
xPCTarget.GetSignalGet signal value
xPCTarget.GetSignalidsfromLabelGet signal IDs from signal label
xPCTarget.GetSignalIdxGet signal index
xPCTarget.GetSignalLabelGet signal label
xPCTarget.GetSignalNameCopy signal name to character array
xPCTarget.GetSignalWidthGet width of signal
xPCTarget.GetStateLogGet state log
xPCTarget.GetStopTimeGet stop time
xPCTarget.GetTETLogGet TET log
xPCTarget.GetTimeLogGet time log
xPCTarget.GetxPCErrorGet error string
xPCTarget.InitInitialize target object to communicate with target PC
xPCTarget.IsAppRunningReturn running status for target application
xPCTarget.IsOverloadedReturn overload status for target PC
xPCTarget.isxPCErrorReturn error status
xPCTarget.LoadAppLoad target application onto target PC
xPCTarget.MaximumTETCopy maximum task execution time to array
xPCTarget.MaxLogSamplesReturn maximum number of samples that can be in log buffer
xPCTarget.MinimumTETCopy minimum task execution time to array
xPCTarget.NumLogSamplesReturn number of samples in log buffer
xPCTarget.NumLogWrapsReturn number of times log buffer wraps
xPCTarget.SetParamChange parameter value
xPCTarget.SetSampleTimeChange sample time for target application
xPCTarget.SetStopTimeChange stop time of target application
xPCTarget.StartAppStart target application
xPCTarget.StopAppStop target application
xPCTarget.UnLoadAppUnload target application

File System Objects (xPCFileSystem)

FSDirType definition for file system directory information structure
FSDiskInfoType definition for file system disk information structure
xPCFileSystem.CDChange current directory on target PC to specified path
xPCFileSystem.CloseFileClose file on target PC
xPCFileSystem.DirListReturn contents of target PC directory
xPCFileSystem.GetDiskInfoReturn disk information
xPCFileSystem.GetFileSizeReturn size of file on target PC
xPCFileSystem.InitInitialize file system object to communicate with target PC
xPCFileSystem.MKDIRCreate directory on target PC
xPCFileSystem.OpenFileOpen file on target PC
xPCFileSystem.PWDGet current directory of target PC
xPCFileSystem.ReadFileRead open file on target PC
xPCFileSystem.RemoveFileRemove file from target PC
xPCFileSystem.RMDIRRemove directory from target PC
xPCFileSystem.ScGetFileNameGet name of file for scope
xPCFileSystem.ScGetWriteModeGet write mode of file for scope
xPCFileSystem.ScGetWriteSizeGet block write size of data chunks
xPCFileSystem.ScSetFileNameSpecify file name to contain signal data
xPCFileSystem.ScSetWriteModeSpecify when file allocation table entry is updated
xPCFileSystem.ScSetWriteSizeSpecify that memory buffer collect data in multiples of write size
xPCFileSystem.WriteFileWrite to file on target PC
  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS