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

Version 1 Next »

Group

Utilities
Description

Starts 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.
  • EINVAL: Python script file does not exist.
  • EBADF: Model not specified by previous OpalConnect or OpalSetCurrentModel.
  • OP_API_EMODEL_RESPONDING: The target is down.
  • EIO: Error sending the request or receiving the reply.
ExamplesSee example start_target_python_script
Related ItemsOpalDisplayInformation
Modulesimport RtlabApi
  • No labels