Auf PLC mit VoT laden - TIAPortal

TIA Portal Openness: API für die Automatisierung von Engineering-Workflows

ft:publication_title
TIA Portal Openness: API für die Automatisierung von Engineering-Workflows
Product
TIAPortal
Version
V20
Publication date
01/2025
Language
de-DE
Auf PLC mit VoT laden

Voraussetzung

Einleitung

Sie können mit TIA Portal Openness eine Webapplikation laden, aktualisieren und löschen, während Sie die relevante PLC laden.

Sie können DownloadConfiguration verwenden, um eine Webapplikation zu laden, zu aktualisieren und zu löschen. Weitere Informationen zu DownloadConfiguration finden Sie unter Herunterladen zu den PLCs

Hinweis

Wird eine VoT neu geladen, wird der preDownloadConfigurationDelegate mit der Konfiguration DownloadWebApplication aufgerufen. Alle weiteren Downloads von Änderungen an dieser VoT führen jedoch zur Konfiguration UpdateWebApplication.

Wenn eine VoT bereits auf die PLC geladen wurde und der Name der VoT geändert wird, würde ein Download zur Konfiguration DownloadWebApplication mit dem neuen Namen und zur Konfiguration DeleteWebApplication mit dem neuen alten Namen führen, da sie als unterschiedliche VoT angesehen wird.

Parameter

DownloadWebApplication, UpdateWebApplication und DeleteWebApplication unterstützen werden bei der Verwendung von TIA Portal Openness die folgenden Parameter:

Parametername

Datentyp

Beschreibung

Zugriff

Name

string

Der Name der zu ladenden, zu aktualisierenden und zu löschenden WebApplication.

Lesen

Checked

boolean

Der überprüfte Status der Konfiguration. "True" bedeutet Download

Lesen/Schreiben

Programmcode

Kopiert den nachfolgenden Programmcode in die Zwischenablage.

using Siemens.Engineering.Download;

using Siemens.Engineering.Download.Configurations;

private static void DownloadPlcWithVOT()

{

    {

    downloadProvider.Download(targetConfiguration as ConfigurationTargetInterface,

    PreDownloadDelegate, PostDownloadDelegate, DownloadOptions.Software);

    }

    private static void PreDownloadDelegate(DownloadConfiguration downloadconfiguration)

    {

    DownloadWebApplication downloadWebApplication = downloadconfiguration as DownloadWebApplication;

    if (downloadWebApplication != null)

    {

        if (downloadWebApplication.Name == "WebApp1")

        {

        downloadWebApplication.Checked = true;

        // This selection will download the web application to the PLC

        }

    }

    UpdateWebApplication updateWebApplication = downloadconfiguration as UpdateWebApplication;

    if (updateWebApplication != null)

    {

        if (updateWebApplication.Name == "WebApp2")

        {

        updateWebApplication.Checked = true;

        // This selection will update the web application on the PLC

        }

    }

    DeleteWebApplication deleteWebApplication = downloadconfiguration as DeleteWebApplication;

    if (deleteWebApplication != null)

    {

        if (deleteWebApplication.Name == "AppA")

        {

        deleteWebApplication.Checked = true;

        // This selection will delete the web application from the PLC

        }

    }

    }

}