How To | Starting and Stopping the PLC and other ADS Servers Message 18:20:47.956 TwinCAT System 10000 TCIOECAT Server started: TCIOECAT. Message 18:20:47.963 TwinCAT System 10000 TCIODRIVERS Server started: TCIODRIVERS. Message 18:20:48.078 TwinCAT System 10000 Starting COM Server TcVnService Message 18:20:48.078 TwinCAT System 10000 Starting COM Server TcEventLogger Tries to restart the local TwinCAT system and write the log messages to the output. This Command fails.
5.8 Starting and Stopping the PLC and other ADS Servers | Starting and Stopping the PLC and other ADS Servers Start the PLC on the local system PS> Set-AdsState -port 851 -command Run -force Ok Target NetId Port ErrorCode Requested Original Reached Latency (ms) -- ------ ----- ---- --------- --------- -------- ------- ------------ X CX-11111 1.1.1.1.1.1 851 NoError Run Stop Run 293 The ‘X’ indicates the success.
Start the PLC on all registered routes PS> $r = Get-AdsRoute PS> Set-AdsState -port 851 -command Run -InputObject $r -force Ok Target NetId Port ErrorCode Requested Original Reached Latency (ms) -- ------ ----- ---- --------- --------- -------- ------- ------------ X CX-11111 1.1.1.1.1.1 851 NoError Run Stop Run 293 X CX-22222 1.1.1.2.1.1 851 NoError Run Stop Run 357 X CX-22222 1.1.1.3.1.1 851 NoError Run Stop Run 218 X CX-22222 1.1.1.4.1.1 851 NoError Run Stop Run 324 Start the PLC on all registered target systems. The ‘X’ indicates the success.
Restart the TwinCAT System Service PS> Set-AdsState -port 10000 -command Reset -force Ok Target NetId Port ErrorCode Requested Original Reached Latency(ms) -- ------ ----- ---- --------- --------- -------- ------- ------------ X MySystem 172.168.0.1.1.1 10000 NoError Reset Run Run 5007 Restart the local System Service. This is an alternative to the ‘ Restart-TwinCAT ’ Cmdlet. 5.9 Reading / Writing Data | Reading / Writing Data 5.9.1 Connect to a target device / ADS Server | Connect to a target device / ADS Server In the TwinCAT world, every software/hardware instance participating at the ADS communication network is an ADS Server.
To access these servers various implementations of ADS Clients for different programming languages are available. To establish an ADS connection in Powershell, the ‘New-TcSession’ Cmdlet is used. Internally it uses the .NET ‘TwinCAT.Ads.AdsClient’ object for communicating. If using the -NetId , -Port , -Route or -Address Arguments of the ‘TcXaeMgmt’ Module Cmdlets, the connection (and therefore the AdsClient) is established on the fly. The connection is shut down after the single Cmdlet is executed. The advantage of the ‘Session’ is, that leaves the connection established until ‘Close-TcSession’ is called, or the Powershell host process (the Powershell-Session) ends.
Existing ADS Sessions can be stored in variables or can be accessed by ‘Get-TcSession’. TE1000 21 Version: 1.5.0