Samples | I/O // Add modules with slot number // SubType = index in of the GSDML file // vInfo = slot number as string ITcSmTreeItem module1 = api.CreateChild("Module_1", 2, "", "2"); // SubType 2, Slot 2 ITcSmTreeItem module2 = api.CreateChild("Module_10", 7, "", "10"); // SubType 7, Slot 10 GSDML path format and BoxFlags The vInfo parameter when creating a PROFINET box supports an extended format with BoxFlags: GSDML-Pfad#DAP-ModId#BoxFlags#DAP-Nr Sample: C:\TwinCAT\Io\Profinet\GSDML-V2.3-beckhoff-TCPNDevice-20130723.xml#0x01#0#0x03 The following BoxFlags are evaluated: Adding PROFINET submodules PROFINET submodules can be added below a “PROFINET Modular Module”:
ITcSmTreeItem profinetModularModule = profinetEL6631api.CreateChild("", 98, null, null); // SubType 98 = Modular ITcSmTreeItem modularModule1 = profinetModularModule.CreateChild("", 12, null, null); // SubType 12 = 8 Byte In-Out ITcSmTreeItem modularModule2 = profinetModularModule.CreateChild("", 14, null, null); // SubType 14 = 16 Byte Out ITcSmTreeItem modularModule3 = profinetModularModule.CreateChild("", 31, null, null); // SubType 31 = 8 Word In GSDML files must not contain any spaces or comments in the ModuleList. Otherwise, parsing will fail.
6.6.16 Importing and exporting an ENI file to and from a (simulation) device | Importing and exporting an ENI file to and from a (simulation) de ... An ENI file (EtherCAT Network Information) is an XML file that describes a complete EtherCAT topology. It contains all slaves, along with their addresses and process data, and is typically exported from an existing TwinCAT configuration. By importing the data into a simulation device, an EtherCAT topology can be replicated without the need for real hardware. This is useful for testing and development when the physical system is not available. Both processes are controlled via ConsumeXml [ } 57] :
the export on the EtherCAT master using the ExportConfigurationFile element, and the import on the simulation device using the ImportConfigurationFile element. Requirements A TwinCAT solution is open, and a DTE connection is active. ITcSysManager was initialized as a COM object in an STA thread. For export: A configured EtherCAT master is present in the I/O configuration For import: An ENI file in the format .xml is located at a known absolute path. TE1000 267 Version: 1.7.0 Name Value Description GENERATE NAME _ FROM PAB _ _ 0x0004 The PROFINET name is generated based on the process image. GET STATIONNAM _ E 0x0400 The PROFINET name from the TwinCAT configuration is used (Tree Item name).
SET NOT IP TO _ _ _ _ OS 0x4000 CE only: PROFINET IP is not registered in the operating system.