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.

Connect

Group

Model selection

Description

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

Required Control

None

Usage

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

Input

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

Output

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

Exception

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

Examples

None

Related Items

ConnectByName, Disconnect

Modules

import RtlabApi

OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323
Follow OPAL-RT: LinkedIn | Facebook | YouTube | X/Twitter