Samples | I/O Exporting an ENI file from an existing configuration In the TwinCAT interface, the ENI file is generated on the EtherCAT master via the EtherCAT tab using the Export Configuration File… button. In the Automation Interface, this corresponds to a ConsumeXml call on the master node using the ExportConfigurationFile element. The element's content is the target path of the file to be written.
C# sample ITcSmTreeItem ecMaster = sysManager.LookupTreeItem(@"TIID^EtherCAT Master"); // Export ENI configuration file ecMaster.ConsumeXml( @" " + @"C:\Projects\EtherCATConfig.xml" + @" " ); PowerShell sample $ecMaster = $sysManager.LookupTreeItem("TIID^EtherCAT Master") # Export ENI configuration file $ecMaster.ConsumeXml(" C:\Projects\EtherCATConfig.xml ExportConfigurationFile> ") The export is performed on the EtherCAT master node, not on a slave. As with the import, the file path must be a full absolute path. Importing an ENI file into a simulation device First, an EtherCAT simulation device with SubType 144 is created under the I/O node TIID.
The ENI file is then loaded using ConsumeXml with the ImportConfigurationFile element. After the import, all slaves described in the file appear as configured devices under the simulation device, identical to the original configuration, including addresses and PDO mapping. C# sample First, an EtherCAT simulation device with SubType 144 is created under the I/O node TIID . The ENI file is then loaded via ConsumeXml using the element ImportConfigurationFile . After the import, all slaves described in the file appear as configured devices under the simulation device, identical to the original configuration, including addresses and PDO mapping.
ITcSmTreeItem ioNode = sysManager.LookupTreeItem("TIID"); // Create EtherCAT simulation device (SubType 144) ITcSmTreeItem ecSimDevice = ioNode.CreateChild("EtherCAT_Sim", 144); // Import ENI configuration file ecSimDevice.ConsumeXml( @" " + @"C:\Projects\EtherCATConfig.xml" + @" " ); PowerShell sample $ioNode = $sysManager.LookupTreeItem("TIID") # Create EtherCAT simulation device (SubType 144) $ecSimDevice = $ioNode.CreateChild("EtherCAT_Sim", 144) # Import ENI configuration file $ecSimDevice.ConsumeXml(" C: \Projects\EtherCATConfig.xml ") The simulation device with SubType 144 emulates an EtherCAT master without a physical network interface card.
The path to the ENI file must be a complete absolute path. TE1000 268 Version: 1.7.0