TC_SysLatencyEx

TC_SysLatencyEx 1:

The function block TC_SysLatencyRx can be used to determine the current and maximum latency time of a TwinCAT CPU core. The function corresponds to the TwinCAT latency time display in the TwinCAT system menu under real-time settings for the corresponding CPU core.

TC_SysLatencyEx 2: Inputs

VAR_INPUT
    bExecute : BOOL;
    tTimeout : TIME;
    sNetId   : T_AmsNetId;
    nCpuId   : USINT;
END_VAR

Name

Type

Description

bExecute

BOOL

The function block is enabled by a positive edge at this input.

tTimeout

TIME

States the time-out period that may not be exceeded by execution of the ADS command.

sNetId 

T_AmsNetId

AmsNetId (AMS network ID) of the TwinCAT computer whose CPU usage is to be read. An empty string may be specified for the local computer.

nCpuId

USINT

CPU ID of the TwinCAT CPU core to be used, see Real-Time | Settings tab

TC_SysLatencyEx 3: Outputs

VAR_INPUT
    bBusy    : BOOL;
    bError   : BOOL;
    nErrorId : UDINT;
    nActual  : UDINT;
    nMaximum : UDINT;
END_VAR

Name

Type

Description

bBusy 

BOOL

When the function block is enabled, this output is set and remains set until a feedback is received.

bError 

BOOL

If an error occurs during the transmission of the command, this output is set after the bBusy output is reset.

nErrorId

UDINT

Returns the ADS error number when the bError output is set.

nActual

UDINT

The current latency time of a TwinCAT CPU core in µs

nMaximum

UDINT

The maximum latency time of a TwinCAT CPU core in µs (maximum latency time since the last start-up of the TwinCAT system).

Requirements

Development Environment

Target platform

PLC libraries to be integrated (category group)

TwinCAT v3.1.4022.14

PC or CX (x86, x64, Arm®)

Tc2_Utilities (System) >= 3.3.25.0