TIA Scripting Python DOC V107 en
TIA Scripting Python DOC V107 en
Legal information
Use of application examples
Application examples illustrate the solution of automation tasks through an interaction of several components in
the form of text, graphics and/or software modules. The application examples are a free service by Siemens AG
and/or a subsidiary of Siemens AG ("Siemens"). They are non-binding and make no claim to completeness or
functionality regarding configuration and equipment. The application examples merely offer help with typical
tasks; they do not constitute customer-specific solutions. You yourself are responsible for the proper and safe
operation of the products in accordance with applicable regulations and must also check the function of the
respective application example and customize it for your system.
Siemens grants you the non-exclusive, non-sublicensable and non-transferable right to have the application
examples used by technically trained personnel. Any change to the application examples is your responsibility.
Sharing the application examples with third parties or copying the application examples or excerpts thereof is
permitted only in combination with your own products. The application examples are not required to undergo the
customary tests and quality inspections of a chargeable product; they may have functional and performance
defects as well as errors. It is your responsibility to use them in such a manner that any malfunctions that may
occur do not result in property damage or injury to persons.
Disclaimer of liability
Siemens shall not assume any liability, for any legal reason whatsoever, including, without limitation, liability for
the usability, availability, completeness and freedom from defects of the application examples as well as for
related information, configuration and performance data and any damage caused thereby. This shall not apply in
cases of mandatory liability, for example under the German Product Liability Act, or in cases of intent, gross
negligence, or culpable loss of life, bodily injury or damage to health, non-compliance with a guarantee,
fraudulent non-disclosure of a defect, or culpable breach of material contractual obligations. Claims for damages
arising from a breach of material contractual obligations shall however be limited to the foreseeable damage
typical of the type of agreement, unless liability arises from intent or gross negligence or is based on loss of life,
bodily injury or damage to health. The foregoing provisions do not imply any change in the burden of proof to
© Siemens AG 2024 All rights reserved
your detriment. You shall indemnify Siemens against existing or future claims of third parties in this connection
except where Siemens is mandatorily liable.
By using the application examples you acknowledge that Siemens cannot be held liable for any damage beyond
the liability provisions described.
Other information
Siemens reserves the right to make changes to the application examples at any time without notice. In case of
discrepancies between the suggestions in the application examples and other Siemens publications such as
catalogs, the content of the other documentation shall have precedence.
The Siemens terms of use (https://support.industry.siemens.com) shall also apply.
Security information
Siemens provides products and solutions with industrial security functions that support the secure operation of
plants, systems, machines and networks.
In order to protect plants, systems, machines and networks against cyber threats, it is necessary to implement –
and continuously maintain – a holistic, state-of-the-art industrial security concept. Siemens’ products and
solutions constitute one element of such a concept.
Customers are responsible for preventing unauthorized access to their plants, systems, machines and networks.
Such systems, machines and components should only be connected to an enterprise network or the internet if
and to the extent such a connection is necessary and only when appropriate security measures (e.g. firewalls
and/or network segmentation) are in place.
For additional information on industrial security measures that may be implemented, please visit
https://www.siemens.com/industrialsecurity.
Siemens’ products and solutions undergo continuous development to make them more secure. Siemens strongly
recommends that product updates are applied as soon as they are available and that the latest product versions
are used. Use of product versions that are no longer supported, and failure to apply the latest updates may
increase customer’s exposure to cyber threats.
To stay informed about product updates, subscribe to the Siemens Industrial Security RSS Feed under
https://www.siemens.com/cert.
Table of contents
Legal information .............................................................................................................................. 2
1 TIA Scripting Python .............................................................................................................. 9
1.1 TIA Portal programming interface ............................................................................. 9
1.2 Prerequisites .............................................................................................................. 9
1.2.1 Installed software ....................................................................................................... 9
1.3 Python environment ................................................................................................... 9
1.3.1 Python installation ..................................................................................................... 9
1.3.2 Python Quickstart ...................................................................................................... 9
1.4 Managing rights of TIA Portal Openness ................................................................ 10
1.4.1 Add user to Siemens TIA Openness group ............................................................. 10
1.4.2 Openness security-dialog ........................................................................................ 10
1.5 How to use TIA Scripting Python ............................................................................. 10
1.5.1 Use TIA Scripting Python via file import .................................................................. 10
1.5.2 Use TIA Scripting Python as Python package......................................................... 10
1.6 Scripts ...................................................................................................................... 11
1.7 Create an Executable from your script .................................................................... 12
1.8 Hierarchy ................................................................................................................. 13
2 Function List.......................................................................................................................... 14
© Siemens AG 2024 All rights reserved
2.11.2 get_folders()............................................................................................................. 31
2.11.3 get_types() ............................................................................................................... 31
2.11.4 find_library_type(library_type_name: str) ................................................................ 31
2.11.5 find_folder(folder_name: str) ................................................................................... 31
2.12 Library - LibraryTypeVersion ................................................................................... 32
2.12.1 get_author() ............................................................................................................. 32
2.12.2 get_guid()................................................................................................................. 32
2.12.3 get_version_number() ............................................................................................. 32
2.12.4 get_modified_date() ................................................................................................. 32
2.12.5 get_state()................................................................................................................ 32
2.12.6 get_type_object() ..................................................................................................... 32
2.12.7 get_property(name: str) ........................................................................................... 32
2.12.8 get_properties() ....................................................................................................... 33
2.13 Library - ProjectLibrary ............................................................................................ 33
2.13.1 get_type_folder() ..................................................................................................... 33
2.14 PLC Data - ExternalSource ..................................................................................... 33
2.14.1 get_name() .............................................................................................................. 33
2.14.2 get_property(name: str) ........................................................................................... 33
2.14.3 block_gen() .............................................................................................................. 33
2.14.4 delete() ..................................................................................................................... 33
2.14.5 get_properties() ....................................................................................................... 34
2.15 PLC Data - ForceTable ............................................................................................ 34
2.15.1 get_name() .............................................................................................................. 34
2.15.2 get_property(name: str) ........................................................................................... 34
2.15.3 export(target_directory_path: str, export_options: Enums.ExportOptions,
export_format: Optional[Enums.ExportFormats] = None,
keep_folder_structure: Optional[bool] = None ) ...................................................... 34
2.15.4 is_consistent().......................................................................................................... 35
2.15.5 show_in_editor() ...................................................................................................... 35
2.15.6 get_properties() ....................................................................................................... 35
2.16 PLC Data - NamedValueType .................................................................................35
2.16.1 get_name() ..............................................................................................................35
2.16.2 get_namespace() .....................................................................................................35
TIA Scripting Python
Entry-ID: 109742322, V1.0.7, 11/2024 Generated with Code2Docu 5
Table of contents
1.2 Prerequisites
1.2.1 Installed software
To check if you have Python installed on a Windows PC, search in the start bar for Python or
run the following on the Command Line (cmd.exe):
python --version
Python is an interpreted programming language, which means that as developers write Python
(.py) files in a text editor and then put those files into the Python interpreter to be executed.
The way to run a Python file is like this on the command line:
python helloworld.py
When you install TIA Portal Openness on the PC, the “Siemens TIA Openness” user group is
automatically created.
Whenever you access the TIA Portal with your TIA Portal Openness application, the TIA Portal
verifies that you are a member of the “Siemens TIA Openness” user group, either directly or
indirectly by way of another user group. If you are a member of the “Siemens TIA Openness”
user group, the TIA Portal Openness application starts and establishes a connection to the TIA
Portal.
Follow the instructions within the Openness manual for detailed instructions.
When you use the application the first time and it connects to TIA Portal via TIA Portal
Openness, TIA Portal will prompt you to accept or reject the connection via a security dialog:
• If you just want to connect your TIA Portal Openness application to the TIA Portal once,
click “Yes” at the prompt. The next time your TIA Portal Openness application tries to
connect the TIA Portal, the prompt will be shown again.
• To create a whitelist entry for your TIA Portal Openness application follow these steps:
– Click “Yes to all” at the prompt to display an User Account Control Dialog.
© Siemens AG 2024 All rights reserved
– Click “Yes” at the User Account Control Dialog to add your application to the whitelist in
the windows registry and to attach the application to the TIA Portal.
Further information can be found in the Openness manual.
You can install TIA Scripting Python as Python package. Install the package with pip (Python
package manager):
pip install siemens_tiaportal_scripting-x.x.x-cp312-cp312-win_amd64.whl
This will install TIA Scripting Python as Python package default at users Python site packages
folders.
Intellisense Support
Intellisense support can be used only if you install TIA Scripting Python as Python package.
Pylance language server (Python Intellisense) is able to provide full Intellisense Support.
Pylance is default by Visual Studio Code Python Plugin and Microsoft Visual Studio Python.
Other Language servers like “Jedi” are currently untested.
1.6 Scripts
The folder “Scripts” contains example scripts which are using TIA Scripting Python to interact
with TIA Portal.
Script Description
attacher.py Attaches to the currently running TIA Portal instance (with user-interface) and
© Siemens AG 2024 All rights reserved
gets the opened project. It prints the names of all available PLCs and opens the
device editor of the first PLC.
exporter.py Enumerates all software-elements of a PLC and exports them to the configured
folder.
importer.py Imports all exported elements to a PLC.
upgrader.py Upgrades the project to a higher version of TIA Portal. The process compiles the
hardware and software. Hardware can also be upgraded to newest firmware
version.
When building a Python executable, it's important to ensure that local binaries (such as
siemens_tia_scripting.pyd) are used instead of any globally installed packages. The following
instructions will guide you through the process of achieving this using PyInstaller.
To ensure your Python script loads local binaries, include the following code. This will
dynamically locate the .pyd file bundled with the executable:
import importlib.util
import os
import sys
get_file_path(): This function ensures that the correct local version of the binary file is used,
especially when the script is packaged into an executable.
The code dynamically loads the .pyd binary, ensuring that local binaries are used, bypassing
any globally installed packages.
you can use the following PyInstaller command to build the executable directly from the
command line:
pyinstaller -F /mytiascript.py --workpath /temp -n MyTiaExecutable --clean --distpath
./output --add-data "../dep/:."
1.8 Hierarchy
The overview shows the available models and their dependency to each other. Accessing a
program block from a PLC requires that a TIA Portal connection is established, a project opened
and a controller object selected.
© Siemens AG 2024 All rights reserved
2 Function List
The first lines of any script should import the TIA Scripting Python, whereas the previously
defined system environment variable is used therefore.
sys.path.append(os.getenv('TIA_SCRIPTING'))
import siemens_tia_scripting
If the import was successful, the appropriate methods from TIA Scripting Python can be used.
2.1.1 get_name()
2.1.2 open_device_editor()
© Siemens AG 2024 All rights reserved
2.1.3 compile_hardware()
2.1.4 compile_software()
hmi.upgrade_hardware(full_upgrade = True)
2.1.7 get_properties()
This represents a PLC (Programmable Logical Controller). It allows for controlling and
interacting with the PLC, including downloading, comparing online and offline states, and
retrieving information about PLC elements.
2.2.1 get_name()
2.2.2 open_device_editor()
2.2.3 get_online_state()
2.2.4 go_offline()
2.2.9 update_module_description()
2.2.10 compile_hardware()
2.2.11 compile_software()
With full upgrade: from CPU1511F 6ES7 511-1FK00-0AB0 V1.7 to 6ES7 511-1FL03-0AB0
V3.0.
Parameters Type Description
full_upgrade bool Set if for full upgrade (latest order number and firmware version)
plc.upgrade_hardware(full_upgrade = True)
2.2.13 compare_to_online()
2.2.15 get_system_blocks()
ext_sources = plc.get_external_sources()
2.2.18 get_force_tables()
tables = plc.get_force_tables()
tables = plc.get_watch_tables()
tos = plc.get_technology_objects()
2.2.21 get_software_units()
2.2.22 get_safety_administration()
plc.import_blocks(import_root_directory = "C:\\ws\\importfolder\\PLC_1\\Program
blocks")
plc.import_technology_objects(import_root_directory =
"C:\\ws\\importfolder\\PLC_1\\Technology objects")
plc.import_watch_tables(import_root_directory = "C:\\ws\\importfolder\\PLC_1\\Watch
and force tables")
plc.import_software_units(import_root_directory =
"C:\\ws\\importfolder\\PLC_1\\Software Units")
plc.safety_print(print_file = "C:\\ws\\safetyprint\\F_PLC_Printout.pdf")
2.2.31 get_properties()
2.3 Enums
2.3.1 PortalMode
2.3.2 UmacUserMode
2.3.3 ExportFormats
2.3.4 ExportOptions
Open a new TIA Portal instance Version-string in format major.minor e.g. "18.0"
Returns → Portal TIA Portal instance
Parameters Type Description
portal_mode Enums.PortalMode With or without user-interface
version str Version string of TIA Portal to be
used in format major.minor e.g.
18.0, (Latest installed TIA Portal
version by default)
Example usage
portal = siemens_tia_scripting.open_portal(portal_mode =
siemens_tia_scripting.Enums.PortalMode.WithGraphicalUserInterface, version = "18.0")
Attach to running TIA Portal instance Version-string in format major.minor e.g. "18.0"
Returns → Portal TIA Portal instance
Parameters Type Description
portal_mode Enums.PortalMode With or without user-interface
version str Version string of TIA Portal to be
used in format major.minor e.g.
18.0, (Latest installed TIA Portal
version by default)
portal = siemens_tia_scripting.attach_portal(portal_mode =
Enums.PortalMode.WithGraphicalUserInterface, version = "18.0")
Optional[Enums.PortalMode] = None)
Attach to running TIA Portal instance with already open project Or opens the project with a new
instance of fitting TIA Portal version
Returns → Project TIA Project instance
Parameters Type Description
project_file_path str Full path of the project file
portal_mode Enums.PortalMode With or without user-interface
project = siemens_tia_scripting.open_attach_project(project_file_path =
"C:\\ws\\testproj\\testproj.ap17", portal_mode =
siemens_tia_scripting.Enums.PortalMode.WithGraphicalUserInterface)
2.4.4 get_installed_bundles()
2.4.5 get_installed_products()
Set UMAC Credentials which will be used for protected libraries or projects
Parameters Type Description
user_name str User name
user_password str Password of the user
user_type Enums.UmacUserMode Project or global user
2.5.1 get_process_id()
project = portal.open_project_with_copy(project_file_path =
"C:\\ws\\testproj\\testproj.ap17", target_directory_path = "C:\\ws\\temp" ,
delete_existing_project = True)
project = portal.retrieve_archive(archive_file_path =
"C:\\ws\\testproj\\testproj.zap17", target_directory_path = "C:\\ws\\temp" ,
delete_existing_project = True)
2.5.6 get_project()
Get opened TIA Portal project of the current TIA Portal instance
© Siemens AG 2024 All rights reserved
global_lib = portal.open_global_library(library_path =
"C:\\ws\\testlib\\testlib.al17")
global_lib = portal.open_global_library_with_copy(target_directory_path =
"C:\\ws\\temp", library_path = "C:\\ws\\testlib\\testlib.al17",
delete_existing_project = True)
2.5.11 close_portal()
portal.close_global_library(global_library_name = "GlobalLib1")
portal.get_project_servers(host_filter = "CompanyServer")
portal.get_project_server(url = "https://project.server.net:8735/")
2.5.15 detach()
2.6.1 get_name()
2.6.2 get_release()
2.6.3 get_version()
2.7.1 get_title()
2.7.2 get_release()
2.7.3 get_products()
2.8.1 get_name()
2.8.2 save()
2.8.3 get_author()
2.8.4 get_path()
2.8.5 get_library_type_folder()
Get the folder containing library types & library type folders
Returns → LibraryTypeFolder Library type folder
library_type = global_lib.get_library_type_folder()
2.8.6 is_modified()
2.8.7 is_read_only()
2.8.12 get_properties()
2.9.1 get_name()
2.9.3 get_properties()
2.10.1 get_name()
2.10.2 get_author()
author = lib_type.get_author()
2.10.3 get_guid()
guid = lib_type.get_guid()
2.10.4 get_versions()
2.10.7 get_properties()
2.11.1 get_name()
name = lib_folder.get_name()
2.11.2 get_folders()
© Siemens AG 2024 All rights reserved
2.11.3 get_types()
2.12.1 get_author()
2.12.2 get_guid()
2.12.3 get_version_number()
version_number = lib_type_version.get_version_number()
2.12.4 get_modified_date()
date = lib_type_version.get_modified_date()
2.12.5 get_state()
2.12.6 get_type_object()
2.12.8 get_properties()
2.13.1 get_type_folder()
Get the folder containing library types & library type folders
Returns → LibraryTypeFolder Library type folder
typefolder = projectlib.get_type_folder()
The class represents an external source in TIA Portal. It provides methods for getting
information about the external source, retrieving properties and generating blocks.
2.14.1 get_name()
2.14.3 block_gen()
2.14.4 delete()
2.14.5 get_properties()
2.15.1 get_name()
2.15.4 is_consistent()
2.15.5 show_in_editor()
2.15.6 get_properties()
The class represents a Named value data type (NVT) in TIA Portal. It provides methods for
managing and controlling Named value data types, exporting the data type, retrieving data type
information and checking cross-references.
2.16.1 get_name()
name = nvt.get_name()
2.16.2 get_namespace()
nvt.export(target_directory_path = "C:\\ws\\export")
2.17.1 get_name()
2.17.4 delete()
2.17.5 get_properties()
2.18.1 get_name()
2.18.4 get_plc_tags()
2.18.5 get_user_constants()
constants = table.get_user_constants()
Export cross references of the PLC tag table filter → integer - [1: ‘AllObjects’, 2:
‘ObjectsWithReferences’, 3: ‘ObjectsWithoutReferences’, 4: ‘UnusedObjects’]
Parameters Type Description
target_directory_path str Folder path for the export
filter integer (enum) [1: ‘AllObjects’, 2:
‘ObjectsWithReferences’, 3:
‘ObjectsWithoutReferences’, 4:
‘UnusedObjects’]
table.export_cross_references(target_directory_path =
"C:\\ws\\exportcrossreferences", filter = 2)
2.18.7 show_in_editor()
2.18.8 delete()
2.18.9 get_properties()
2.19.1 get_name()
Enums.ExportOptions.WithDefaults)
2.19.4 compile()
2.19.5 is_consistent()
value = programblock.is_consistent()
Export cross references of the program block filter → integer - [1: ‘AllObjects’, 2:
‘ObjectsWithReferences’, 3: ‘ObjectsWithoutReferences’, 4: ‘UnusedObjects’]
Parameters Type Description
target_directory_path str Folder path for the export
filter integer (enum) [1: ‘AllObjects’, 2:
‘ObjectsWithReferences’, 3:
‘ObjectsWithoutReferences’, 4:
‘UnusedObjects’]
programblock.export_cross_references(target_directory_path =
"C:\\ws\\exportcrossreferences", filter = 2)
2.19.7 show_in_editor()
2.19.8 get_type_version_guid()
2.19.9 get_type_guid()
2.19.10 delete()
tiap_object.delete()
2.19.11 get_properties()
2.20.1 is_logged_on()
2.20.2 is_password_set()
Check if the safety administration has a password set for the safety offline program
Returns → bool Status if password is set
status = safety_admin.is_password_set()
2.20.3 get_offline_serial_number()
safety_admin.export_config(target_directory_path = "C:\\ws\\export")
safety_admin.import_config(import_root_directory =
"C:\\ws\\exported\\SafetyAdministration")
2.21.1 get_name()
2.21.2 compile()
software_unit.export_configuration(target_directory_path = "C:\\ws\\export")
2.21.4 get_plc_tag_tables()
2.21.5 get_program_blocks()
2.21.6 get_system_blocks()
2.21.7 get_user_data_types()
© Siemens AG 2024 All rights reserved
2.21.8 get_external_sources()
2.21.9 get_named_value_types()
Export cross references of the software unit object filter → integer - [1: ‘AllObjects’, 2:
‘ObjectsWithReferences’, 3: ‘ObjectsWithoutReferences’, 4: ‘UnusedObjects’]
Parameters Type Description
target_directory_path str Folder path for the export
filter integer (enum) [1: ‘AllObjects’,
2: ‘ObjectsWithReferences’,
3: ‘ObjectsWithoutReferences’,
4: ‘UnusedObjects’]
software_unit.export_cross_references(target_directory_path =
"C:\\ws\\exportcrossreferences", filter = 2)
2.21.12 get_properties()
properties = tiap_object.get_properties()
2.22.1 get_name()
name = plc_object.get_name()
2.22.4 compile()
2.22.5 is_consistent()
Export cross references of the system block filter → integer - [1: ‘AllObjects’, 2:
‘ObjectsWithReferences’, 3: ‘ObjectsWithoutReferences’, 4: ‘UnusedObjects’]
Parameters Type Description
target_directory_path str Folder path for the export
© Siemens AG 2024 All rights reserved
systemblock.export_cross_references(target_directory_path =
"C:\\ws\\exportcrossreferences", filter = 2)
2.22.7 show_in_editor()
2.22.8 delete()
2.22.9 get_properties()
2.23.1 get_name()
2.23.4 compile()
2.23.5 is_consistent()
2.23.6 delete()
2.23.7 get_properties()
2.24.1 get_name()
2.24.4 delete()
2.24.5 get_properties()
2.25.1 get_name()
name = plc_object.get_name()
2.25.4 compile()
2.25.5 is_consistent()
Export the cross references of the PLC data type filter → integer - [1: ‘AllObjects’, 2:
‘ObjectsWithReferences’, 3: ‘ObjectsWithoutReferences’, 4: ‘UnusedObjects’]
Parameters Type Description
target_directory_path str Folder path for the export
filter integer (enum) [1: ‘AllObjects’,
2: ‘ObjectsWithReferences’,
3: ‘ObjectsWithoutReferences’,
4: ‘UnusedObjects’]
© Siemens AG 2024 All rights reserved
udt.export_cross_references(target_directory_path = "C:\\ws\\exportcrossreferences",
filter = 2)
2.25.7 get_type_version_guid()
2.25.8 get_type_guid()
2.25.9 delete()
2.25.10 get_properties()
2.26.1 get_name()
2.26.4 is_consistent()
2.26.5 show_in_editor()
2.26.6 delete()
2.26.7 get_properties()
2.27.1 get_portal()
2.27.2 save()
2.27.3 close()
project.set_simulation_support(value = True)
Save the TIA Portal project under another path and name
Returns → str Full path of the saved project
Parameters Type Description
target_directory_path str Folder path where project should
be saved
project_name str Name of the project name
result = project.export_cax_data(export_file_path =
"C:\\ws\\exportfolder\\exportCAX.aml", log_file_path =
"C:\\ws\\exportfolder\\exportCAX.log")
result = project.import_cax_data(import_file_path =
"C:\\ws\\importfolder\\importCAX.aml", log_file_path =
"C:\\ws\\importfolder\\importCAX.log")
2.27.9 open_topology_editor()
Open the topology editor in TIA Portal for the TIA Portal project
project.open_topology_editor()
2.27.10 open_network_editor()
Open the network editor in TIA Portal for the TIA Portal project
project.open_network_editor()
2.27.11 get_plcs()
2.27.12 get_hmis()
2.27.13 get_application_tests()
Get a list of Test Suite application tests in the TIA Portal project
Needs Test Suite installed and licensed.
Returns → List[ApplicationTest] All Application tests as list
© Siemens AG 2024 All rights reserved
tests = project.get_application_tests()
2.27.14 get_system_tests()
Get a list of Test Suite system tests in the TIA Portal project
Needs Test Suite installed and licensed.
Returns → List[SystemTest] All System tests as list
tests = project.get_system_tests()
2.27.15 get_rule_sets()
Get a list of Test Suite Styleguide rule sets in the TIA Portal project
Needs Test Suite installed and licensed.
Returns → List[RuleSet] All Rule sets as list
rule_sets = project.get_rule_sets()
2.27.16 get_project_library()
2.27.17 web_block_generate()
Upgrade the devices to the latest order number and firmware version
If full_upgrade is set to True, all devices will be changed to the newest available order number
(Device type) and firmware:
from CPU1511F 6ES7 511-1FK00-0AB0 V1.7 to 6ES7 511-1FK00-0AB0 V1.8.
With full upgrade: from CPU1511F 6ES7 511-1FK00-0AB0 V1.7 to 6ES7 511-1FL03-0AB0
V3.0.
Parameters Type Description
full_upgrade bool Set if for full upgrade (latest
order number and firmware
version)
project.upgrade_hardware(full_upgrade = True)
2.27.19 sivarc_generate()
Start SiVArc-generation
SiVArc must be installed and licensed.
project.sivarc_generate()
© Siemens AG 2024 All rights reserved
2.27.20 update_module_description()
project.set_virtual_plc_support(value = "True")
project.import_umac_config(import_file_path =
"C:\\ws\\importfolder\\importUMAC.json", secret_env_name = "MYSECRETENV")
Export UMAC and UMC configuration from the TIA Portal project
If export file already exists, it will be overwritten
Parameters Type Description
export_file_path str Full path of the export file
project.export_umac_config(export_file_path =
"C:\\ws\\exportfolder\\exportUMAC.json")
Encrypt UMAC and UMC configuration from the TIA Portal project with provided secret
Parameters Type Description
umac_file_path str Full path of the umac config file
secret str Secret for the encryption
secret_env_name str Name of the environment
variable where secret value is
stored
project.encrypt_umac_config(umac_file_path = "C:\\ws\\exportfolder\\exportUMAC.json",
secret = "mySecret")
© Siemens AG 2024 All rights reserved
project.import_password_policy(import_file_path =
"C:\\ws\\importfolder\\PWPolicy.json")
project.export_password_policy(export_file_path =
"C:\\ws\\exportfolder\\exportPWPolicy.json")
2.27.27 delete()
project.end_transaction()
project.update_transaction(dialog_text = "MyNewExclusiveAccess")
2.27.32 get_properties()
2.28.1 get_host()
2.28.2 get_port()
2.28.3 get_server_name()
name = server_project.get_server_name()
2.28.4 print_info()
2.28.6 get_properties()
2.29.1 get_name()
app_test.export(target_directory_path = "C:\\ws\\export")
app_test.set_scope(plc_name = "PLC_1")
2.30.1 get_name()
Get the name of the Test Suite style guide rule set
Return → str Name of the rule set
name = rule.get_name()
Get the property of the Test Suite style guide rule set
Properties which are not string will be converted to string if possible.
Returns → str Value of the property as string
Parameters Type Description
name str Property of the rule set
rule.export(target_directory_path = "C:\\ws\\export")
2.31.1 get_name()
name = sys_test.get_name()
sys_test.export(target_directory_path = "C:\\ws\\export")
sys_test.set_scope(opcua_server_address = "opc.tcp://server.port/path",
opcua_server_interface_type = 1 )
2.31.5 get_properties()
3 Appendix
• Support
In Support, you can find all information helpful for resolving technical issues with our products.
• mySieportal
mySiePortal collects all your personal data and processes, from your account to current orders, service requests and
more. You can only see the full range of functions here after you have logged in.
You can access SiePortal via this address: sieportal.siemens.com
Technical Support
The Technical Support of Siemens Industry provides you fast and competent support regarding all technical queries with
numerous tailor-made offers – ranging from basic support to individual support contracts.
Please send queries to Technical Support via Web form: support.industry.siemens.com/cs/my/src