### Get Installed TIA Portal Bundles (Python) Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md Purpose: Gets a list of installed TIA Portal bundles. Returns: - List[ProductBundle]: List of installed bundles. ```Python def get_installed_bundles() -> List[ProductBundle] ``` -------------------------------- ### Get Installed TIA Portal Products (Python) Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md Purpose: Gets a list of installed TIA Portal products. Returns: - List[Product]: List of installed products. ```Python def get_installed_products() -> List[Product] ``` -------------------------------- ### Get Software Units List (Python) Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md Purpose: Get list of software units. Returns: - List[SoftwareUnit]: List of software units. ```Python def get_software_units() -> List[SoftwareUnit] ``` -------------------------------- ### Get Safety Administration (Python) Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md Purpose: Get safety administration. ```Python def get_safety_administration() ``` -------------------------------- ### Get Type Version GUID Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md 获取类型版本的GUID。此函数返回一个字符串,表示PLC对象类型版本的全局唯一标识符。 ```python def get_type ``` -------------------------------- ### Open TIA Portal Instance (Python) Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md Purpose: Opens a new TIA Portal instance. Parameters: - portal_mode: Optional, Enums.PortalMode, with or without user interface. - version: Optional, string, TIA Portal version number, format major.minor, e.g., "18.0" (defaults to the latest installed TIA Portal version). Returns: - Portal: TIA Portal instance. ```Python def open_portal(portal_mode: Optional[Enums.PortalMode] = None, version: Optional[str] = None) -> Portal ``` -------------------------------- ### Get All Object Properties (Python) Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md Purpose: Gets all properties of the object. Returns: - List[str]: List of property names. ```Python def get_properties() -> List[str] ``` -------------------------------- ### Attach to Running TIA Portal Instance (Python) Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md Purpose: Attaches to a running TIA Portal instance. Parameters: - portal_mode: Optional, Enums.PortalMode, with or without user interface. - version: Optional, string, TIA Portal version number, format major.minor, e.g., "18.0" (defaults to the latest installed TIA Portal version). Returns: - Portal: TIA Portal instance. ```Python def attach_portal(portal_mode: Optional[Enums.PortalMode] = None, version: Optional[str] = None) -> Portal ``` -------------------------------- ### Get TIA Portal Process ID (Python) Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md Purpose: Gets the TIA Portal process ID. Returns: - int: TIA Portal process ID. ```Python def get_process_id() -> int ``` -------------------------------- ### Get Object Property (Python) Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md Purpose: Gets a property of the object. Non-string properties will be converted to string if possible. Parameters: - name: string, property name. Returns: - str: String representation of the property value. ```Python def get_property(name: str) -> str ``` -------------------------------- ### Compile Program Block Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md 编译程序块。此函数用于执行程序块的编译操作。 ```python def compile() ``` ```APIDOC compile() Description: 编译程序块 ``` -------------------------------- ### Import Software Units to PLC (Python) Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md Purpose: Import software units from directory to PLC. Parameters: - import_root_directory: string, import root directory. ```Python def import_software_units(import_root_directory: str) ``` -------------------------------- ### Export Program Block Cross References Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md 导出程序块的交叉引用。此函数需要目标目录路径和一个整数过滤器来指定要导出的交叉引用类型。 ```python def export_cross_references(target_directory_path: str, filter: int) ``` ```APIDOC export_cross_references(target_directory_path: str, filter: int) Description: 导出程序块的交叉引用 Parameters: target_directory_path: str - 目标目录路径 filter: int - 1: 'AllObjects', 2: 'ObjectsWithReferences', 3: 'ObjectsWithoutReferences', 4: 'UnusedObjects' ``` -------------------------------- ### Open TIA Portal Project with Copy (Python) Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md Purpose: Opens a TIA Portal project or local session in a separate folder. Parameters: - project_file_path: string, full path to the project file. - target_directory_path: string, temporary path where the project should be copied. - delete_existing_project: boolean, defines whether the temporary project should be deleted. Returns: - Project: TIA Portal project. ```Python def open_project_with_copy(project_file_path: str, target_directory_path: str, delete_existing_project: bool) -> Project ``` -------------------------------- ### Open or Attach TIA Portal Project (Python) Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md Purpose: Attaches to a running TIA Portal instance with an open project, or opens the project with a new instance of the appropriate TIA Portal version. Parameters: - project_file_path: string, full path to the project file. - portal_mode: Optional, Enums.PortalMode, with or without user interface. Returns: - Project: TIA project instance. ```Python def open_attach_project(project_file_path: str, portal_mode: Optional[Enums.PortalMode] = None) -> Project ``` -------------------------------- ### Open TIA Portal Project (Python) Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md Purpose: Opens a TIA Portal project or local session - optionally in server view. Parameters: - project_file_path: string, full path to the project file. - server_project_view: Optional, boolean, defaults to False, if set to True, opens in server project view. Returns: - Project: TIA Portal project. ```Python def open_project(project_file_path: str, server_project_view: Optional[bool] = None) -> Project ``` -------------------------------- ### Import Watch Tables to PLC (Python) Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md Purpose: Import watch tables from directory to PLC. Parameters: - import_root_directory: string, import root directory. ```Python def import_watch_tables(import_root_directory: str) ``` -------------------------------- ### Import Technology Objects to PLC (Python) Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md Purpose: Import technology objects from directory to PLC. Parameters: - import_root_directory: string, import root directory. ```Python def import_technology_objects(import_root_directory: str) ``` -------------------------------- ### Import Blocks to PLC (Python) Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md Purpose: Import blocks from directory to PLC. Parameters: - import_root_directory: string, import root directory. ```Python def import_blocks(import_root_directory: str) ``` -------------------------------- ### Import PLC Tags to PLC (Python) Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md Purpose: Import PLC tags from directory to PLC. Parameters: - import_root_directory: string, import root directory. ```Python def import_plc_tags(import_root_directory: str) ``` -------------------------------- ### Check Program Block Consistency Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md 检查程序块是否一致。此函数返回一个布尔值,指示程序块的当前一致性状态。 ```python def is_consistent() -> bool ``` ```APIDOC is_consistent() -> bool Description: 检查程序块是否一致 Returns: bool - 如果一致则为True ``` -------------------------------- ### Show PLC Object in Editor Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md 在编辑器中打开PLC对象。此函数用于在TIA Portal编辑器中显示指定的PLC对象。 ```python def show_in_editor() ``` ```APIDOC show_in_editor() Description: 在编辑器中打开PLC对象 ``` -------------------------------- ### Export PLC Object Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md 导出PLC对象。此函数允许将PLC对象导出到指定目录,并提供选项来控制导出格式和是否保留文件夹结构。它需要目标路径、导出选项,并可选择指定导出格式和是否保持文件夹结构。 ```python def export(target_directory_path: str, export_options: Enums.ExportOptions, export_format: Optional[Enums.ExportFormats] = None, keep_folder_structure: Optional[bool] = None) ``` ```APIDOC export(target_directory_path: str, export_options: Enums.ExportOptions, export_format: Optional[Enums.ExportFormats] = None, keep_folder_structure: Optional[bool] = None) Description: 导出PLC对象 Parameters: target_directory_path: str - 目标目录路径 export_options: Enums.ExportOptions - 导出选项 export_format: Optional[Enums.ExportFormats] - 导出格式 keep_folder_structure: Optional[bool] - 如果设置为True, 所有组名将以文件夹层次结构表示 ``` -------------------------------- ### Import Data Types to PLC (Python) Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md Purpose: Import data types from directory to PLC. Parameters: - import_root_directory: string, import root directory. ```Python def import_data_types(import_root_directory: str) ``` -------------------------------- ### Create and Print PLC Safety Print (Python) Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md Purpose: Creates a safety print of the PLC and prints it to a file. If the file already exists, it will be overwritten. Parameters: - print_file: string, print file path. Returns: - bool: True on success. ```Python def safety_print(print_file: str) -> bool ``` -------------------------------- ### Set Logging Output (Python) Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md Purpose: Sets the log output path or console (stdout) output. Parameters: - path: string, log path. - console: boolean, whether to output to console. ```Python def set_logging(path: str, console: bool) ``` -------------------------------- ### Set UMAC Credentials (Python) Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md Purpose: Sets UMAC credentials for protected libraries or projects. Parameters: - user_name: string, username. - user_password: string, user password. - user_type: Enums.UmacUserMode, user type. ```Python def set_umac_credentials(user_name: str, user_password: str, user_type: Enums.UmacUserMode) ``` -------------------------------- ### ExportOptions Enum (APIDOC) Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md Purpose: Enumeration types used in TIA Scripting Python. ```APIDOC class ExportOptions(enum.Enum): WithDefaults = 0 Nan = 1 WithReadOnly = 2 ``` -------------------------------- ### ExportFormats Enum (APIDOC) Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md Purpose: Enumeration types used in TIA Scripting Python. ```APIDOC class ExportFormats(enum.Enum): SimaticML = 0 ExternalSource = 1 SimaticSD = 2 ``` -------------------------------- ### PortalMode Enum (APIDOC) Source: https://github.com/archertheone/openness_python_api/blob/main/opennesss_python_api.md Purpose: Enumeration types used in TIA Scripting Python. Values: - WithGraphicalUserInterface: 0, With graphical user interface. - WithoutGraphicalUserInterface: 1, Without graphical user interface. - AnyUserInterface: 2, Any user interface. ```APIDOC class PortalMode(enum.Enum): WithGraphicalUserInterface = 0 WithoutGraphicalUserInterface = 1 AnyUserInterface = 2 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.