Samples | I/O ITcSmTreeItem item = sysMan.LookupTreeItem("TIID^EtherCAT Master"); item.Disabled = DISABLED_STATE.SMDS_DISABLED; Please note that for this sample you have to add a reference to “Microsoft Developer Environment 10.0” as well as to “Beckhoff TCatSysManager Library 1.1” to your project. Sample (PowerShell):
$DISABLED_STATE = @{"SMDS_NOT_DISABLED" = "0"; "SMDS_DISABLED" = "1"} $item = $systemManager.LookupTreeItem("TIID^EtherCAT Master") $item.Disabled = $DISABLED_STATE.SMDS_DISABLED 6.6.6 Configuring PLC data types for EtherCAT Terminals | Configuring PLC data types for EtherCAT Terminals TwinCAT can automatically generate PLC data types for EtherCAT Terminals that correspond to the terminal's process data. The generated type is directly linked to a PLC variable, so that the terminal can be accessed via the PLC in a type-safe manner. The configuration is set via ConsumeXml on the terminal's Tree Item. There are two options available:
per channel in “Per Channel” mode, or as an aggregated type across all channels. Requirements TwinCAT from Build 4026.7 A TwinCAT solution is open, and a DTE connection is active. ITcSysManager was initialized as a COM object in an STA thread. An EtherCAT master with the target terminal is present in the I/O configuration. Variant 1: data type per channel Each channel of the terminal block is assigned its own data type and linked to a separate PLC variable. Index specifies the channel (1-based). DataType contains the device-specific type name from the terminal's ESI file. LinkToPlc specifies the target path in the PLC in the format Variablenname (Instanzname) .
ITcSmTreeItem ecSlave = sysManager.LookupTreeItem(@"TIID^EtherCAT Master^EL1809"); // Variant 1: per channel (CreateDataType with channel index) string perChannelXml = @" MDP5001_250_37E19AF2 MDP5001_250_37E19AF2 "; ecSlave.ConsumeXml(perChannelXml); Variant 2: aggregated type (all channels) // Variant 2: aggregated type (all channels in one data type) string aggregatedXml = @" MDP5001_250_B6F8A7F1 TE1000 257 Version: 1.7.0