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

« Previous Version 4 Current »

Group

IO
Description

Import a list of IOs configurations from a file (*.rios) in a project

IMPORTANT: Project whose IOs are exported must be closed.

Required Control

None
Usage

ImportIOsConfiguration(project_path_dst, file_path_to_exported_ios, io_list_name_to_import=[])
Import IOs into a project specified by 'project_path_dst'.


The list of IOs to be imported comes from a file containing exported IOs (*.rios), created by using 'ExportIOsConfiguration(...)' method.
If some IOs are already present, their import will be skipped while others will be imported

IMPORTANT: Project where IOs are imported, must be closed when importing IOs.

Note: We advise specifying the path with r'<path>' format instead of "<path>" to avoid interpretation of the escape character (\t, \n...)

Parameters

  • project_path_dst {str} -- Directory path to the project where IOs are imported.
  • file_path_to_import_ios {str} -- file path to the file containing exported IOs (*.rios), created by using 'export_ios(...)' method
  • io_list_name_to_import {str/list/empty} -- Given IO or list of IOs to be imported.
  • If empty or omitted, all IOs from project 'project_path_dst' will be imported.

Returns

  • io_importation_status {dict} -- List of ios with their status of importation. (key=io_name ; value="success" or "skipped").
Input
  • project_path_dst {str} -- Directory path to the project where IOs are imported.
  • file_path_to_import_ios {str} -- file path to the file containing exported IOs (*.rios), created by using 'ExportIOsConfiguration(...)' method
  • io_list_name_to_import {str/list/empty} -- Given IO or list of IOs to be imported.
  • If empty or omitted, all IOs from project 'project_path_dst' will be imported.

Output

Return a dictionnary containing the name of the io as a key and the status of the importation : success or skipped, if already present
Exception

Method return 'None' if an error occurred

Examples

>>> r.ImportIOsConfiguration(r'C:\__WORKSPACE__\tmp\rtdemo2', r'C:\\temp\\rios\\opcua.rios')

{'OPCUA Server': 'success'}

Related ItemsGetIOsConfiguration, ExportIOsConfiguration
Modulesimport RtlabApi
  • No labels