Documentation Home Page ◇ RT-LAB Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.
C-API Reference v11x and up Functions Reference
The following functions are available to a user in order to interface their application to RT-LAB.
- 1 OpalAbortCompile
- 2 OpalAddExtraFile
- 3 OpalAddToSelection
- 4 OpalCloseMetaController
- 6 OpalCloseProject
- 7 OpalCommand
- 8 OpalConnect (deprecated)
- 9 OpalConnectByName (deprecated)
- 10 OpalCreateAlias
- 11 OpalCreatePackage
- 12 OpalDeleteConnHandle
- 13 OpalDisconnect (deprecated)
- 14 OpalDisplayInformation
- 15 OpalExecute
- 16 OpalExecuteConsole
- 17 OpalExecuteMatlabCmd
- 18 OpalFindObjectId
- 19 OpalFreeMemory
- 20 OpalGetAcqBlockLastVal
- 21 OpalGetAcqGroupSignals
- 22 OpalGetAcqGroupSyncSignals
- 23 OpalGetAcqSampleTime
- 24 OpalGetAcqTrigger
- 25 OpalGetAcquisitionControl
- 26 OpalGetActiveModels (deprecated)
- 27 OpalGetActiveProjects
- 28 OpalGetAliasDescription
- 29 OpalGetAttributes
- 30 OpalGetBlob
- 31 OpalGetBlobsControl
- 32 OpalGetChildren
- 33 OpalGetClockPeriodInfo
- 34 OpalGetConfigurationControl
- 35 OpalGetConnectionPointsForIO
- 36 OpalGetConnectionsDescription
- 37 OpalGetConnHandle
- 38 OpalGetControlSignals
- 39 OpalGetControlSignalsDescription
- 40 OpalGetCurrentModel
- 41 OpalGetDefaultAttributes
- 42 OpalGetExtraFiles
- 43 OpalGetInstalledMatlabReleases
- 44 OpalGetIOInterfaces
- 45 OpalGetIsolationLossOnTarget
- 46 OpalGetLastErrMsg
- 47 OpalGetModelState
- 48 OpalGetMonitoringControl
- 49 OpalGetNodeCpu
- 50 OpalGetNodeXHP
- 51 OpalGetNumAcqGroups
- 52 OpalGetNumSignalsForGroup2
- 53 OpalGetParameterControl
- 54 OpalGetParametersByName
- 55 OpalGetParametersDescription
- 56 OpalGetPauseTime
- 57 OpalGetPhysNodeList
- 58 OpalGetRtlabVersion
- 59 OpalGetRtlabLicenseExpirationDate
- 60 OpalGetSignalControl
- 61 OpalGetSignalsByName
- 62 OpalGetSignalsDescription
- 63 OpalGetStopTime
- 64 OpalGetSubsystemList
- 65 OpalGetSystemControl
- 66 OpalGetTargetFile
- 67 OpalGetTargetNodeSystemInfo
- 68 OpalGetTargetPlatform
- 69 OpalGetTimeInfo
- 70 OpalGetValueByAlias
- 71 OpalInstallRtlab
- 72 OpalInstallTarget
- 73 OpalIsOriginalModelOpen
- 74 OpalLoad
- 75 OpalLoadAliasDescription
- 76 OpalLoadAlias
- 77 OpalLoadConsole
- 78 OpalLoadOriginalModel
- 79 OpalLoadParameters
- 80 OpalLoadParametersDescription
- 81 OpalModelClean
- 82 OpalNewConnHandle
- 83 OpalNotificationGetPathName
- 84 OpalNotificationGetID
- 85 OpalNotificationGetValue
- 86 OpalOpenProject
- 87 OpalPause
- 88 OpalPauseConsole
- 89 OpalPing
- 90 OpalPutTargetFile
- 91 OpalRearmAsyncAcq
- 92 OpalRegisterDisplay
- 93 OpalReleaseFunctionControl
- 94 OpalRemoveAlias
- 95 OpalRemoveExtraFile
- 96 OpalRemoveFromSelection
- 97 OpalRenameAlias
- 98 OpalReset
- 99 OpalResetConsole
- 100 OpalResetOriginalModel
- 101 OpalRestoreAttributes
- 102 OpalSaveAlias
- 103 OpalSaveParameters
- 104 OpalSendBlob
- 105 OpalSendNotification
- 106 OpalSetAcqBlockLastVal
- 107 OpalSetAcqTrigger
- 108 OpalSetAcqWriteFile
- 109 OpalSetAttributes
- 110 OpalSetClockPeriodInfo
- 111 OpalSetConnHandle
- 112 OpalSetControlSignals
- 113 OpalSetCurrentModel
- 114 OpalSetDecimationFactor
- 115 OpalSetFillDecimation
- 116 OpalSetNodeCpu
- 117 OpalSetMatlabRelease
- 118 OpalSetNodeMapping
- 119 OpalSetNodeXHP
- 120 OpalSetNotificationCallback
- 121 OpalSetNotificationCallbackForModel
- 122 OpalSetNumberValues
- 123 OpalSetParameters
- 124 OpalSetParameters2
- 125 OpalSetParametersByName
- 126 OpalSetPauseTime
- 127 OpalSetSignalsByName
- 128 OpalSetSimulationMode
- 129 OpalSetStopTime
- 130 OpalSetTargetPlatform
- 131 OpalSetAsyncAcqOpts
- 132 OpalSetTimeFactor
- 133 OpalSetValueByAlias
- 134 OpalSingleStep
- 135 OpalSnapshot
- 136 OpalStartCompile2
- 137 OpalStartExecutable
- 138 OpalStartTargetPythonScript
- 139 OpalStopConsole
- 140 OpalStopExecutable
- 141 OpalTakeFunctionControl
- 142 OpalWaitExecutable
Library & Header, Throughout
OpalAbortCompile
Group | Model preparation |
|---|---|
Description | Stops the currently executing compilation. |
Required Control | System control |
Usage | int OpalAbortCompile(); |
Input | None |
Output | None |
Return value |
|
Examples | None |
Related items | OpalStartCompile2, OpalDisplayInformation |
OpalAddExtraFile
Group | Model Preparation |
|---|---|
Description | This function adds a file to the list of files to be transferred or retrieved during one of the following steps:
|
Required Control | Configuration control |
Usage | int OpalAddExtraFile (OP_EXTRA_FILE_TRANSFER_TIME transferTime, unsigned short logicalId,char *filePathName,OP_FILE_TRANSFER_MODE fileMode); |
Input |
|
Output | None |
Return value |
|
Examples | See example configuration. |
Related items | OpalGetExtraFiles, OpalRemoveExtraFile, OP_EXTRA_FILE_TRANSFER_TIME, OP_FILE_TRANSFER_MODE |
OpalAddToSelection
Group | Utilities |
|---|---|
Description | Given the object's reference ID, adds it to the selected items. |
Required Control | None |
Usage | int OpalAddToSelection(P_REF_ID *refId); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | None |
OpalCloseMetaController
Group | Utilities |
|---|---|
Description | Close the currently running MetaController. This function should be called only once all projects have been closed and all clients have disconnected from running simulations. After invoking this function, most API calls will not be operational until the MetaController executable is started again. |
Required Control | None |
Usage | int OpalCloseMetaController(); |
Input | None |
Output | None |
Return value |
|
Examples | None |
Related items | None |
OpalCloseProject
Group | Model Selection |
|---|---|
Description | Disconnects the API from the currently connected project and model. The model's state does not change as a result of this call. Any control granted to this client is revoked. |
Required Control | None |
Usage | void OpalCloseProject(void); |
Input | None |
Output | None |
Return value | None |
Examples | See example basic_example1. |
Related items | OpalGetActiveProjects, OpalConnect (deprecated), OpalConnectByName (deprecated), OpalSetCurrentModel, OpalOpenProject |
OpalCommand
Group | Generic |
|---|---|
Description | Run an RT-LAB command for a certain RT-Lab object. |
Required Control | Specific to each command, see OP_COMMAND. |
Usage | int OpalCommand (OP_REF_ID ownerId, OP_COMMAND command, int numAttributesIn,OP_ATTRIBUTE attributes[], void * attributeValues[], OP_REF_ID * outputId) |
Input |
|
Output | outputId The ID corresponding to the object directly affected by the command. If no other object than the parent is affected, the parent ID is returned. |
Return value |
|
Examples | None. |
Related items | OP_COMMAND, OP_ATTRIBUTE. |
OpalConnect (deprecated)
Group | Model selection |
|---|---|
Description | Connects the API to an active model. Subsequent API calls refer to this model. |
Required Control | None |
Usage | int OpalConnect(OP_API_INSTANCE_ID instId,unsigned short systemControl, short *modelState); |
Input |
|
Output |
|
Return value |
|
Examples | None |
Related items | OpalConnectByName (deprecated), OpalDisconnect (deprecated), OpalOpenProject, OpalCloseProject, OpalGetModelState |
OpalConnectByName (deprecated)
Group | Model Selection |
|---|---|
Description | Connects the API to an active model. Subsequent API calls refer to this model.
|
Required Control | None |
Usage | int OpalConnectByName (const char *modelName,const char *modelPath, unsigned short exactMatch, unsigned short systemControl,unsigned short returnOnAmbiguity, OP_API_INSTANCE_ID *pInstId, OP_MODEL_STATE*pModelState); |
Input |
|
Output |
|
Return value |
|
Examples | See the example basic_example1. |
Related items | OpalSetCurrentModel, OpalGetActiveProjects, OpalConnect (deprecated), OpalDisconnect (deprecated), OpalOpenProject, OpalCloseProject, OpalGetModelState |
OpalCreateAlias
Group | Model Interaction, Alias |
|---|---|
Description | Creates a new alias which is used as a reference to an absolute path of a parameter or signal. The alias is appended to the current list of aliases. The alias’s name is a no case-sensitive string that should be unique. It should not contains the following special character: an asterisk (*) and question mark (?). It consists of partitions and a name, or a name only. A partition is an organizational unit, or container, used to organize aliases into a hierarchical structure. Partitions and name of the alias are separated by slash (/) characters. The topmost partition in any partition is called the root partition. A partition that is below another partition is called a subpartition. A partition above a subpartition is called the parent partition. The root partition is a slash (/) characters. Below are examples of valid alias names:
When using alias’ API functions, many syntaxes is available to refer to one specific alias. For example, an alias called “/myPartition/myAlias” can be referenced with the following syntax:
Note that the last syntax is only available if no other partitions contain an alias with the name “myAlias”.With Matlab/Simulink, the absolute path of a parameter is the concatenation of the path of the block that contains the parameter and the name of the parameter. Below are examples of parameter’s paths of a SineWave block:
By analogy, with Matlab/Simulink, the absolute path of a signal is the concatenation of the path of the block that outputs the signal and the signal’s label. If the label is empty in the Simulink model, the port’s name that outputs the signal is used instead of the label. Below are examples of paths for a signal at the outport 1 of a SineWave block:
By analogy, with Matlab/Simulink, the absolute path of a signal is the concatenation of the path of the block that outputs the signal and the signal’s label. If the label is empty in the Simulink model, the port’s name that outputs the signal is used instead of the label. Below are examples of paths for a signal at the outport 1 of a SineWave block:
Note that any of the following kind of signals can be referenced: control signals, acquisition signals, and dynamic signals. |
Required Control |