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.

OpenProject

Group

Generic

Description

Open a project from its settings file or connect to an active project.

This command is a wrapped version of Command which has the fixed ownerId OP_RTLAB_OBJ and OP_COMMAND CMD_OPEN.

Required Control

None

Usage

projectId = RtlabApi.OpenProject (project=””, functionalBlock=None, controlPriority=OP_CTRL_PRIO_NORMAL, returnOnAmbiguity=False)

Input

  • project {str/int} : Full or partial match of a project filename or instance ID of an active project. If this argument is omitted and only one active project exists, a connection is established with this project. If this argument describes more than one of the active projects, a dialog will be displayed to choose the desired project. Use returnOnAmbiguity to disable this dialog.

  • functionalBlock: Functional block to control upon connection to an active project. By default, no control is requested. cf. OP_FUNCTIONAL_BLOCK.

  • controlPriority: Priority with which to take control of the requested functional block. By default, normal priority is used. cf. OP_CONTROL_PRIORITY.

  • returnOnAmbiguity {bool}: Disables the dialog that allows the user to select among several active projects that partially match the project criterion. Instead of displaying dialog, E2BIG exception is thrown.

Output

  • projectId: The reference ID of the newly created project.

Exception

  • EOK: success.

  • ENOMEM: Insufficient memory.

  • EINVAL: Invalid arguments specified.

  • E2BIG: More than one possible match for project criterion in active projects.

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

  • OP_API_ECREATE_SHMEM: Error creating project selection shared memory block.

  • OP_API_ECREATE_PROCESS: Error creating the project selection process.

  • OP_API_CMD_CANCELED: Project selection was cancelled by the user.

Examples

projectId = RtlabApi.OpenProject('%RTLAB_ROOT%/Examples/Basic/rtdemo1/Simulink/rtdemo1')

Related Items

Command, OP_COMMAND, OP_FUNCTIONAL_BLOCK, OP_CONTROL_PRIORITY.

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