Class TcSystem
- Namespace
- TwinSharp
- Assembly
- TwinSharp.dll
The TcSystem class represents a TwinCAT system and provides methods to interact with it. It allows switching the system to different modes (Config, Restart, Stop), listing EtherCAT masters, and listing local static routes. It also provides access to the system's real-time properties, license information, and file system through the Realtime, License, and FileSystem properties respectively.
public class TcSystem
- Inheritance
-
TcSystem
- Inherited Members
Constructors
TcSystem(AmsNetId)
Creates a representation of a TwinCAT system.
public TcSystem(AmsNetId target)
Parameters
target
AmsNetIdUse AmsNetId.Local for a local system.
Properties
FileSystem
Gets the FileSystem object which provides access to the TwinCAT system's file system. Can be used to read and delete files on the remote system.
public FileSystem FileSystem { get; }
Property Value
License
Gets the License object which provides access to the TwinCAT system's license information.
public License License { get; }
Property Value
Realtime
Gets the Realtime object which provides access to the TwinCAT system's real-time properties.
public Realtime Realtime { get; }
Property Value
Methods
ListEtherCatMasters()
Lists all the existing EtherCAT masters on the TwinCAT system.
public EtherCatMaster[] ListEtherCatMasters()
Returns
ListLocalStaticRoutes()
List all the existing static routes on the local TwinCAT system.
public static AmsRoute[] ListLocalStaticRoutes()
Returns
- AmsRoute[]
Exceptions
Restart()
Can be used to restart the TwinCAT system. Corresponds to the Restart command on the TwinCAT system menu (on the right of the Windows taskbar). Restarting the TwinCAT system involves the TwinCAT system first being stopped, and then immediately started again
public void Restart()
Stop()
Can be used to stop the TwinCAT system. The function corresponds to the Stop command on the TwinCAT system menu (on the right of the Windows taskbar).
public void Stop()
SwitchToConfigMode()
A TwinCAT system in RUN mode (green TwinCAT system icon) can be switched to CONFIG mode (blue TwinCAT system icon) via the function block "TC_Config". If the system is already in CONFIG mode, it is first switched to STOP mode (red TwinCAT system icon) and then to CONFIG mode.
public void SwitchToConfigMode()