Voraussetzung
-
Die TIA Portal Openness-Anwendung ist mit dem TIA Portal verbunden.
Siehe Verbindung zum TIA Portal aufbauen -
Ein Projekt ist geöffnet.
Siehe Projekt öffnen
Einleitung
Sie können mit TIA Portal Openness eine UMC-Benutzergruppe in einem TIA Portal-Projekt auf einem UMC-Server hinzufügen.
Programmcode
|
private static void AddUMCUser(UmcUser umcUser, Project project) { var umcServerConfigurator = project.GetService<UmcServerConfigurator>(); var umacConfigurator = project.GetService<UmacConfigurator>(); UmcServer umcServer = umcServerConfigurator.UmcServer; umcServer.Authentication += UmcServer_Authentication; string umcUserGroupName = "xxxxxx"; UmcUserGroupInfo umcUserGroupInfo = umcServer.GetUserGroupByName(umcUserGroupName); //Get the UmcUserGroupComposition. UmcUserGroupComposition umcUserGroupComposition = umacConfigurator.UmcUserGroups; //Create the selected UMC UserGroup in to the TIA Portal project UmcUserGroup umcUserGroup = umcUserGroupComposition.Create(umcUserGroupInfo); } |