Versions Compared

Key

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

Group

IO

Model Preparation

Description

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

Note

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 '

Input

  • 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
  • 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.

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
Info

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

Output

Return a dictionary containing the name of the IO as a key and the status of the importation : success or skipped, if already present.

Exception

Method

return

returns 'None' if an error occurred.

Examples

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

{'OPCUA Server': 'success'}

Related Items

GetIOsConfiguration, ExportIOsConfiguration

Modules

import RtlabApi