Accès à DriveControlChartContainer avec DriveObject - TIAPortal

Fonctions pour DCC

ft:publication_title
Fonctions pour DCC
Product
TIAPortal
Version
V20
Publication date
01/2025
Language
fr-FR
Accès à DriveControlChartContainer avec DriveObject

L'exemple suivant montre comment accéder à DriveControlChartContainer avec un objet entraînement.

Accès à DriveControlChartContainer Copie le code de programme suivant dans le presse-papiers

using Siemens.Engineering.MC.Drives;

using Siemens.Engineering.MC.Drives.DCC;

Project project =  portal.Projects.Open("..."); //Destination folder to open the project

DeviceItem item = project.Devices[0].Items[0];

DriveObject driveObject = item.GetService<DriveObjectContainer>().DriveObjects[0];

DriveControlChartContainer chartContainer = driveObject.GetService<DriveControlChartContainer>();

//chartContainer can be null in case the DriveObject does not support DCC.