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 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

...