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.

SetCurrentModel Deprecated

Group

Model Selection

Description

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

Note: This function is deprecated. Use OpenProject instead.

Required Control

None

Usage

(instanceId,) = RtlabApi.SetCurrentModel (modelPathNameExt)

Input

  • modelPathNameExt: Absolute path, file name and extension of the model.

Output

  • instanceId: See Glossary.

Exception

  • EOK: Success.

  • ENOENT: No such file or directory.

  • EBADF: Bad file name or path (contains a space character or exceeds 31 characters).

  • EINVAL: Model path and name not specified.

  • EIO: Error sending the request or receiving the reply.

  • EBUSY: New model requested while some clients are still connected.

  • OP_API_EBAD_CONFIG: IP address of the controller machine not specified (environment variable OPAL_META_CTL_IP not set) or error reading configuration file.

  • OP_API_ENO_LICENSE: No license for one or more of RT-LAB components.

  • OP_API_ENO_PRODUCT: No license for RT-LAB and RT-LABx.

Examples

None

Related Items

Disconnect, OP_API_INSTANCE_ID.

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