Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


The following functions are available to a user in order to interface their application to RT-LAB.

...

GroupModel Configuration, Acquisition
DescriptionRequests 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 ControlNone
Usageint OpalGetAcquisitionControl(unsigned short acqControl,unsigned short acqGroup);
Input
  • acqControl                    
  • True(1): to request acquisition control for the specified acquisition group,
  • False(0): to release its control.
  • acqGroup: Group for which acquisition control is requested (numbering starts at 0).
OutputNone
Return value
  • EOK: Success.
  • EPERM: Control requested but already given to another client.
  • EBADF: Model not specified by previous OpalConnect or OpalSetCurrentModel.
  • EIO: Error sending the request or receiving the reply.
  • EINVAL: Invalid acquisition group.
ExamplesSee example dynamic_acq.
Related items
None

OpalGetActiveModels (deprecated)

GroupModel 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.
If the allocated storage is too small for the number of models, or for the longest name or longest path, none of the names, paths or instance Ids are returned, but the numModels, maxNameLen and maxPathLen 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 ControlNone
Usageint 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
  • allocatedModels: number of models for which storage was allocated by the caller for the names, paths and instance ids.
  • allocatedNameLen: allocated length of storage to receive the names
  • allocatedPathLen: allocated length of storage to receive the paths
Output
  • numModels: pointer to where the API will store the actual number of active models.
  • maxNameLen: pointer to where the API will store the length of the longest name.
  • maxPathLen: pointer to where the API will store the length of the longest path.
  • name: array of strings where the API will store the names of the active models (includes the extension).
  • path: array of strings where the API will store the paths of the active models.
  • instId: array where the API will store the instance Ids of the active models.
Return value
  • EOK: Success.
  • EIO: Error sending the request or receiving the reply.
  • E2BIG: specified storage not big enough to receive values
  • ENOMEM: Internal memory allocation error.
  • OP_API_EBAD_CONFIG: Node mapping not valid or IP address of the controller machine not specified (environment variable OPAL_META_CTL_IP not set).
ExamplesNone
Related items

OpalGetActiveProjects, OpalDisconnect, OpalSetCurrentModel, OpalConnectByName

...

GroupModel Interaction, Control Signals
DescriptionReturns 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 ControlNone
Usageint OpalGetControlSignals(unsigned short logicalId,unsigned short allocatedSignals, unsigned short *numSignals, double values[]);
Input
  • logicalId: See Glossary.
  • allocatedSignals: Number of expected signals.
Output
  • numSignals: Number of signals in the group.
  • values: User defined array where the API stores the returned list of signal values.
Return value
  • EOK: Success.
  • EBADF: Model not specified by previous OpalConnect or OpalSetCurrentModel.
  • EINVAL: Model is not loaded, or invalid logicalId.
  • EIO: Error sending the request or receiving the reply.
  • ENOMEM: Memory allocation error.
  • E2BIG: Specified storage not big enough to receive values.
ExamplesSee example control_signal.
Related items

OpalSetControlSignals

OpalGetControlSignalsDescription


GroupModel Interaction, Signals
DescriptionReturns 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 ControlNone
Usageint OpalGetControlSignalsDescription(int *pSignalCnt,OP_SIGNAL_INFO **ppSignalInfoList);
InputNone
Output
  • pSignalCnt: Number of control signals returned.
  • ppSignalInfoList: List of control signals' description returned. See OP_SIGNAL_INFO.
Return value
  • EOK: Success.
  • EPERM: Control requested, but already given to another client.
  • EBADF: Model not specified by previous OpalConnect or OpalSetCurrentModel.
  • EIO: Error sending the request or receiving the reply.
  • EINVAL: Invalid parameters
ExamplesSee example control_signal.
Related items

OpalGetControlSignals

...

GroupModel and project selection
DescriptionConnects the API to an active project and contained models. Subsequent API calls refer to this project and models.
Required ControlNone
Usageint OpalOpenProject(constchar*projectPath, unsignedshortreturnOnAmbiguity, OP_API_INSTANCE_ID* instId);
Input
  • projectPath: the name of the .llp file that refers to the project. A full relative or absolute path is preferred, but the file name alone will work provided the executable from which this call is made is in a subdirectory of the project.
  • instId: The id of the model instance to which the connection is to be made. Should be set to 0 if projectPath is specified.
  • returnOnAmbiguity: If set to non-zero, a pop-up will come up if the projectPath is ambiguous, otherwise and error is returned without a pop-up.
Output

None

Return value
  • EOK: Success.
  • EIO: Error sending the request or receiving the reply.
  • ESRCH: Invalid instance id or instance id not found.
  • EPERM: Control requested, but already given to another client.
  • ENOEXEC: Could not connect to model. Not all of the subsystems are still active.
  • EINVAL: Trying to connect to a model whose local and UNC path are both empty.
  • ENOENT: Could not find the original model we are trying to connect to.
  • OP_API_EBAD_CONFIG: Node mapping not valid or IP address of controller machine not specified (environment variable OPAL_META_CTL_IP not set).
  • OP_API_EBAD_PHYS_NODE: Physical node not found.
  • OP_API_EMODEL_CHANGED: The original model has been changed (number of sub-systems, sub-systems names, etc.
  • OP_API_ENO_LICENSE: No license.
  • OP_API_ENO_PRODUCT: No license for RT-LAB and RT-LABx.
  • OP_API_MODEL_IO_ TIMEOUT
  • OP_API_MODEL_IO_ERROR: Model is missing some or all processes or subsystems.
ExamplesSee example basic_example1, 2, blob1.c, acquisition1.c
Related items

OpalConnectByName (deprecated), OpalDisconnect (deprecated), OpalCloseProject

...