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.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

Group

Generic
Description

Opens a project from its settings file or connects 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)


project = string or int

functionalBlock = OP_FUNCTIONAL_BLOCK

controlPriority = OP_CONTROL_PRIORITY

returnOnAmbiguity = bool

Input
  • project: 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.
  • controlPriority: Priority with which to take control of the requested functional block. By default, normal priority is used.
  • returnOnAmbiguity: 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.
ExamplesprojectId = RtlabApi.OpenProject('%RTLAB_ROOT%/Examples/Basic/rtdemo1/Simulink/rtdemo1')
Related ItemsCommand, OP_COMMAND, OP_FUNCTIONAL_BLOCK, OP_CONTROL_PRIORITY.
Modulesimport RtlabApi
  • No labels