(Re)Starting and Stopping TwinCAT

Restart TwinCAT (Succeeding)

PS> Restart-TwinCat -command Reset -force

Ok Target     NetId             Port  ErrorCode Requested Original Reached Latency (ms)
-- ------     -----             ----  --------- --------- -------- ------- ------------
X  CX_1111    192.168.0.2.1.1  10000  Succeeded Reset     Run      Run     2853

Restarts the local TwinCAT System. The ‘X’ in the ‘Ok’ Column indicates the success.

Restart TwinCAT (Failing)

PS> Restart-TwinCat -command Reset -force

WARNING: 192.168.0.2.1.1:10 ERR | 18:26:28:108 |'TCOM Server' (10): Device 1 (EtherCAT) (Adapter): Failed to connect to network adapter!
WARNING: 192.168.0.2.1.1:10 WRN | 18:26:28:108 |'TCOM Server' (10): PREOP to SAFEOP of 'Device 1 (EtherCAT) (Adapter)' (0x03010011) failed - 'request is aborted' 0x9811071F
WARNING: 192.168.0.2.1.1:10000 ERR | 18:26:28:117 |'TwinCAT System' (10000): Sending ams command >> Init12\IO: Set State TComObj SAFEOP: Set Objects (4) to SAFEOP >> AdsError: 1823 (0x71f, ADS ERROR: device aborted the action) << failed!

Ok Target     NetId             Port  ErrorCode Requested Original Reached Latency (ms)
-- ------     -----             ----  --------- --------- -------- ------- ------------
   CX_1111    192.168.0.2.1.1  10000  Succeeded Reset     Config   Config  3427

Calls a Reset to the local SystemService that fails!

Error log messages will be logged out.

Restart TwinCAT and Analyze Errors on failed start.

PS> Restart-TwinCAT -command Reset -force | select-object -ExpandProperty LogMessages

WARNING: 192.168.0.2.1.1:10 ERR | 18:20:45:969 |'TCOM Server' (10): Device 1 (EtherCAT) (Adapter): Failed to connect to network adapter!
WARNING: 192.168.0.2.1.1:10 WRN | 18:20:45:969 |'TCOM Server' (10): PREOP to SAFEOP of 'Device 1 (EtherCAT) (Adapter)' (0x03010011) failed - 'request is aborted' 0x9811071F
WARNING: 192.168.0.2.1.1:10000 ERR | 18:20:45:979 |'TwinCAT System' (10000): Sending ams command >%gt; Init12\IO: Set State TComObj SAFEOP: Set Objects (4) to SAFEOP >%gt; AdsError: 1823 (0x71f, ADS ERROR: device aborted the action) << failed!

Type    TimeStamp    DeviceName     Port  Message
----    ---------    ----------     ----  -------
Message 18:20:44.874 TwinCAT System 10000 TwinCAT System Restart initiated from AmsNetId: 192.168.0.2.1.1 port 34564.
Message 18:20:44.879 TwinCAT System 10000 Saving configuration of COM server TcVnService !
Message 18:20:44.880 TwinCAT System 10000 Saving configuration of COM server TcEventLogger !
Message 18:20:44.970 TwinCAT System 10000 Shutting down COM Server TcVnService !
Message 18:20:44.971 TwinCAT System 10000 Shutting down COM Server TcEventLogger !
Message 18:20:45.745 TwinCAT System 10000 Loading configuration of COM server TcVnService !
Message 18:20:45.747 TwinCAT System 10000 Loading configuration of COM server TcEventLogger !
Message 18:20:45.748 TwinCAT System 10000 Initializing COM Server TcVnService !
Message 18:20:45.773 TwinCAT System 10000 Initializing COM Server TcEventLogger !
Message 18:20:45.783 TwinCAT System 10000 TcIoEth Server started: TcIoEth.
Message 18:20:45.791 TwinCAT System 10000 TcRtsObjects Server started: TcRtsObjects.
Message 18:20:45.798 TwinCAT System 10000 TcIoECat Server started: TcIoECat.
Message 18:20:45.805 TwinCAT System 10000 TcIo Server started: TcIo.
Message 18:20:45.814 TwinCAT System 10000 TcPlc30 Server started: TcPlc30.
Message 18:20:45.821 TwinCAT System 10000 TcRTime Server started: TcRTime.
Message 18:20:45.927 License Server 30    license validation status is Valid(3)
Error   18:20:45.969 TCOM Server    10    Device 1 (EtherCAT) (Adapter): Failed to connect to network adapter!
Warning 18:20:45.969 TCOM Server    10    PREOP to SAFEOP of 'Device 1 (EtherCAT) (Adapter)' (0x03010011) failed - 'request is aborted' 0x9811071F
Error   18:20:45.979 TwinCAT System 10000 Sending ams command >%gt; Init12\IO: Set State TComObj SAFEOP: Set Objects (4) to SAFEOP >%gt; AdsError: 1823 (0x71f, ADS ERROR: device aborted the action) %lt;%lt; failed!
Message 18:20:47.879 TwinCAT System 10000 Loading configuration of COM server TcVnService
Message 18:20:47.881 TwinCAT System 10000 Loading configuration of COM server TcEventLogger
Message 18:20:47.882 TwinCAT System 10000 Initializing COM Server TcVnService
Message 18:20:47.910 TwinCAT System 10000 Initializing COM Server TcEventLogger
Message 18:20:47.922 TwinCAT System 10000 TCIO Server started: TCIO.
Message 18:20:47.931 TwinCAT System 10000 TCRTIME Server started: TCRTIME.
Message 18:20:47.939 TwinCAT System 10000 TCRTSOBJECTS Server started: TCRTSOBJECTS.
Message 18:20:47.948 TwinCAT System 10000 TCIOETH Server started: TCIOETH.
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.