Table of Contents

Namespace TwinSharp.NC

Classes

Axis

Represents an axis in a TwinCAT NC system, encapsulating its functions, parameters, state, cyclic process data, and associated sub-elements such as encoders, controllers, and drives.

AxisCyclicProcessData

The AxisCyclicProcessData class provides properties to interact with the cyclic process data of an axis in a TwinCAT NC system. It uses an AdsClient to read and write various control and status parameters of the axis, such as control word, controller enable, feed enable, referencing cam, velocity override, operation mode, actual position correction value, and external controller component. If the axis is linked to a PLC object, most of these values will be refused.

AxisFunctions

The AxisFunctions class provides a set of methods to control and manage the behavior of an axis in a TwinCAT NC system. It allows for operations such as resetting, stopping, referencing, and setting positions of the axis. Additionally, it supports advanced operations like controlled ramps, emergency stops, reversing operations, and sinus oscillation sequences. The class interacts with the TwinCAT system using an AdsClient to send commands and data to the specified axis.

AxisParameters

Represents the parameters of an axis in a TwinCAT NC system. This class provides properties to get and set various parameters of an axis, such as ID, name, type, cycle time, physical unit, velocities, monitoring settings, error reaction mode, and more. It uses an AdsClient to read and write these parameters from a TwinCAT system. The class also includes methods to read all sub-elements like encoder IDs, controller IDs, and drive IDs.

AxisState

Represents the state of an NC axis. Provides access to various properties and methods to read and manipulate the state of the axis, including position, velocity, acceleration, torque, and error codes.

Channel

Represents a channel in the TwinCAT NC system.

ChannelCyclicProcessData

The ChannelCyclicProcessData class provides methods to interact with the cyclic process data of a channel in a TwinCAT system. It allows reading and writing of speed override values for both the channel axis and the spindle.

ChannelFunctions

The ChannelFunctions class provides methods to interact with and control NC (Numerical Control) channels using an AdsClient. It allows loading NC programs by number or name, starting the interpreter, setting the interpreter operation mode, setting paths for subroutines, and controlling the channel with reset, stop, retry, and skip functionalities.

ChannelParameters

Represents the parameters of a channel in the TwinCAT NC system. This class provides properties to access various channel parameters such as ID, Name, Type, InterpreterType, ProgramLoadBufferSize, ProgramNumberJobList, InterpolationLoadLogMode, InterpolationTraceMode, RecordAllFeederEntries, NcLoggerLevel, G70Factor, G71Factor, ActivationOfDefaultGcode, and GroupId. These properties interact with the TwinCAT ADS client to read and write the respective values.

ChannelState

Represents the state of an NC (Numerical Control) channel, providing access to various channel properties such as error codes, group count, interpreter state, operation mode, and program information using an AdsClient.

Controller

Represents a controller in the TwinCAT NC system. This class provides access to the controller's parameters and state, allowing for the retrieval and manipulation of various control parameters and state information. It interacts with an AdsClient to communicate with the underlying system.

ControllerParameters

Represents the parameters of a controller, providing properties to get and set various control parameters such as ID, name, type, and control weights. This class interacts with an AdsClient to read and write parameter values from a specified index group.

ControllerState

The ControllerState class provides an interface to interact with a controller's state using an AdsClient. It allows reading various parameters of the controller such as error state, output in absolute units, output in percent, and output in volts.

Drive

The Drive class represents a drive in a TwinCAT system. It provides access to the drive's parameters and state through the DriveParameters and DriveState classes, respectively. The class is initialized with an AdsClient and a drive ID, which are used to interact with the drive's properties and state.

DriveFunctions

The DriveFunctions class provides methods to interact with and manipulate drive tables. It allows for the removal and deletion of characteristic drive tables.

DriveParameters

The DriveParameters class provides an interface to interact with drive parameters in a TwinCAT system using the AdsClient. It allows reading and writing various properties of a drive such as its ID, name, type, and motor polarity inversion status.

DriveState

Represents the state of a drive in a TwinCAT system. Provides properties to access various drive parameters such as error state, total output in absolute units, percent, and volts.

Encoder

The Encoder class represents an encoder device and provides access to its functions, parameters, and state. It uses an AdsClient to communicate with the encoder via the TwinCAT ADS protocol. The class contains three main properties:

  • Functions: Provides methods to interact with and control the encoder.
  • Parameters: Allows reading and writing various encoder settings.
  • State: Provides access to various encoder states and properties.
EncoderFunctions

The EncoderFunctions class provides methods to interact with and control encoder devices via the TwinCAT ADS protocol. It includes functionalities to set and reinitialize the actual position of the encoder, activate and deactivate touch probes and external latches, and set external latch events. The class uses an AdsClient to communicate with the encoder and sends commands using specific index groups and offsets.

EncoderParameters

The EncoderParameters class provides an interface to interact with encoder parameters via an AdsClient. It allows reading and writing various encoder settings such as ID, name, type, scaling factor, position offset, count direction, modulo factor, mode, soft end monitoring, soft end positions, evaluation direction, and filter times. The class uses an AdsClient to communicate with the encoder and retrieve or update these parameters.

EncoderState

The EncoderState class provides access to various encoder states and properties through an AdsClient instance. It allows reading and writing of encoder-related data such as error codes, actual positions, velocities, accelerations, and other relevant metrics.

Group

Represents a group in the TwinCAT NC system.

GroupFunctions

The GroupFunctions class provides methods to control and manage an axis group in a TwinCAT NC (Numerical Control) system. It allows for resetting, stopping, clearing, and performing an emergency stop on the group. Additionally, it supports starting and managing FIFO (First In, First Out) operations for the group.

GroupParameters

The GroupParameters class provides access to various parameters of a group in the TwinCAT NC system. It allows reading and writing of group-specific settings such as ID, name, type, cycle times, and FIFO configurations. This class interacts with the TwinCAT ADS client to perform read and write operations on the group parameters.

GroupState

The GroupState class provides properties to interact with and retrieve various states and information from a TwinCAT NC group via an AdsClient. It includes properties for error codes, axis counts, group states, and emergency stop status, among others. Each property reads or writes data from the TwinCAT system using specific index groups and offsets.

NC

The NC class provides access to the NC (Numerical Control) system using TwinCAT ADS protocol. It initializes and manages the Ring0Manager, Axes, Channels, Groups and Tables components.

Ring0Manager

Manages the low level Ring 0 operations for the NC system.

Ring0Parameters

Represents the parameters for Ring 0, providing access to various settings and configurations related to the SAF and SVB tasks, global time compensation, and cyclic data consistency.

Ring0State

Represents the state of the Ring 0 system, providing access to various counts and IDs for channels, groups, axes, encoders, controllers, drives, and tables.

Table

The Table class encapsulates various functionalities, parameters, and states related to a table in the context of TwinCAT ADS. It provides a structured way to interact with tables, which are likely used for motion control or other automation tasks.

TableFunctions

The TableFunctions class provides methods to generate and delete various types of tables with specified dimensions and interpolation types. It interacts with a TwinCAT AdsClient to perform these operations. The class supports generating general tables, valve diagram tables, and motion function tables, each with specific table types and dimensions.

TableParameters

The TableParameters class provides methods to interact with table parameters in a TwinCAT ADS system. It allows reading and writing various table properties such as ID, Name, SubType, MainType, LineCount, ColumnCount, TotalCount, StepWidth, MasterPeriod, and SlaveDifferencePerMasterPeriod. It also provides methods to get and set the activation mode for online changes, read and write single values in the table, and convert slave positions to master positions.

TableState

Represents the state of a table in a TwinCAT NC (Numerical Control) system. This class provides access to the 'User Counter'. It uses an AdsClient to communicate with the TwinCAT system and read the necessary data.

Structs

NCAXISSTATE_ONLINESTRUCT

AXIS ONLINE STRUCTURE (NC/CNC)

Enums

ActualPositionType

Enumeration of the different types of actual position that exist in TwinCAT NC.

AxisType

TwinCAT supports different axis types, which are defined in the enum AxisType.

CamScalingMode

Enumeration of type and scope of the scaling of a cam plate coupling.

ChannelType

Enumeration of the different types of channels that exists in TwinCAT NC.

ControllerType

Enumeration of the different types of controllers that exist in TwinCAT NC.

CoupleState

Coupling state of the axis

DriveOutputStartType

Enumeration of the different types of drive output start that exist in TwinCAT NC.

EncoderEvaluationDirection

Specifies the mode of evaluation for encoder signals.

EncoderMode

Enumeration of the different types of encoder modes that exist in TwinCAT NC.

EncoderType

Enumeration of all possible encoder types in TwinCAT NC.

EndPositionType

Enumeration of the different types of end position types (new end position) that exist in TwinCAT NC.

ErrorReactionMode

Enumeration of the possible error reaction modes that exist in TwinCAT NC.

FifoInterpolationType

Enumeration of the different ways that the TwinCAT NC FIFO can interpolate between supplied points.

FifoOverrideType

Determines the behaviour how quickly the FIFO should adapt to a new override.

GroupAxisStartType

Used by NC axis functions such as StandardAxisStart to define the start type of the axis.

GroupType

Enumeration of all possible group types in TwinCAT NC.

InterpolationLoadLogMode

Enumeration of the different types of interpolation load log modes that exist in TwinCAT NC.

InterpolationTraceMode

Enumeration of the different types of interpolation trace modes that exist in TwinCAT NC.

InterpreterOperationMode

Enumeration of the different modes that the TwinCAT NC interpreter can operate in.

InterpreterState

Enumeration of all possible states of the interpreter in TwinCAT NC. The interpreter state reflects the current state of the Interpreter State Machine. The complete list is given below.

InterpreterType

Enumeration of the different types of interpreters that exist in TwinCAT NC.

NCTOPLC_AXIS_REF_OPMODE

The AxisControlDWord is a 32 bit data word in the axis interface PLC->NC.

NcDriveType

TwinCAT supports different drives, these are defined in the enum DriveType.

ProbeMode

Enumeration of the different types of probe modes that exist in TwinCAT NC.

SignalEdge

Enumeration of the two types of signal edges that exist. Rising edge and falling edge.

StateDWordFlags

The StateDWord is a 32 bit data word in the axis interface NC->PLC.

TableActivationMode

Enumeration of the different types of table activation modes that exist in TwinCAT NC.

TableInterpolationType

Interpolation mode for position tables (cam plates). Position tables consist of a list of master and slave positions between which interpolation can take place in different ways. The interpolation type is not used for extended cam plates(motion functions).

TableMainType

Enumeration of the different types of main tables that exist in TwinCAT NC.

TableSubType

Enumeration of the different types of table subtypes that exist in TwinCAT NC.