External Control (ADS)

An interface is available for TwinCAT 3 Usermode Runtime - External Control to enable access from external programs via ADS.

This interface consists of several parts:

Query the state

The current state can be queried via this interface.

ADS Port

Index Group

Index Offset

Access

Data type

Description

Note

200

0x00000001
(RTADSGRP_SYSDATA)

0x00000032 (RTADSOFFS_SYSDATA_TICK_MODE)

R

ULONG

Returns the current RtMode.
If the value is 3 ( RtMode_Externaltick ), the calculation can be triggered by starting the tick.

 

Values of the RtMode:

enum RtMode
{
        RtMode_None = 0,
        RtMode_Normal = 1,
        RtMode_Simulation = 2,
        RtMode_ExternalTick = 3,
        RtMode_Invalid = -1
}

Starting the ticks

This interface can be used to specify a number of ticks that the TwinCAT 3 Usermode Runtime should execute.

ADS Port

Index Group

Index Offset

Access

Data type

Description

Note

200

0x00000001
(RTADSGRP_SYSDATA)

0x00000031 (RTADSOFFS_SYSDATA_TICKNOW)

W

Int

Number of ticks that the Usermode Runtime should execute.

Return value indicates whether the command can be processed, then ADSERR_NOERR.