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.
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. See the OP_COMMAND enumeration for a complete list of available commands and their specific requirements. |
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. When trying to establish a connection with a model when there are multiple models that correspond to the specified ModelName and ModelPath, a window is displayed prompting you to choose a model. This may occur when:
exactMatch exactMatch modelName returnOnAmbiguity E2BIG |
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:
|
Required Control | System control |
Usage | int OpalCreateAlias(const char * aliasName,const char * referencePath); |
Input |
|
Output | None |
Return value |
|
Examples | |
Related items | OpalRemoveAlias, OpalLoadAlias, OpalSaveAlias, OpalGetValueByAlias, OpalSetValueByAlias. |
OpalCreatePackage
Group | Utilities |
---|---|
Description | Creates a package (zip) ready to be deployed on a target for executing the current model using API. The project must be first open (cf. OpalOpenProject) and loadable before calling this function. |
Required Control | System control (OP_FB_SYSTEM) |
Usage | int OpalCreatePackage(const char *packageName, const OP_TARGET_PLATFORM targetPlatform); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OpalOpenProject, OP_TARGET_PLATFORM |
OpalDeleteConnHandle
Group | Model selection |
---|---|
Description | The specified handle must have been obtained from OpalGetConnHandle or OpalNewConnHandle. The specified connection is deleted. If connected, it is disconnected before deleting. |
Required Control | None |
Usage | int OpalDeleteConnHandle(unsigned long handle); |
Input | handle of a connection |
Output | None |
Return value |
|
Examples | See multi_models |
Related items | OpalNewConnHandle, OpalGetConnHandle, OpalSetConnHandle |
OpalDisconnect (deprecated)
Group | Model Selection |
---|---|
Description | Disconnects the API from the currently connected 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 OpalDisconnect(void); |
Input | None |
Output | None |
Return value | None |
Examples | See example basic_example1. |
Related items | OpalGetActiveProjects, OpalConnect (deprecated), OpalConnectByName (deprecated), OpalSetCurrentModel, OpalOpenProject, OpalCloseProject |
OpalDisplayInformation
Group | Utilities |
---|---|
Description | Gets the compilation or execution messages as well as return the compilation or execution status. You must call OpalRegisterDisplay before calling this function to indicate to the controller to send messages to the client. |
Required Control | None |
Usage | int OpalDisplayInformation(char *results,unsigned short bufLen, int timeout,unsigned short *done, unsigned short *displayId); |
Input |
|
Output |
|
Return value |
|
Examples | See example compilation. |
Related items | OpalRegisterDisplay |
OpalExecute
Group | Model Execution |
---|---|
Description | Starts execution of the currently connected model. When in real-time mode, the execution rate is the model's sampling rate times the time factor. |
Required Control | System Control |
Usage | int OpalExecute(double timeFactor); |
Input |
|
Output | None |
Return value |
|
Examples | See example basic_example1. |
Related items | OpalPause, OpalGetSystemControl |
OpalExecuteConsole
Group | Model Interaction, Console |
---|---|
Description | Starts execution of the Simulink console subsystem associated with the current connected model. Before calling this function, the client must call OpalLoadConsole.
|
Required Control | None |
Usage | int OpalExecuteConsole(); |
Input | None |
Output | None |
Return value |
|
Examples | None |
Related items | OpalLoadConsole, OpalPauseConsole, OpalResetConsole, OpalStopConsole |
OpalExecuteMatlabCmd
Group | Utilities |
---|---|
Description | Sends a command to Matlab and returns Matlab's messages. If Matlab has not been started yet, the function starts Matlab before sending the command. |
Required Control | None |
Usage | int OpalExecuteMatlabCmd (char *cmd,char *result,unsigned short resultBufferLen); |
Input |
|
Output |
|
Return value |
|
Examples | See example matlab_analysis. |
Related items | None |
OpalFindObjectId
Group | Utilities |
---|---|
Description | Given the object's path and type, returns the Object ID. |
Required Control | None |
Usage | int OpalFindObjectId(OP_OBJECT_TYPE objectType, const char *path, OP_REF_ID *refId); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | None |
OpalFreeMemory
Group | Utilities |
---|---|
Description | Free memory allocated by a previous API call. |
Required Control | |
Usage | int OpalFreeMemory(void *pMemory); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | None |
OpalGetAcqBlockLastVal
Group | Model Configuration, Acquisition |
---|---|
Description | Get the current settings for the blocking / non-blocking, and associated last value flag, for signal acquisition. This information is used by the API acquisition functions, which have the option not to wait for data, needed by some console's lack of multiple thread support. These settings apply to the current model. These settings only apply to the command station from which this call is made. |
Required Control | None |
Usage | int OpalGetAcqBlockLastVal(short *blockOnGroupshort *lastValues); |
Input | None |
Output |
|
Return value |
|
Examples | None |
Related items | OpalSetAcqBlockLastVal |
OpalGetAcqGroupSignals
Group | Model Interaction, Signal Acquisition |
---|---|
Description | Returns the acquisition signals sent to the console subsystem while the model is running. The acquisition signals are the signals sent from the computation nodes to console subsystem in the same order that it was specified at the input of the OpComm block for the specified acquisition group.
|
Required Control | None |
Usage | int OpalGetAcqGroupSignals(unsigned short acqGroup,unsigned short allocatedSignals, unsigned int *numSignals, double values[],unsigned short *lastValues, double *timestep); |
Input |
|
Output |
|
Return value |
|
Examples | None |
Related items | None |
OpalGetAcqGroupSyncSignals
Group | Model Interaction, Signal Acquisition |
---|---|
Description | Returns the acquisition signals sent to the console subsystem while the model is running. The acquisition signals are the signals sent from the computation nodes to console subsystem in the same order that it was specified at the input of the OpComm block for the specified acquisition group. The outputs contain two arrays: acquisition signals + monitoring signals.
Threshold time between acquisition time and simulation time exceeds the threshold, the acquisition (console) will be updated to overtake the difference. The acqtimestep offers the user a way to change his console step size as in Simulink.
|
Required Control | None |
Usage | int OpalGetAcqGroupSyncSignals(unsigned short acqGroup,unsigned short allocatedSignals, unsigned int *numSignals, unsigned short synchronization, unsigned short interpolation, double threshold,double acqTimeStep, double *simSignals, double *monSignals,unsigned short *endFrame, double *simTimeStep); |
Input |
|
Output |
|
Return value |
|
Examples | See example acquisition1. |
Related items | None |
OpalGetAcqSampleTime
Group | Model Configuration, Acquisition |
---|---|
Description | Get the acquisition sample time for the specified group. The acquisition sample time is the interval between two values inside an acquisition frame. |
Required Control | None |
Usage | int OpalGetAcqSample Time(unsigned short acqGoup,double *sampleTime); |
Input |
|
Output |
|
Return value |
|
Examples | None |
Related items | None |
OpalGetAcqTrigger
Group | Model Configuration, Acquisition |
---|---|
Description | Get the dynamic acquisition trigger that will be used during the simulation. Data will be acquired only when a specific signal is triggered. |
Required Control | None |
Usage | int OpalGetAcqTrigger( unsigned short acqGroup,unsigned int *signalNameLength, const char *signalName,double *level,unsigned int *trigSignalNameLength, const char *trigSignalName,int *offset,OP_TRIGGER_CONDITION *condition, unsigned char *triggerEnabled, unsigned short *trigType); |
Input |
|
Output |
|
Return value |
|
Examples | None |
Related items | OpalSetAcqTrigger |
OpalGetAcquisitionControl
Group | Model Configuration, Acquisition |
---|---|
Description | Requests or releases the acquisition control of the currently connected model. Acquisition control enables the client API to control the model's acquisition parameters for a specific acquisition group. Only one client API at a time is granted acquisition control for a specific acquisition group. |
Required Control | None |
Usage | int OpalGetAcquisitionControl(unsigned short acqControl,unsigned short acqGroup); |
Input |
|
Output | None |
Return value |
|
Examples | See example dynamic_acq. |
Related items | None |
OpalGetActiveModels (deprecated)
Group | Model Selection |
---|---|
Description | Note: This function is for backward compatibility only. Please consider using OpalGetActiveProjects instead. Returns a list of active models (see Glossary). The returned names include the file extension (if any) of the original model file. |
Required Control | None |
Usage | int OpalGetActiveModels(unsigned sFindObjectIdhort allocatedModels,unsigned short *numModels, unsigned short allocatedNameLen, unsigned short *maxNameLen, unsigned short allocatedPathLen, unsigned short *maxPathLen, char *name[],char *path[], OP_API_INSTANCE_ID instId[]); |
Input |
|
Output |
|
Return value |
|
Examples | None |
Related items | OpalGetActiveProjects, OpalDisconnect, OpalSetCurrentModel, OpalConnectByName |
OpalGetActiveProjects
Group | Model Selection |
---|---|
Description | Returns a list of active projects. For each project, this function returns the full path of the configuration file, the name and the IP address of the machine that opened this project, the instance ID of the current project session, and the list of models belonging to this project. For each model, path, ID and state are returned.
|
Required Control | None |
Usage | int OpalGetActiveProjects(unsigned short allocatedProjects,unsigned short *numProjects, unsigned short allocatedModels, unsigned short *numModels,unsigned short allocatedProjectsPathLen, unsigned short *maxProjectPathLen, unsigned short allocatedModelPathLen, unsigned short *maxModelPathLen, unsigned short allocatedMachineNameLen, unsigned short *maxMachineNameLen, unsigned short allocatedIpLen,unsigned short *maxIpLen, char *projectPaths[], unsigned short instanceIDs[], char *machineNames[],char *controllerIPs[], char *modelPaths[],unsigned short numModelsPerProject[] unsigned short modelIDs[],unsigned short modelStates[]); |
Input |
|
Output |
|
Return value |
|
Examples | None |
Related items | OP_COMMAND(OpenProject),OP_COMMAND (CloseProject), OpalDisconnect, OpalSetCurrentModel, OpalConnectByName |
OpalGetAliasDescription
Group | Model Interaction, Alias |
---|---|
Description | Returns the set of information of aliases active for the current model. Specifying a pattern ensures that only matching alias information is returned. Wildcard characters (?,*) may be used in the pattern. Memory for output structure has been allocated by the RT-LAB API. User must free this memory with a call to OpalFreeMemory. |
Required Control | None |
Usage | int OpalGetAliasDescription(const char * aliasNamePattern,int * numberAlias, OP_ALIAS_INFO ** aliasInfo); |
Input |
|
Output |
|
Return value |
|
Examples | None |
Related items | OpalCreateAlias, OpalLoadAliasDescription, OP_ALIAS_INFO |
OpalGetAttributes
Group | Generic |
---|---|
Description | Get the values of some object attributes. See the OP_ATTRIBUTE enumeration for a complete list of available attributes. |
Required Control | None |
Usage | int OpalGetAttributes (int numAttributes, OP_REF ids[], OP_ATTRIBUTE attributes [], void ** attributeValues[]); |
Input |
|
Output |
|
Return value |
|
Examples | None |
Related items | OpalSetAttributes, OpalGetDefaultAttributes, OpalRestoreAttributes, OP_ATTRIBUTE. |
OpalGetBlob
Group | Model Interaction, Blobs |
---|---|
Description | Receives blobs from all registered target subsystems. Memory for output structures (blobs) is allocated by the RT-LAB API. User must free this memory with a call to OpalFreeMemory. |
Required Control | None |
Usage | int OpalGetBlob(const char *pszId,OP_GET_BLOBS **ppBlobs); |
Input | pszId ID (name) of the blob to request. |
Output |
|
Return value |
|
Examples | None |
Related items | OpalSendBlob, OP_GET_BLOBS |
OpalGetBlobsControl
Group | Model Interaction, Blobs |
---|---|
Description | Requests or releases the blobs control of the currently connected model. Blob control enables the client API to send blobs to the running model. Only one client API at a time is granted blobs control. |
Required Control | None |
Usage | int OpalGetBlobsControl(unsigned short blobsControl); |
Input |
|
Output | None |
Return value |
|
Examples | None. |
Related items | OpalGetBlob, OpalSendBlob |
OpalGetChildren
Group | Generic |
---|---|
Description | Get the reference IDs of an object’s children. |
Required Control | None |
Usage | int OpalGetChildren (OP_REF_ID ownerId, int * numChildren, OP_REF_ID * ids[]) |
Input |
|
Output |
|
Return value |
|
Examples | None |
Related items | OpalCommand, OP_OBJECT_TYPE. |
OpalGetClockPeriodInfo
Group | Utilities |
---|---|
Description | Returns the ClockPeriod related information associated with the current model. This function is only valid for QNX 6.x models (not supported anymore). |
Required Control | None |
Usage | int OpalGetClockPeriodInfo (OP_CLOCK_PERIOD_INFO * const pInfo); |
Input |
|
Output | None |
Return value |
|
Examples | None. |
Related items | OP_CLOCK_PERIOD_INFO, OpalSetClockPeriodInfo |
OpalGetConfigurationControl
Group | Model Configuration, System |
---|---|
Description | Requests or releases the control of the currently connected model. Configuration control enables the client API to change the configuration (OP_GLOBAL_SETTING_FILE) of the model to which it is connected. Only one client API at a time is granted configuration control. |
Required Control | None |
Usage | int OpalGetConfigurationControl(unsigned short configControl, const char *password); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OpalConnect, OpalSetCurrentModel |
OpalGetConnectionPointsForIO
Group | Connections |
---|---|
Description | Returns the set of information of datapoints for the IO provided. Memory for output structure has been allocated by the RT-LAB API. User must free this memory with a call to OpalFreeMemory. |
Required Control | None |
Usage | int OpalGetConnectionPointsForIO(const char* syncExchangerName, const char* includeFilter, const char* excludeFilter, unsigned int *numCnx, OP_DATAPOINT_INFO** connectionPoints) |
Input |
|
Output |
|
Return value |
|
Examples | |
Related items | OP_DATAPOINT_INFO |
OpalGetConnectionsDescription
Group | Connections |
---|---|
Description | Returns the set of information of connections for the current model. Memory for output structure has been allocated by the RT-LAB API. User must free this memory with a call to OpalFreeMemory. |
Required Control | None |
Usage | int OpalGetConnectionsDescription (unsigned int *numCnx, OP_CONNECTION_INFO **cnxInfo); |
Input | None |
Output |
|
Return value |
|
Examples | |
Related items | OP_CONNECTION_INFO |
OpalGetConnHandle
Group | Model selection |
---|---|
Description | Returns an opaque handle associated with the current connection. This handle can be passed back to a subsequent OpalSetConnHandle. If there is no current connection, one is created. |
Required Control | None |
Usage | int OpalGetConnHandle(unsigned long *pHandle); |
Input | None |
Output |
|
Return value |
|
Examples | See multi_models |
Related items | OpalDeleteConnHandle, OpalNewConnHandle, OpalSetConnHandle |
OpalGetControlSignals
Group | Model Interaction, Control Signals |
---|---|
Description | Returns the current values of the control signals (see Glossary) sent to the computation nodes. These signals can be set by a call to OpalSetControlSignals. |
Required Control | None |
Usage | int OpalGetControlSignals(unsigned short logicalId,unsigned short allocatedSignals, unsigned short *numSignals, double values[]); |
Input |
|
Output |
|
Return value |
|
Examples | See example control_signal. |
Related items | OpalSetControlSignals |
OpalGetControlSignalsDescription
Group | Model Interaction, Signals |
---|---|
Description | Returns a set of basic information for each control signal (see Glossary). If there is no connection from the console to the specified subsystem, returns EOK and sets numSignals to 0. Memory for output structure has been allocated by the RT-LAB API. User must free this memory with a call to OpalFreeMemory. |
Required Control | None |
Usage | int OpalGetControlSignalsDescription(int *pSignalCnt,OP_SIGNAL_INFO **ppSignalInfoList); |
Input | None |
Output |
|
Return value |
|
Examples | See example control_signal. |
Related items | OpalGetControlSignals |
OpalGetCurrentModel
Group | Model Selection |
---|---|
Description | Returns the path and the filename of the current model i.e. the model used by the current API. |
Required Control | None |
Usage | int OpalGetCurrentModel (char *modelPath,char *modelName); |
Input | None |
Output |
|
Return value |
|
Examples | None |
Related items | OpalSetCurrentModel. |
OpalGetDefaultAttributes
Group | Generic |
---|---|
Description | Get the default values of some object attributes. See the OP_ATTRIBUTE enumeration for a complete list of available attributes. |
Required Control | None |
Usage | int OpalGetDefaultAttributes (int numAttributes, OP_REF ids[], OP_ATTRIBUTEattributes [], void *** attributesValues); |
Input |
|
Output |
|
Return value |
|
Examples | None |
Related items | OpalGetAttributes, OpalSetAttributes, OpalRestoreAttributes, OP_ATTRIBUTE |
OpalGetExtraFiles
Group | Model Preparation |
---|---|
Description | Returns the list of files to be transferred or retrieved during one of the following steps:
Memory for output structures (extraFiles) is allocated by the RT-LAB API. You must free this memory with a call to OpalFreeMemory. |
Required Control | None |
Usage | int OpalGetExtraFiles (OP_EXTRA_FILE_TRANSFER_TIME transferTime,unsigned short logicalId, OP_EXTRA_FILE ** extraFiles, unsigned short * nbFiles); |
Input |
|
Output |
|
Return value |
|
Examples | See example configuration model. |
Related items | OpalAddExtraFile, OpalRemoveExtraFile, OpalFreeMemory, OP_EXTRA_FILE_TRANSFER_TIME, OP_EXTRA_FILE |
OpalGetInstalledMatlabReleases
Group | Utilities |
---|---|
Description | Returns the list of Matlab releases that currently installed on this computer. |
Required Control | None |
Usage | int OpalGetInstalledMatlabReleases(OP_MATLAB_VERSION releaseList[],int * numReleases) |
Input |
|
Output |
|
Return value |
|
Examples | None |
Related items | None |
OpalGetIOInterfaces
Group | Connections |
---|---|
Description | Returns the set of information for IO interfaces of the project. Memory for output structure has been allocated by the RT-LAB API. User must free this memory with a call to OpalFreeMemory. |
Required Control | None |
Usage | int OpalGetIOInterfaces(const char* driverNamePattern, unsigned int* numDrivers, OP_DRIVER_INFO** driversInfo) |
Input |
|
Output |
|
Return value |
|
Examples | |
Related items | OP_DRIVER_INFO |
OpalGetLastErrMsg
Group | Utilities |
---|---|
Description | Returns a message which may have been stored when the last API call was done. This message is cleared or overwritten by subsequent operations. This call itself does not modify the stored message. An application can either preallocate a buffer of sufficient length for anticipated messages, or call this function with bufLen = 0 to retrieve the message length in msgLen, then allocate the required buffer. |
Required Control | None |
Usage | int OpalGetLastErrMsg(char *buf,unsigned short bufLen, unsigned short *msgLen); |
Input |
|
Output |
|
Return value | None |
Examples | None |
Related items | Error Codes on page 335 |
OpalGetModelState
Group | Model Execution |
---|---|
Description | Returns the state of the currently connected model and its simulation mode. |
Required Control | None |
Usage | int OpalGetModelState(OP_MODEL_STATE *modelState, unsigned short *realTimeMode); |
Input | None |
Output |
|
Return value |
|
Examples | See example basic_example1. |
Related items | OP_MODEL_STATE, OP_REALTIME_MODE |
OpalGetMonitoringControl
Group | Model Interaction, Monitoring |
---|---|
Description | Requests or releases the monitoring control of the currently connected model. Monitoring control allows the client API to take and restore snapshot and also to configure the monitoring settings. Only one client API at a time is granted monitoring control. |
Required Control | None |
Usage | int OpalGetMonitoringControl(unsigned short monitoringControl); |
Input |
|
Output | None |
Return value |
|
Examples | See example snapshot. |
Related items | OpalSnapshot |
OpalGetNodeCpu
Group | Model Preparation |
---|---|
Description | Get the cpu assignment option for a list of subsystems of the current model. Cpu assignment is not available for NT target. |
Required Control | None |
Usage | int OpalGetNodeCpu (unsigned short numSubsys,char *subsysName[], char *cpuOption); |
Input |
|
Output |
|
Return value |
|
Examples | None |
Related items | OpalSetNodeCpu |
OpalGetNodeXHP
Group | Model Preparation |
---|---|
Description | Get the XHP mode option for a list of subsystems of the current model. |
Required Control | None |
Usage | int OpalGetNodeXHP (unsigned short numSubsys,char *subsysName[], char *XHPOption); |
Input |
|
Output | list of boolean values showing the XHP mode for the corresponding subystem.FALSE (0) means subsystem will not run in XHP mode. TRUE (1) means the subsystem will run in XHP mode. |
Return value |
|
Examples | None |
Related items | OpalSetNodeXHP |
OpalGetNumAcqGroups
Group | Model Configuration, Acquisition |
---|---|
Description | Returns the number of acquisition groups for the connected model. |
Required Control | None |
Usage | int OpalGetNumAcqGroups(unsigned short *numAcqGroups); |
Input | None |
Output | numAcqGroups number of acquisition group |
Return value |
|
Examples | None |
Related items | None |
OpalGetNumSignalsForGroup2
Group | Model Configuration, Acquisition |
---|---|
Description | Returns the number of signals for the specified acquisition group. |
Required Control | None |
Usage | int OpalGetNumSignalsForGroup2(unsigned short acqGroup,unsigned short *numSigValues, unsigned short *maxNumDynSigValues, unsigned short *numDynSigValues); |
Input |
|
Output |
|
Return value |
|
Examples | None |
Related items | None |
OpalGetParameterControl
Group | Model Interaction, Parameters |
---|---|
Description | Requests or releases the parameter control of the currently connected model. Parameter control allows the client API to change the values of models' parameters. Only one client API at a time is granted parameter control. |
Required Control | None |
Usage | int OpalGetParameterControl(unsigned short paramControl); |
Input |
|
Output | None |
Return value |
|
Examples | See example parameter1. |
Related items | OpalSetParameters, OpalSetParametersByName |
OpalGetParametersByName
Group | Model Interaction, Parameters |
---|---|
Description | Returns the parameters’ information for the specified list. Memory for output structure has been allocated by the RT-LAB API. User must free this memory with a call to OpalFreeMemory. |
Required Control | None |
Usage | int OpalGetParametersByName (unsigned int allocatedParams,char *paramPathName[], OP_PARAMETER_INFO **parameterInfo); |
Input |
|
Output |
|
Return value |
|
Examples | Parameter1 |
Related items | OpalSetParametersByName, OP_PARAMETER_INFO |
OpalGetParametersDescription
Group | Model Interaction, Parameters |
---|---|
Description | Returns the set of information of parameters and variables for the current model. Memory for output structure has been allocated by the RT-LAB API. User must free this memory with a call to OpalFreeMemory. |
Required Control | None |
Usage | int OpalGetParametersDescription (unsigned int *numParams,OP_PARAMETER_INFO **parameterInfo, unsigned int *numVars, OP_VARIABLE_INFO **variableInfo); |
Input | None |
Output |
|
Return value |
|
Examples | Parameter1 |
Related items | OP_PARAMETER_INFO, OP_VARIABLE_INFO |
OpalGetPauseTime
Group | Model Execution |
---|---|
Description | Gets the value of the pause time. |
Required Control | None |
Usage | int OpalGetPauseTime(double *time); |
Input | None |
Output |
|
Return value |
|
Examples | None |
Related items | OpalSetPauseTime |
OpalGetPhysNodeList
Group | Model Preparation |
---|---|
Description | Returns the list of physical nodes in the current hardware configuration. The physical node names are as defined in the hardware.config file. If the allocated storage is too small for the number of physical nodes, or for the longest physical node name, none of the names are returned, but the numPhysNodes and maxPhysNodeNameLen values are set, and the return value is E2BIG. An application can use this fact to specify lengths of 0 on a first call, allocate the required storage and issue a second call to get the information. |
Required Control | None |
Usage | int OpalGetPhysNodeList(unsigned short allocatedPhysNode,unsigned short *numPhysNodes,unsigned short allocatedPhysNodeNameLen, unsigned short *maxPhysNodeNameLen, char *physicalNodeName[]); |
Input |
|
Output |
|
Return value |
|
Examples | See example configuration. |
Related items | None |
OpalGetRtlabVersion
Group | Utilities |
---|---|
Description | Returns the versions of the RT-LAB API and the currently running MetaController |
Required Control | None |
Usage | int OpalRtlabVersion(char *metaVersion,unsigned short *metaVersionLen, char *apiVersionunsigned short *apiVersionLen); |
Input |
|
Output |
|
Return value |
|
Examples | None |
Related items | None |
OpalGetRtlabLicenseExpirationDate
Group | Model selection |
---|---|
Description | Returns the number of days remaining before the RT-Lab license expires. (deprecated) Always return -1. |
Required Control | None |
Usage | int OpalGetRtlabLicenseExpirationDate(int *nbDaysLeft); |
Input | None |
Output |
|
Return value |
|
Examples | None |
Related items | None |
OpalGetSignalControl
Group | Model Interaction, Control Signals |
---|---|
Description | Requests or releases the signal control of the currently connected model. Signal control allows the client API to change the values of models's control signals. Only one client API at a time is granted signal control. |
Required Control | None |
Usage | int OpalGetSignalControl(unsigned short logicalId,unsigned short signalControl); |
Input |
|
Output | None |
Return value |
|
Examples | See example control_signal. |
Related items | OpalSetControlSignals |
OpalGetSignalsByName
Group | Model Interaction, Signals |
---|---|
Description | Returns the values for the specified signal names |
Required Control | None |
Usage | int OpalGetSignalsByName(int signalCnt,char **ppSignalNameList, double *pRetValueList); |
Input |
|
Output |
|
Return value |
|
Examples | None |
Related items | OpalGetSignalsDescription |
OpalGetSignalsDescription
Group | Model Interaction, Control Signals |
---|---|
Description | Returns a set of basic information for each available signal in the model. Memory for output structure has been allocated by the RT-LAB API. User must free this memory with a call to OpalFreeMemory. |
Required Control | None |
Usage | int OpalGetSignalsDescription(int *pSignalCnt,OP_SIGNAL_INFO **ppSignalInfoList); |
Input | None |
Output |
|
Return value |
|
Examples | None |
Related items | OpalGetSignalsByName |
OpalGetStopTime
Group | Model Execution |
---|---|
Description | Gets the value of the stop time. |
Required Control | None |
Usage | int OpalGetStopTime(double *time); |
Input | None |
Output |
|
Return value |
|
Examples | None |
Related items | OpalSetStopTime |
OpalGetSubsystemList
Group | Model Preparation |
---|---|
Description | Returns the list of subsystems in the current model: their name, their logical id and the name of the physical node on which each is assigned. The physical node name is an empty string when the subsystem has not yet been assigned to a physical node.
|
Required Control | None |
Usage | int OpalGetSubsystemList(unsigned short allocatedSubsys,unsigned short *numSubsys,unsigned short allocatedSubsysNameLen, unsigned short *maxSubsysNameLen, unsigned short allocatedPhysNodeNameLen, unsigned short *maxPhysNodeNameLen, char *subsysName[],unsigned short logicalId[], char *physNodeName[]); |
Input |
|
Output |
|
Return value |
|
Examples | See example configuration. |
Related items | None |
OpalGetSystemControl
Group | Model Configuration, System |
---|---|
Description | Requests or releases the system control of the currently connected model. System control enables the client API to control the model's execution. Only one client API at a time is granted system control. |
Required Control | None |
Usage | int OpalGetSystemControl(unsigned short systemControl); |
Input |
|
Output | None |
Return value |
|
Examples | See example basic_example1. |
Related items | OpalConnect, OpalConnectByName, OpalSetCurrentModel |
OpalGetTargetFile
Group | Utilities |
---|---|
Description | Transfers files from the target node to the host development node using the FTP protocol. The FTP user used for the transfer is defined in the RT-LAB hardware configuration which can be modified through the RT-LAB MainControl sub-panels. |
Required Control | None |
Usage | int OpalGetTargetFile (char *sourceNodeName,char *sourceFile, char *targetPath, OP_FILE_TRANSFER_MODE mode, unsigned short logicalId); |
Input |
|
Output | None |
Return value |
|
Examples | See example file_transfer. |
Related items | OP_FILE_TRANSFER_MODE, OpalPutTargetFile |
OpalGetTargetNodeSystemInfo
Group | Utilities |
---|---|
Description | Returns information about a specified target. |
Required Control | None |
Usage | int OpalGetTargetNodeSystemInfo (const char * const targetname, OP_NODE_SYSTEM_INFORMATION * pNodeInfo); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OP_NODE_SYSTEM_INFORMATION |
OpalGetTargetPlatform
Group | Model Preparation |
---|---|
Description | Returns the target platform for the local or global settings. |
Required Control | None |
Usage | int OpalGetTargetPlatform(unsigned short *targetPlatform,unsigned short scope_flag); |
Input | scope_flag See OP_SETTING_FILE. Valid values are: 0: local settings 1: global settings |
Output |
|
Return value |
|
Examples | None |
Related items | OpalSetTargetPlatform, OP_TARGET_PLATFORM, OP_SETTING_FILE |
OpalGetTimeInfo
Group | Model Configuration, System |
---|---|
Description | Returns the value of the calculation step specified in the current model, and the time factor to apply to obtain the effective calculation step. |
Required Control | None |
Usage | int OpalGetTimeInfo(double *calcStep,double *timeFactor); |
Input | None |
Output |
|
Return value |
|
Examples | None |
Related items | OpalSetTimeFactor |
OpalGetValueByAlias
Group | Model Interaction, Alias |
---|---|
Description | Gets the values of one or more parameters (or signals) by specifying their alias names. The output contains one value for each alias. |
Required Control | None |
Usage | int OpalGetValueByAlias(int allocatedAlias,const char ** aliasNames, double * aliasValues); |
Input |
|
Output |
|
Return value |
|
Examples | None |
OpalInstallRtlab
Group | Utilities |
---|---|
Description | Installs the current version of RT-LAB on the specified target. A log file is created during this installation or the filename is returned by the function. To install a different version of RT-LAB, use OpalInstallTarget() instead. |
Required Control | None |
Usage | int OpalInstallTarget(const char * nodeName); |
Input |
|
Output |
|
Return value |
|
Examples | None |
Related items |
OpalInstallTarget
Group | Utilities |
---|---|
Description | Installs an archive file (TGZ or RPM) on the specified target. A log file is created during this installation or the filename is returned by the function. To install the current version of RT-LAB, use OpalInstallRtlab() instead. |
Required Control | None |
Usage | int OpalInstallTarget(const char * nodeName,const char * filename, char ** logFilename); |
Input |
|
Output |
|
Return value |
|
Examples | None |
Related items |
OpalIsOriginalModelOpen
Group | Model Interaction, Original Model |
---|---|
Description | Returns true if the original Simulink model (block diagram) of the currently connected model is open on the local machine. Please note that this function is only available on Windows and Linux operating system when the model is a Simulink model. |
Required Control | None |
Usage | int OpalIsOriginalModelOpen(); |
Input | None |
Output | None |
Return value |
|
Examples | None |
Related items | OpalLoadOriginalModel |
OpalLoad
Group | Model Execution |
---|---|
Description | Load the model's executables in memory. Upon successful return, all subsystems are loaded and waiting for the Execute command. The subsystems are loaded on the nodes associated to them in the last call to OpalSetNodeMapping. |
Required Control | System control |
Usage | int OpalLoad(unsigned short realTimeMode,OP_API_INSTANCE_ID *instanceId, double timeFactor); |
Input |
|
Output |
|
Return value |
|
Examples | See example basic_example2. |
Related items | OpalReset, OpalGetModelState, OpalGetSystemControl, OP_REALTIME_MODE. |
OpalLoadAliasDescription
Group | Model Interaction, Alias |
---|---|
Description | Load a list of aliases in the current list of aliases. The new list can replace the current list of aliases or it can be merged with the current list depending on the function's settings. Specifying a pattern ensures that only matching aliases are loaded. Wildcard characters (?,*) may by used in pattern. |
Required Control | System control |
Usage | int OpalLoadAlias(const char * fileName,const char * aliasNamePattern, OP_LOAD_FILE_OPTION options, OP_LOAD_FILE_STATUS * status); |
Input |
|
Output |
|
Return value |
|
Examples | None |
Related items | OpalCreateAlias, OpalRemoveAlias, OpalSaveAlias, OpalLoadAliasDescription, OP_LOAD_FILE_STATUS, OP_LOAD_FILE_OPTION. |
OpalLoadAlias
Group | Model Interaction, Alias |
---|---|
Description | Load a list of aliases. The new list isn’t merged to the current list of aliases or doesn’t replace the current list of aliases. Specifying a pattern ensures that only matching aliases information is returned. Wildcard characters (?,*) may be used in the pattern. Memory for output structure has been allocated by the RT-LAB API. User must free this memory with a call to OpalFreeMemory. The existing field of the aliasInfo structure indicates if the loaded alias matches an alias in the current list of alias. When a match exists, the newAlias field of the aliasInfo structure contains a pointer of the matched alias. |
Required Control | None |
Usage | int OpalLoadAliasDescription(const char * fileName,const char * aliasNamePattern, int * numberAlias OP_ALIAS_INFO ** aliasInfo); |
Input |
|
Output |
|
Return value |
|
Examples | None |
Related items | OpalCreateAlias, OpalLoadAlias, OpalSaveAlias, OpalGetAliasDescription, OP_ALIAS_INFO. |
OpalLoadConsole
Group | Model Interaction, Console |
---|---|
Description | Loads on the client machine the console subsystem associated with the current connected model. Upon successful return, the console is opened. Only Simulink consoles are supported. Please note that this function is only available on Windows and Linux operating system when the model contains a console subsystem. Furthermore, the client machine must have Matlab installed. |
Required Control | |
Usage | int OpalLoadConsole(); |
Input | None |
Output | None |
Return value |
|
Examples | |
Related items | OpalExecuteConsole, OpalPauseConsole, OpalResetConsole, OpalStopConsole |
OpalLoadOriginalModel
Group | Model Interaction, Original Model |
---|---|
Description | Loads the original model (block diagram) of the current connected model on the client machine. Furthermore, if the model is a Simulink model, the client machine must have Matlab installed. |
Required Control | |
Usage | int OpalLoadOriginalModel(); |
Input | None |
Output | None |
Return value |
|
Examples | None |
Related items | OpalIsOriginalModelOpen, OpalResetOriginalModel |
OpalLoadParameters
Group | Model Interaction, Parameters |
---|---|
Description | Load the parameters’ values from a file and applies them to the model. |
Required Control | Parameter Control |
Usage | int OpalLoadParameters(char *pathName,OP_LOAD_PARAMS_OPTION option, OP_LOAD_PARAMS_STATUS *pStatus); |
Input |
|
Output |
|
Return value |
|
Examples | None |
Related items | OpalSaveParameters |
OpalLoadParametersDescription
Group | Model Interaction, Parameters |
---|---|
Description | Load and return the parameters from the specified file. Parameter's values are not set in the model memory. OpalSetParameters must be called with the return parameters to send new values to the model on target. ParameterInfo's member “exist” may have 4 values:
Memory for output structures has been allocated by the RT-LAB API. You must free this memory with a call to OpalFreeMemory. For example, OpalFreeMemory(variableInfo); Please note that this all is only available when using a SIMULINK model. |
Required Control | |
Usage | int OpalLoadParametersDescription(char *pathName, unsigned int *numParams,unsigned int *numVars, OP_PARAMETER_INFO **parameterInfo, OP_VARIABLE_INFO **variableInfo); |
Input |
|
Output |
|
Return value |
|
Examples | |
Related items | OpalGetParametersDescription, OpalSaveParameters |
OpalModelClean
Group | Model Preparation |
---|---|
Description | Clean model directory on targets. All intermediate files and folder are removed. |
Required Control | System Control |
Usage | int OpalModelClean (unsigned int option); |
Input |
|
Output | |
Return value |
|
Examples | |
Related items | OP_MODEL_CLEAN_DEFINE. |
OpalNewConnHandle
Group | Model selection |
---|---|
Description | Returns an opaque handle associated with a new connection, which becomes the current connection. The new connection is uninitialized, and its state is the same as for a new process or thread. This handle can be passed back to a subsequent OpalSetConnHandle. This call is only required when a thread must handle multiple connections. There is no need to call this function when a thread handles only one connection. There is no harm in doing so, as long as it is the first call made to RT-LAB API done by that thread. Changing this connection (e.g. by calling OpalConnect or OpalSetCurrentModel2) does not change the other connections, whereas one of those calls without first calling OpalNewConnHandle implicitly disconnects a previously existing connection. |
Required Control | |
Usage | int OpalNewConnHandle(unsigned long *pHandle); |
Input | |
Output |
|
Return value |
|
Examples | See multi_models |
Related items | OpalGetConnHandle, OpalSetConnHandle, OpalDeleteConnHandle |
OpalNotificationGetPathName
Group | Utilities |
---|---|
Description | Returns the path and name of the parameter(s) or signal(s) that have been modified when an event OP_PARAMETER_UPDATE or OP_SIGNAL_CHANGE is notified. This function should be called from within the callback function registered for the events listed above. It allows more information about the notification to be gathered upon the reception of such events. This function allocates the memory for the pathNameList pointer. User should call OpalFreeMemory to desallocate this pointer when the variable is no longer in use. |
Required Control | |
Usage | int OpalNotificationGetPathName(OP_NOTIFICATION returnedNotification, int *numberOfElements,char **pathNameList[]); |
Input |
|
Output |
|
Return value |
|
Examples | See the API parameter1 or signal1 examples. |
Related items | OP_EVENTS, OP_NOTIFICATION, OpalNotificationGetID, OpalNotificationGetValue, OpalSetNotificationCallback |
OpalNotificationGetID
Group | Utilities |
---|---|
Description | Returns the IDs of the parameter(s) or signal(s) that have been modified when an event OP_PARAMETER_UPDATE or OP_SIGNAL_CHANGE is notified. This function should be called from within the callback function registered for the events listed above. It allows more information about the notification to be gathered upon the reception of such events. This function allocates the memory for the idList pointer. User should call OpalFreeMemory to desallocate this pointer when the variable is no longer in use. |
Required Control | |
Usage | int OpalNotificationGetId(OP_NOTIFICATION returnedNotification,int *numberOfElements, unsigned int **idList); |
Input |
|
Output |
|
Return value |
|
Examples | See the API parameter1 or signal1 examples. |
Related items | OP_EVENTS, OP_NOTIFICATION, OpalNotificationGetValue, OpalNotificationGetPathName, OpalSetNotificationCallback |
OpalNotificationGetValue
Group | Utilities |
---|---|
Description | Returns the values of the parameter(s) or signal(s) that have been modified when an event OP_PARAMETER_UPDATE or OP_SIGNAL_CHANGE is notified. This function should be called from within the callback function registered for the events listed above. It allows more information about the notification to be gathered upon the reception of such events. This function allocates the memory for the valueList pointer. User should call OpalFreeMemory to desallocate this pointer when the variable is no longer in use. |
Required Control | |
Usage | int OpalNotificationGetValue(OP_NOTIFICATION returnedNotification,int *numberOfElements, int **valueList); |
Input |
|
Output |
|
Return value |
|
Examples | See the API parameter1 or signal1 examples. |
Related items | OP_EVENTS, OP_NOTIFICATION, OpalNotificationGetID, OpalNotificationGetPathName, OpalSetNotificationCallback |
OpalOpenProject
Group | Model and project selection |
---|---|
Description | Connects the API to an active project and contained models. Subsequent API calls refer to this project and models. |
Required Control | None |
Usage | int OpalOpenProject(const char * projectPath, unsigned short returnOnAmbiguity, OP_API_INSTANCE_ID* instId); |
Input |
|
Output | None |
Return value |
|
Examples | See example basic_example1, 2, blob1.c, acquisition1.c |
Related items | OpalConnectByName (deprecated), OpalDisconnect (deprecated), OpalCloseProject |
OpalPause
Group | Model Execution |
---|---|
Description | Pause the execution of the currently connected model. |
Required Control | System Control |
Usage | int OpalPause(void); |
Input | |
Output | |
Return value |
Examples
|
Examples | See example basic_example2. |
Related items | OpalExecute, OpalGetSystemControl, OpalReset |
OpalPauseConsole
Group | |
---|---|
Description | Pauses and stops execution of the Simulink console associated with of the current connected model. Before calling this function, the console must be executed. Please note that this function is only available on Windows and Linux operating system when the model contains a Simulink console subsystem. The client machine must have Matlab install. |
Required Control | |
Usage | int OpalPauseConsole(); |
Input | |
Output | |
Return value |
|
Examples | |
Related items | OpalExecuteConsole, OpalLoadConsole, OpalResetConsole, OpalStopConsole |
OpalPing
Group | Utilities |
---|---|
Description | Checks if the specified target is connected to the network. If the target is up, try to connect to the RT-LAB daemon (OpalD) running on the target. This daemon is required in order to compile and load a model on this target. |
Required Control | |
Usage | int OpalPing(const char *target); |
Input |
|
Output | |
Return value |
|
Examples | |
Related items |
OpalPutTargetFile
Group | Utilities |
---|---|
Description | Transfers files from the host development node to the target node using the FTP protocol. The FTP user used for the transfer is defined in the RT-LAB hardware configuration. The RT- LAB hardware configuration can be modified through RT-LAB's MainControl sub-panels. |
Required Control | |
Usage | int OpalPutTargetFile( char *targetNodeName,char *sourceFile, char *targetPath, OP_FILE_TRANSFER_MODE mode, unsigned short logicalId); |
Input |
|
Output | |
Return value |
|
Examples | See example file_transfer. |
Related items | OP_FILE_TRANSFER_MODE, OpalGetTargetFile |
OpalRearmAsyncAcq
Group | Model Configuration, Acquisition |
---|---|
Description | Rearm the Trigger for a given Acquisition Group |
Required Control | |
Usage | int OpalRearmAsyncAcq(unsigned short acqGroup); |
Input |
|
Output | |
Return value |
|
Examples | |
Related items | OpalSetAsyncAcqOpts |
OpalRegisterDisplay
Group | Utilities |
---|---|
Description | Registers to receive displayed messages during the compilation and/or execution phase of a model. Please note that you must use the function OpalDisplayInformation to receive messages. |
Required Control | |
Usage | int OpalRegisterDisplay(OP_DISPLAY_REG_TYPE registerType); |
Input |
|
Output | |
Return value |
|
Examples | See example compilation. |
Related items | OpalDisplayInformation, OP_DISPLAY_REG_TYPE |
OpalReleaseFunctionControl
Group | Utilities |
---|---|
Description | Releases the control of the specified function block. See OP_FUNCTIONAL_BLOCK for more information about the available function blocks. |
Required Control | |
Usage | int OpalReleaseFunctionControl( OP_FUNCTIONAL_BLOC fb,unsigned short fbElem ); |
Input |
|
Output | |
Return value |
|
Examples | |
Related items | OpalTakeFunctionControl, OP_FUNCTIONAL_BLOCK. |
OpalRemoveAlias
Group | Model Interaction, Alias |
---|---|
Description | Remove aliases from the current list of aliases currently associated with the active model. Specifying a pattern ensures that only maching aliases are removed. Wildcard characters (?,*) may by used in pattern. |
Required Control | System control |
Usage | int OpalRemoveAlias(const char * aliasNamePattern); |
Input |
|
Output | |
Return value |
|
Examples | |
Related items | OpalCreateAlias, OpalLoadAlias, OpalSaveAlias. |
OpalRemoveExtraFile
Group | Model Preparation |
---|---|
Description | This function removes a file to the list of files to be transferred or retrieved during one of the following steps:
|
Required Control | System Control |
Usage | int OpalRemoveExtraFile (OP_EXTRA_FILE_TRANSFER_TIME transferTime, unsigned short logicalId,char * filePathName); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OP_EXTRA_FILE_TRANSFER_TIME, OpalAddExtraFile, OpalGetSystemControl |
OpalRemoveFromSelection
Group | Utilities |
---|---|
Description | Given the object's reference ID, removes it from the selected items. |
Required Control | None |
Usage | int OpalRemoveFromSelection(P_REF_ID *refId); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | None |
OpalRenameAlias
Group | Model Interaction, Alias |
---|---|
Description | Rename an alias. |
Required Control | System control |
Usage | int OpalRenameAlias(const char * aliasName,const char * newAliasName); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OpalCreateAlias, OpalRemoveAlias. |
OpalReset
Group | Model Execution |
---|---|
Description | Stops and resets the current simulation. |
Required Control | System Control |
Usage | int OpalReset(void); |
Input | None |
Output | None |
Return value |
|
Examples | See example basic_example2. |
Related items | OpalLoad, OpalGetSystemControl |
OpalResetConsole
Group | Model Interaction, Console |
---|---|
Description | Resets and unloads the the Simulink console subsystem associated with the current con- nected model. Before calling this function, the client must call OpalLoadConsole. Please note that this function is only available on Windows and Linux operating system when the model contains a Simulink console subsystem. The client machine must have Matlab install. |
Required Control | |
Usage | int OpalResetConsole(); |
Input | None |
Output | None |
Return value |
|
Examples | None |
Related items | OpalExecuteConsole, OpalLoadConsole, OpalPauseConsole, OpalStopConsole |
OpalResetOriginalModel
Group | Model Interaction, Original Model |
---|---|
Description | Closes the original Simulink model (block diagram) of the currently connected model. Please note that this function is only available on Windows and Linux operating system when the model is a Simulink model. |
Required Control | None |
Usage | int OpalResetOriginalModel(); |
Input | None |
Output | None |
Return value |
|
Examples | None |
Related items | OpalLoadOriginalModel, OpalIsOriginalModelOpen |
OpalRestoreAttributes
Group | Generic |
---|---|
Description | Restore the default values of some object attributes. See the OP_ATTRIBUTE enumeration for a complete list of available attributes. |
Required Control | Depending on the attribute types and the object types. See OP_ATTRIBUTE for more information on the required controls. |
Usage | int OpalRestoreAttributes (int numAttributes, OP_REF ids[], OP_ATTRIBUTE attributes []); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OpalGetAttributes, OpalSetAttributes, OpalGetDefaultAttributes, OP_ATTRIBUTE |
OpalSaveAlias
Group | Model Interaction, Alias |
---|---|
Description | Save the current aliases list in the specified file. Specifying a pattern ensures that only maching aliases are saved. Wildcard characters may by used in pattern. |
Required Control | None |
Usage | int OpalSaveAlias(const char * fileName,const char * aliasNamePattern); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OpalCreateAlias, OpalRemoveAlias, OpalLoadAlias |
OpalSaveParameters
Group | Model Interaction, Parameters |
---|---|
Description | Saves the current parameters’ values to the specified file. |
Required Control | None |
Usage | int OpalSaveParameters(char *path,char *name); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OpalLoadParameters, OpalLoadParametersDescription |
OpalSendBlob
Group | Utilities |
---|---|
Description | Generates a user event. It will be sent to other clients which have registered this event using either the OpalSetNotificationCallback or the OpalSetNotificationCallbackForModel function. |
Required Control | None |
Usage | int OpalSendNotification(OP_EVENTS event,char*message); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OP_EVENTS, OP_NOTIFICATION, OpalSetNotificationCallback, OpalSetNotificationCallbackForModel |
OpalSendNotification
Group | Utilities |
---|---|
Description | Generates a user event. It will be sent to other clients which have registered this event using either the OpalSetNotificationCallback or the OpalSetNotificationCallbackForModel function. |
Required Control | None |
Usage | int OpalSendNotification(OP_EVENTS event,char*message); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OP_EVENTS, OP_NOTIFICATION, OpalSetNotificationCallback, OpalSetNotificationCallbackForModel |
OpalSetAcqBlockLastVal
Group | Model Configuration, Acquisition |
---|---|
Description | Set the current settings for the blocking / non-blocking, and associated last value flag, for signal acquisition. This information is used by the API acquisition functions, which have the option not to wait for data, needed by some console's lack of multiple thread support. The ProbeControl panel sets these settings using this call. These settings apply to the current model. These settings only apply to the command station from which this call is made. |
Required Control | None |
Usage | int OpalSetAcqBlockLastVal(short blockOnGroupshort lastValues); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OpalGetAcqBlockLastVal |
OpalSetAcqTrigger
Group | Model Configuration, Acquisition |
---|---|
Description | Sets the acquisition trigger dynamically during the simulation. Data will be acquired only when a specific signal is triggered. The option of starting data acquisition only once a specified threshold is reached allows users to obtain information about a specified time-slice of the simulation. If a block OpTrigger is present in the model when activating the dynamic acquisition, the triggering will be set to the value of parameters provided by OpalSetAcqTrigger. When the parameter “triggerEnabled” in the OpalSetAcqTrigger interface is set to zero, the block OpTrigger will regain the triggering control once again. |
Required Control | Acquisition Control |
Usage | int OpalSetAcqTrigger( unsigned short acqGroup,const char *signalName, double level,const char * trigSignalName, int offset,OP_TRIGGER_CONDITION condition, unsigned char triggerEnabled, unsigned short trigType); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OpalGetAcqTrigger |
OpalSetAcqWriteFile
Group | Model Configuration, Acquisition |
---|---|
Description | Sets the filename to be used when acquiring data for a group into a file. Also allows to enabled or disable WriteFile. The running console which was getting data from the specified acquisition group will stop receiving any data for this group. The data are writting to a file on the target. The change is persistent and is used in subsequent runs of the model. The change affects any application acquiring data from this group. |
Required Control | Acquisition Control |
Usage | int OpalSetAcqWriteFile(unsigned short acqGroup,const char *fileName, const char *varName unsigned char bEnabled); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | None |
OpalSetAttributes
Group | Generic |
---|---|
Description | Set the values of some object attributes. See the OP_ATTRIBUTE enumeration for a complete list of available attributes. |
Required Control | Depending on the attribute types and the object types. See OP_ATTRIBUTE for more information on the required controls. |
Usage | int OpalSetAttributes (int numAttributes, OP_REF ids[], OP_ATTRIBUTE attributes [], void * attributeValues []); |
Input |
|
Output | None |
Return value |
|
Examples | None. |
Related items | OpalGetAttributes, OpalGetDefaultAttributes, OpalRestoreAttributes, OP_ATTRIBUTE. |
OpalSetClockPeriodInfo
Group | Utilities |
---|---|
Description | Upates the ClockPeriod related information associated with the current model. This function is only valid for QNX 6.x models (not supported anymore). |
Required Control | System Control. |
Usage | int OpalSetClockPeriodInfo (const OP_CLOCK_PERIOD_INFO * const pInfos); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OP_CLOCK_PERIOD_INFO, OpalGetClockPeriodInfo |
OpalSetConnHandle
Group | Model selection |
---|---|
Description | The specified handle must have been obtained from OpalGetConnHandle or OpalNewConnHandle. This specifies the connection to which subsequent RT-LAB API calls refer, until changed again by OpalSetConnHandle or OpalNewConnHandle. This lets a thread handle multiple connections, switching from one to the other without disconnecting. |
Required Control | None |
Usage | int OpalSetConnHandle(unsigned long handle); |
Input |
|
Output | None |
Return value |
|
Examples | See multi_models |
Related items | OpalNewConnHandle, OpalGetConnHandle, OpalDeleteConnHandle |
OpalSetControlSignals
Group | Model Interaction, Control Signals |
---|---|
Description | Sets the current values of the control signals (see Glossary) sent to the computation node subsystem. These signals can be return by a call to OpalSetControlSignals. The values are sent to the appropriate position at the output of the OpComm block, found in the subsystem with the specified logicalId, which receives its inputs from the model's console subsystem. All the values must be provided to this function. In order to set only one signal, see OpalSetSignalsByName. |
Required Control | Signal Control |
Usage | int OpalSetControlSignals (unsigned short numSignals,unsigned short logicalId, double values[]); |
Input |
|
Output | None |
Return value |
|
Examples | See example control_signal. |
Related items | OpalGetSignalControl, OpalGetControlSignals |
OpalSetCurrentModel
Group | Model Selection |
---|---|
Description | Creates a new connection inside the API to an RT-LAB model. Subsequent API calls refer to this model. If connected to a different model, that connection is broken, and a connection is made to a new instance of the Controller. If the API is already connected to a different model, that connection is closed and a new connection is created to the specified model. |
Required Control | None |
Usage | int OpalSetCurrentModel (const char *modelPathNameExt,OP_API_INSTANCE_ID *instanceId); |
Input |
|
Output |
|
Return value |
|
Examples | See example basic_example2. |
Related items | OpalDisconnect |
OpalSetDecimationFactor
Group | Model Configuration, Acquisition |
---|---|
Description | Sets the decimation factor to use when getting data for the specified acquisition group. The change is persistent and is used in subsequent runs of the model. |
Required Control | Acquisition Control |
Usage | int OpalSetDecimationFactor(unsigned short acqGroup,unsigned short decimation Factor); |
Input |
|
Output | None |
Return value |
Examples
|
Examples | None |
Related items | OpalSetFillDecimation |
OpalSetFillDecimation
Group | Model Configuration, Acquisition |
---|---|
Description | Enable or disable the option to insert values when the acquisition group’s decimation factor is greater than 1. The decimation factor lets you skip acquisition during some calculation steps. When this parameter is set to a number n, a sample will be acquired at every n-th calculation step. However, the RT-LAB API will repeat the values every n-th step. It is useful when the values are displayed in chart graphs. For instance, if the decimation factor is set to 3, values returned by the acquisition functions will be:value1[0], value1[0], value1[0], value1[1], value1[1], value1[1], value1[2]... Application using XY graphs should disable this option. |
Required Control | None |
Usage | int OpalSetFillDecimation(unsigned char bEnabled); |
Input | None |
Output |
|
Return value |
|
Examples | None |
Related items | None |
OpalSetNodeCpu
Group | Model Preparation |
---|---|
Description | Set the cpu assignment option for a list of subsystems of the current model. The new option becomes valid as soon as the next Load command is completed. Cpu assignment is not available for NT target. |
Required Control | System Control |
Usage | int OpalSetNodeCpu (unsigned short numSubsys,char *subsysName[], char *cpuOption); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OpalGetNodeCpu |
OpalSetMatlabRelease
Group | Utilities |
---|---|
Description | Sets the version of MATLAB to be used for edition and compilation. |
Required Control | None |
Usage | int OpalSetMatlabRelease(OP_MATLAB_VERSION release); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OP_MATLAB_VERSION |
OpalSetNodeMapping
Group | Model Preparation |
---|---|
Description | Defines a mapping between a list of subsystems of the current model and a list of corresponding physical node names. The new mapping becomes valid as soon as the next Load command is completed. |
Required Control | System Control |
Usage | int OpalSetNodeMapping (unsigned short numSubsys,char *subsysName[],char *physicalNodeName[]); |
Input |
|
Output | None |
Return value |
|
Examples | See example configuration. |
Related items | OpalGetSystemControl |
OpalSetNodeXHP
Group | Model Preparation |
---|---|
Description | Set the XHP mode option for a list of subsystems of the current model. The new option becomes valid as soon as the next Load command is completed. |
Required Control | System Control |
Usage | int OpalSetNodeXHP (unsigned short numSubsys,char *subsysName[], char *XHPOption); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OpalGetNodeXHP |
OpalSetNotificationCallback
Group | Utilities |
---|---|
Description | Registers a callback function that will be called when a specific event happens in the simulator. The callback function will be called when an event from the registered events list happens. To register events for a particular model, use OpalSetNotificationCallbackForModel. Note that if an event is registered for both project and model, only the model callback will be called. Each time this function is called, the event list and the callback function passed in argument will replace the previously registered list and callback function. Pass an empty event list to unregister all events. Use special event OP_ALL_EVENTS to register all possible events. You can also define your own events, see OP_EVENTS The callback function can be defined as following: void pfnCallback(OP_NOTIFICATION notification, void * pUserData) { /*Some code...*/ } |
Required Control | None |
Usage | int OpalSetNotificationCallback(unsigned short numEvents,OP_EVENTS eventsList[], OPALCALLBACK pfnCallback, void *pUserData); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OP_EVENTS, OP_NOTIFICATION, OpalSetNotificationCallbackForModel, OpalNotificationGetPathName, OpalNotificationGetID, OpalNotificationGetValue |
OpalSetNotificationCallbackForModel
Group | Utilities |
---|---|
Description | Registers a callback function that will be called when a specific event happens in the simulator. The callback function will be called when an event from the registered events list happens and is related to the specified model. To register events for all models in a project use OpalSetNotificationCallback, or set model ID to 0 (zero). If an event is registered for both model and project. Each time this function is called with the same model ID, the event list and the callback function passed in argument will replace the previously registered list and callback function. However, you can register a specific event list and callback function for each model. Pass an empty event list to unregister all events. Use special event OP_ALL_EVENTS to register all possible events. You can also define your own events, see OP_EVENTS. The callback function can be defined as following: void pfnCallback(OP_NOTIFICATION notification, void * pUserData) { /*Some code...*/ } |
Required Control | None |
Usage | int OpalSetNotificationCallbackForModel(unsigned short numEvents,OP_EVENTS eventsList[], OPALCALLBACK pfnCallback, void *pUserData, OP_REF_ID modelId); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OP_EVENTS, OP_NOTIFICATION, OpalSetNotificationCallback, OpalNotificationGetPathName, OpalNotificationGetID, OpalNotificationGetValue |
OpalSetNumberValues
Group | Model Configuration, Acquisition |
---|---|
Description | Sets number of values to be acquired for each signal of the specified acquisition group. This constitutes a unit of acquisition in which there are no breaks. Acquired data for this group is considered available when all numValues have been acquired. The change is persistent and is used in subsequent runs of the model. The change affects any application acquiring data from this group. |
Required Control | Acquisition Control |
Usage | int OpalSetNumberValues(unsigned short acqGroup,unsigned short numValues unsigned short valueType); |
Input |
|
Output | None |
Return value |
Examples
|
Examples | None |
Related items | None |
OpalSetParameters
Group | Model Interaction, Parameters |
---|---|
Description | OpalSetParameters is obsolete. Replace it by OpalSetParameters2. |
OpalSetParameters2
Group | Model Interaction, Parameters |
---|---|
Description | Change the value of one or more RT-LAB parameters in the model. |
Required Control | Parameter Control |
Usage | int OpalSetParameters2(unsigned int allocatedParams,unsigned int *numParams, unsigned int *idParam, unsigned int allocatedValues, unsigned int *numValues, double *values); |
Input |
|
Output |
|
Return value |
|
Examples | See example parameter1. |
Related items | OpalSetParametersByName, OpalLoadParametersDescription, OpalGetParametersDescription, OpalGetParameterControl |
OpalSetParametersByName
Group | Model Interaction, Parameters |
---|---|
Description | Change the value of one or more RT-LAB parameters using their path and name in the model. |
Required Control | Parameter control |
Usage | int OpalSetParametersByName (unsigned int allocatedParams,char *paramPathName[], unsigned int allocatedValues, double *values); |
Input |
|
Output | None |
Return value |
|
Examples | See the example Parameter1 |
Related items | OpalSetParameters, OpalGetParametersDescription, OpalGetParameterControl, OpalGetParametersByName |
OpalSetPauseTime
Group | Model Execution |
---|---|
Description | Sets the value of the pause time. This value could be set whether the model is executed or not. If the model is executed and the pause time is set to a time that has been already reached, the model will pause immediately. |
Required Control | System Control |
Usage | int OpalSetPauseTime(double time); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OpalGetPauseTime |
OpalSetSignalsByName
Group | Model Interaction, Signals |
---|---|
Description | Sets the values for the specified signal names |
Required Control | Signals |
Usage | int OpalSetSignalsByName(int signalCnt,const char ** const ppSignalNameList, int valueCnt,const double * const pValueList); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OpalGetControlSignalsDescription |
OpalSetSimulationMode
Group | Model Preparation |
---|---|
Description | Sets the simulation mode. The specified simulation mode will be apply the next time the model is loaded. Simulation mode cannot be set when model is already loaded. |
Required Control | System Control |
Usage | int OpalSetSimulationMode(int simulationMode); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OpalGetModelState |
OpalSetStopTime
Group | Model Execution |
---|---|
Description | Sets the value of the stop time. This value could be set whether the model is executed or not. If the model is executed and the stop time is set to a time that has been already reached, the model will stop immediately. |
Required Control | System Control |
Usage | int OpalSetStopTime(double time); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OpalGetStopTime |
OpalSetTargetPlatform
Group | Model Preparation |
---|---|
Description | Sets the target platform where the model is to be compiled and executed. |
Required Control | System control for local settings modifications Configuration control for global settings modifications |
Usage | int OpalSetTargetPlatform (unsigned short targetPlatform,unsigned short scope_flag); |
Input |
|
Output | None |
Return value |
|
Examples | See example configuration. |
Related items | OpalGetConfigurationControl, OpalGetSystemControl, OpalGetTargetPlatform |
OpalSetAsyncAcqOpts
Group | Model Configuration, Acquisition |
---|---|
Description | Sets the Repetitive Sampling Option and the Rearm Delay for a given acquisition group. Setting the Repetitive Sampling Option to True will automatically rearm the trigger after the rearmDelay period. Setting Repetitive Sampling Option to False will require a manual trigger rearm. This manual rearm can be performed using the OpalRearmAsyncAcq function call. |
Required Control | Acquisition Control |
Usage | int OpalSetAsyncAcqOpts(unsigned short acqGroup,unsigned char repetitive, double rearmDelay); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OpalRearmAsyncAcq |
OpalSetTimeFactor
Group | Model Execution |
---|---|
Description | Sets the value of the time factor. When in real-time mode, the execution rate is the model's sampling rate times the time factor. |
Required Control | System Control |
Usage | int OpalSetTimeFactor(double timeFactor); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OpalExecute, OpalGetTimeInfo |
OpalSetValueByAlias
Group | Model Interaction, Alias |
---|---|
Description | Sets the values of one or more parameters (or signals) by specifying their alias names and their values. Note that if any of the aliases specified in the argument referenced a parameter, the parameter control is required. If any of the aliases specified in the argument referenced a control signal, the signal control is required. |
Required Control | Parameter control or/and signal Control |
Usage | int OpalSetValueByAlias(int allocatedAlias,const char ** aliasNames, const double * aliasValues); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OpalCreateAlias, OpalGetValueByAlias |
OpalSingleStep
Group | Model Execution |
---|---|
Description | Execute one step of the currently connected model. |
Required Control | System control. |
Usage | int OpalSingleStep(); |
Input | None |
Output | None |
Return value |
|
Examples | None |
Related items | OpalExecute, OpalPause |
OpalSnapshot
Group | Model Interaction, Snapshot |
---|---|
Description | Takes or restores a snapshot of the model. A snapshot is an image of the model, at a specific time, this snapshot contains the following values for the model: states, parameters, inputs and outputs. |
Required Control | Snapshot Control (or Monitoring Control) |
Usage | int OpalSnapshot (OP_SNAPSHOT_CMD cmd,const char *fileName, unsigned short overwrite, unsigned short increment, const char *comment, unsigned short commentLen); |
Input |
|
Output | None |
Return value |
|
Examples | See example snapshot. |
Related items | OpalGetMonitoringControl, OP_SNAPSHOT_CMD |
OpalStartCompile2
Group | Model Preparation |
---|---|
Description | Starts the compilation steps, which separate the subsystems, generates the code and compiles each subsystem. This function enables you to specify:
You may call OpalAbortCompile during the operation to stop the model's compilation. You must call OpalRegisterDisplay to register to receive status and compilation messages. |
Required Control | System Control |
Usage | int OpalStartCompile2 (unsigned short numSubsys,char* subsysName[] unsigned int option[]); |
Input |
|
Output | None |
Return value |
|
Examples | None |
Related items | OpalAbortCompile, OpalDisplayInformation, OP_COMPILATION_DEFINE. |
OpalStartExecutable
Group | Utilities |
---|---|
Description | Starts executable as an external process on the host computer. The function returns immediately and the outputs are available by calling the function OpalWaitExecutable. When the option OP_EXEC_FILE_OUTPUT_STDERR is set, the stderr outputs are separated of the stdout outputs. See OpalWaitExecutable for more information. When the option OP_EXEC_FILE_DETACHED is set, the outputs are lost. |
Required Control | None |
Usage | int OpalStartExecutable(const char * executable,const char * arguments, const unsigned int options, unsigned int * processId); |
Input |
|
Output |
|
Return value |
|
Examples | None |
Related items | OpalStopExecutable, OpalWaitExecutable, OP_START_EXEC_DEFINE. |
OpalStartTargetPythonScript
Group | Utilities |
---|---|
Description | Starts a python script on the selected target. The script should be copied to the target before running the command. The script and log paths should be absolute (relative paths are not supported). The script output can be monitored using the OpalDisplay or by the OpalDisplayInformation() Api command. See the OpalDisplayInformation documentation for more details. The function EnableContinousScriptDisplay() can be called at the beginning of the Python script to enable continuous display during execution. If this command is not called, the script standard output will be displayed only at the end of the execution. |
Required Control | The API should be connected to a model before running the command. |
Usage | int OpalStartTargetPythonScript(const char * targeName,const char * targetAbsoluteScriptPath, const char * argsconst char * hostLogPathName) |
Input |
|
Output | None |
Return value |
|
Examples | See example start_target_python_script |
Related items | OpalDisplayInformation |
OpalStopConsole
Group | Model Interaction, Console |
---|---|
Description | Stop execution of the Simulink console subsystem associated with the current connected model. Before calling this function, the console must be executed. Please note |