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
Version 1
Next »
Group | Model selection |
---|
Description | Connects the API to an active model. Subsequent API calls refer to this model. When trying to establish a connection with a model when there are multiple models that correspond to the specified ModelName and ModelPath, a window is displayed prompting you to choose a model. This may occur when: - modelName is not empty. The window displays a list of active models with the specified ModelName and ModelPath, unless ReturnOnAmbiguity is set to True1.
- modelName is not empty, there is more than one active model with a specified path and name and returnOnAmbiguity is False(0).
If exactMatch is true, connection is made when the model's original file name and extension are an exact match. If exactMatch is false any extension specified in modelName is ignored. If returnOnAmbiguity is true when the specified model name is found more than once, exception E2BIG is thrown. This function is deprecated. Use OpenProject instead. |
---|
| None |
---|
Usage | (instanceId, modelState) = RtlabApi.ConnectByName(modelName, modelPath, exactMatch, systemControl, returnOnAmbiguity) (instanceId, modelState) = RtlabApi.ConnectByName(modelName) |
---|
Input | - modelName: Name of the model to which connection is desired.
- modelPath: Path where original model resides. May be empty string; used to resolve ambiguity when more than one model of the same name are active.
- exactMatch: True(1) to request an exact name match.
- systemControl: True(1) to request control of the model.
- returnOnAmbiguity: No window is displayed, an error code (E2BIG) is returned.
|
---|
Output | - instanceId: Current active model’s instance ID. See Glossary.
- modelState: Current model's state.
|
---|
Exception | - EIO: Error sending the request or receiving the reply.
- ENOENT: No active model found.
- OP_API_CMD_CANCELED: Active model(s) found but no model has been selected.
- ENOSPC: No active model with the specified name, path, and type.
- E2BIG: More than 1 active models with specified name and path (only if returnOnAmbiguity is TRUE).
- EPERM: Control requested, but already given to another client.
- ENOEXEC: Could not connect to the model. Not all of the subsystems are still active.
- ENOMEM: Internal memory allocation error.
- 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_ECREATE_SHMEM: Could not create shared memory.
- OP_API_ECREATE_PROCESS: Error launching OpalChooseModel.exe - Error displaying the dialog box. Process OpalChooseModel.exe is called by this function. This process is placed RTLAB_ROOT\common\bin folder.
- 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.
- OP_API_MODEL_IO_TIMEOUT: Timed out waiting for a reply from model.
- OP_API_MODEL_IO_ERROR: Model is missing some or all processes or subsystems.
|
---|
Examples | See the example basic_example1. |
---|
Related Items | Disconnect, SetCurrentModel, GetActiveModel |
---|
Modules | import RtlabApi |
---|