Samples | System PowerShell sample # Config mode $dte.ExecuteCommand("TwinCAT.RestartTwinCATConfigMode") # Toggle FreeRun $dte.ExecuteCommand("TwinCAT.ToogleFreeRunState") # Check status $isRunning = $sysManager.IsTwinCATStarted() Write-Host "TwinCAT lдuft: $isRunning" The TwinCAT state can be controlled not only using the DTE commands shown here, but also directly via ADS (TwinCAT system service, ADS port 10000). IsTwinCATStarted() returns true when TwinCAT is running, regardless of whether it is in Config or Run Mode. The method thus checks whether a TwinCAT instance is currently running. It serves as a prerequisite for actions that require a running TwinCAT instance, such as an upload.
The exact difference compared to a Run Mode test still needs to be verified. Switching to Config mode via RestartTwinCATConfigMode is an asynchronous process. For reliable automation, it is recommended to query the TwinCAT state via ADS port 10000 until the Config mode is confirmed. 6.3.14 Managing variable mappings | Managing variable mappings Variable mappings establish connections between PLC input/output variables and I/O counterparts, NC axes, or TcCOM objects. The Automation Interface offers four operations:
link individually using LinkVariables on ITcSysManager unlink individually using UnlinkVariables on ITcSysManager Export/import all mappings using ProduceMappingInfo / ConsumeMappingInfo on ITcSysManager2 Delete all mappings using ClearMappingInfo on ITcSysManager3 Requirements TwinCAT XAE is installed and started. A DTE connection to the target instance is active. ITcSysManager is initialized in an STA thread. A TwinCAT solution with a PLC project and I/O configuration is open. Linking individual variable (LinkVariables) Both paths are passed as complete tree paths. The order of the parameters is source , destination .
C# string source = "TIPC^PlcProj^PlcProj Instance^PlcTask Inputs^bIn"; string destination = "TIID^EtherCAT^EK1100^EL1004^Channel 1^Input"; systemManager.LinkVariables(source, destination); PowerShell: $source = "TIPC^PlcProj^PlcProj Instance^PlcTask Inputs^bIn" $destination = "TIID^EtherCAT^EK1100^EL1004^Channel 1^Input" $systemManager.LinkVariables($source, $destination) Unlinking individual variable (UnlinkVariables) C#: systemManager.UnlinkVariables(source, destination); PowerShell: TE1000 217 Version: 1.7.0