private static void ExportAllTagTables(PlcSoftware plcSoftware) { PlcTagTableSystemGroup plcTagTableSystemGroup = plcSoftware.TagTableGroup; // Export all tables in the system group ExportTagTables(plcTagTableSystemGroup.TagTables); // Export the tables in underlying user groups foreach (PlcTagTableUserGroup userGroup in plcTagTableSystemGroup.Groups) { ExportUserGroupDeep(userGroup); } }
internal void LoadSubVartabFoldersViaOpennessDlls(TIAVarTabFolder parent, PlcTagTableSystemGroup blockFolder) { foreach (var e in blockFolder.Groups) { var fld = new TIAVarTabFolder(this, parent.ControllerFolder) { TiaPortalItem = e, Name = e.Name, Parent = parent, }; parent.SubItems.Add(fld); LoadSubVartabFoldersViaOpennessDlls(fld, e); } }
//Imports tag tables to the tag system group private static void ImportTagTable(PlcSoftware plcSoftware) { try { PlcTagTableSystemGroup plcTagTableSystemGroup = plcSoftware.TagTableGroup; PlcTagTableComposition tagTables = plcTagTableSystemGroup.TagTables; string[] files = Directory.GetFiles(@"C:\testTables\", "*", SearchOption.AllDirectories); foreach (var file in files) { tagTables.Import(new FileInfo(file), ImportOptions.Override); } } catch (Exception ex) { MessageBox.Show("Chyba: " + ex.Message); } }