Versions Compared

Key

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

Group

Utilities

Description

Takes

Take the control of the specified function block of the currently connected model. Only one client API at a time is granted a given function block control. See OP_FUNCTIONAL_BLOCK for more information about the available function blocks.

Example: In order to be able to take a snapshot of the running model, control of the snapshot function block should be first requested using RtlabApi.TakeFunctionControl(OP_FB_SNAPSHOT, 0, 0). As soon as the control is granted, the user can call the OpalSnapshot(...) function.

Required Control

None

Usage

RtlabApi.TakeFunctionControl(functionalBlock, fbElement, priority)

Input

  • functionalBlock: Functional block which control is to be requested. See OP_FUNCTIONAL_BLOCK.

  • fbElement: Functional block element which control is to be requested. This input is used to specify the acquisition groups or the subsystem id when the function block are OP_FB_ACQ_GROUP and OP_FB_SIGNAL respectively. Normally, this value is 0.

  • priority: Control priority to be requested. Higher is the value, higher is the priority. See OP_CONTROL_PRIORITY.

Output

None

Exception

  • EOK: Success.

  • EPERM: Control requested but already given to another client.

  • EBADF: Model not specified by previous

OpalConnect
  • Connect or

OpalSetCurrentModel
  • OpenProject.

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

  • ENOMEM: Memory allocation error.

  • EINVAL: Invalid function block.

  • ESRCH: Model instance id not found.

Examples

None

Related Items

ReleaseFunctionControl, OP_FUNCTIONAL_BLOCK, OP_CONTROL_PRIORITY.

Modules

import RtlabApi