Table of Contents

Class PLC

Namespace
TwinSharp.PLC
Assembly
TwinSharp.dll

The PLC class provides methods to control a TwinCAT PLC runtime system using an AdsClient. It allows starting, stopping, and resetting the PLC, as well as accessing various system information and status variables through the PlcAppSystemInfo instance.

public class PLC
Inheritance
PLC
Inherited Members

Constructors

PLC(AdsClient)

Initializes a new instance of the PLC class with the specified AdsClient. The AdsClient should typically be connected to the target system at port AmsPort.PlcRuntime_851 (851).

public PLC(AdsClient client)

Parameters

client AdsClient

Properties

AppInfo

Gets the PlcAppSystemInfo instance which provides access to various system information and status variables of a TwinCAT PLC application.

public PlcAppSystemInfo AppInfo { get; }

Property Value

PlcAppSystemInfo

Methods

Reset()

Can be used to reset a PLC runtime system. When the PLC is reset, the PLC variables are filled with their initial values, and the execution of the PLC program is stopped. Equivavalent to the function block PLC_Reset.

public void Reset()

Start()

Can be used to start a PLC runtime system on a TwinCAT system. The function block can, for instance, be used to start the PLC on a remote PC. Equivavalent to the function block PLC_Start.

public void Start()

Stop()

Can be used to stop a PLC runtime system on a TwinCAT system. The function block can, for instance, be used to stop the PLC on a remote or a local PC. Equivavalent to the function block PLC_Stop.

public void Stop()