Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Group

Model selection

Description

Returns

Return an opaque handle associated with a new connection, which becomes the current connection. The new connection is uninitialized, and its state is the same as for a new process or thread.

This handle can be passed back to a subsequent SetConnHandle. This call is only required when a thread must handle multiple connections. There is no need to call this function when a thread handles only one connection. There is no harm in doing so, as long as it is the first call made to RT-LAB API done by that thread. Changing this connection (e.g. by calling Connect or

SetCurrentModel

OpenProject) does not change the other connections, whereas one of those calls without first calling NewConnHandle implicitly disconnects a previously existing connection.

Required Control

System control

Usage

handle = RtlabApi.NewConnHandle()

Input

None

Output

  • handle: handle of the new connection

Exception

  • EOK: success.

  • ENOMEM: memory allocation error.

  • E2BIG: too many open connections for this process.

Examples

See multi_models

Related Items

GetConnHandle, SetConnHandle, DeleteConnHandle.

Modules

import RtlabApi