EcoStruxure Machine Expert Version 1.1 unterstützt nicht die Controller M258, LMC058 und LMC078.

Geräteparameter

Überblick

Um einen Parameter zu ändern, sind Parameter-ID und ParameterSet erforderlich.

Um das erforderliche Gerät zu finden und die entsprechenden Parameter aufzulisten, verwenden Sie die Suchmethode, die Objekte durch einem bestimmten Namen oder Pfad im Projekt findet.

Script Engine-Beispiel

from __future__ import print_function
 
# Example-Device Lexium62
moduleName = 'DRV_Lexium62'

# find module/device in Project (you also can do this generic e.g. with get_children()...)
module = projects.primary.find(moduleName, True)[0]
 
# get all possible connectors for this device
connectors = module.connectors
print("Number of Connectors: ", connectors.Count)
print(" - ") 

cnt = 1
for c in connectors:
        print("Connector " +str(cnt) +" for "+moduleName +": ")
        params = c.host_parameters
        count = params.Count
        print("Number of available Parameters for this connector: ", count)

        if count > 0:
            for p in params:
                      print(p.visible_name + " - ID: %s " % p.id + " - Value: %s" % p.value)

            # example to get the value of a parameter by id:
            print(" - ")
            print(" - Example for a single Parameter (ObjectType) - ")
            objectType = params.by_id(268435457)
            print("ObjectType: ", objectType.value)

        cnt = cnt+1

        print("------------------------------------------------------------------")