Die Steuerung neu starten

Überblick

Sobald es eine Instanz des Steuerungsobjekts im Skript gibt, können Sie die Steuerung neu starten, indem Sie eine Methode auf dieses Objekt anwenden.

Script Engine-Beispiel

from __future__ import print_function
 
def perform_application_login(project):
    app = project.active_application
    onlineapp = online.create_online_application(app)
    onlineapp.login(OnlineChangeOption.Try, True)
 
def main():
    if not projects.primary:
        system.ui.error("No active project.")
        return
 
    perform_application_login(projects.primary)
 
    #find the controller named 'LMC_PacDrive' which shall be rebooted
    controller = projects.primary.find('LMC_PacDrive', True)[0]
 
    #reboot the controller
    controller.reboot_plc()
 
    system.ui.info("Download or OnlineChange complete")
 
 
main()