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.



Model selection


Connect the API to an active model. Subsequent API calls refer to this model.

Required Control



(modelState, ) = RtlabApi.Connect(instanceId, systemControl)


  • instanceId: The id of the model instance to which the connection is to be made. See Glossary.

  • systemControl: True to request control of the model.


  • modelState: Current state of the model. See OP_MODEL_STATE.


  • 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 the 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 the 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 subsystems, 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: Timed out waiting for a reply from the model.

  • OP_API_MODEL_IO_ERROR: Model is missing some or all processes or subsystems.



Related Items

ConnectByName, Disconnect


import RtlabApi

OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | | +1 514-935-2323