Reloading TMC files

The .tmc file of a TcCOM object describes the module's parameter interface. If the TMC file on the disk is updated, it must be reloaded into the solution for the changes to take effect. You can do this directly on the Tree Item via ConsumeXml, without closing or reopening the solution. The Mode parameter controls whether existing settings are retained.

Requirements

C# sample

The first snippet reloads the TMC file using the internally stored path. The second snippet explicitly specifies the path and Mode. The third snippet exports the currently loaded TMC file to a file before reloading it, which can be used as a backup copy.

ITcSmTreeItem tcComObject = sysManager.LookupTreeItem(@"TIRC^TcCOM Objects^MyModule");

// Reload TMC file of the object (using current path)
tcComObject.ConsumeXml("<TreeItem><ReloadTmc>true</ReloadTmc></TreeItem>");

// Load TMC file from explicit path with mode
tcComObject.ConsumeXml(@"<TreeItem>
  <ReloadTmc Path=""C:\Projects\MyModule.tmc"" Mode=""warm"">true</ReloadTmc>
</TreeItem>");

// Export TMC file (optional, before reload)
tcComObject.ConsumeXml(@"<TreeItem>
  <ExportTmc Path=""C:\Temp\tmc.tmc""/>
</TreeItem>");

Mode determines which existing settings are retained after a reload:

- warm (default): All saved settings are restored.
- cold: Only settings that were not explicitly set are restored.
- origin: No settings are restored. The object will be reset to factory settings.

If the module's GUID has changed, the reload will fail. In this case, the object must be created anew.