Versions Compared

Key

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

Group

Utilities

Description

Starts

Start a python script on the selected target. The script should be copied to the target before running the command. The script and log paths should be absolute (relative paths are not supported).

The script output can be monitored using the OpalDisplay or by the OpalDisplayInformation() Api command. See the OpalDisplayInformation documentation for more details.

The function EnableContinousScriptDisplay() can be called at the beginning of the Python script to enable continuous display during execution. If this command is not called, the script standard output will be displayed only at the end of the execution.

Required Control

The API should be connected to a model before running the command.

Usage

RtlabApi.StartTargetPythonScript(targeName, targetAbsoluteScriptPath, args hostLogPathName)

Input

  • targetName: Target name where the script will be executed.

  • targetAbsoluteScriptPath: Full Path and name of the python script.

  • args: Script Arguments. This value can be set to NULL.

  • hostLogPathName: Full Path and name of the script log file on the host. This value can be set to NULL to disable logging. The standard output of the script will be written in this file.

Output

None

Exception

  • EOK: Success.

  • EFAULT: Invalid parameter.

  • ENOEXEC: Python interpreter is not found on the target or the script path does not

exists
  • exist.

  • EINVAL: Python script file does not exist.

  • EBADF: Model not specified by previous

OpalConnect
  • Connect or

OpalSetCurrentModel
  • OpenProject.

  • OP_API_EMODEL_RESPONDING: The target is down.

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

Examples

See example start_target_python_script

Related Items

OpalDisplayInformation

Modules

import RtlabApi