FB_GetRtPerformanceData

FB_GetRtPerformanceData 1:

The function block FB_GetRtPerformanceData can be used to determine the current RealTime Performance data of a TwinCAT system.

FB_GetRtPerformanceData 2: Inputs

VAR_INPUT
    bExecute : BOOL;
    bReset   : BOOL;
    tTimeout : TIME;
    sNetId   : T_AmsNetId;
END_VAR

Name

Type

Description

bExecute

BOOL

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

bReset

BOOL

A positive edge at bReset AND bExecute deletes the maximum of the RealTime Performance data.

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.

FB_GetRtPerformanceData 3: Outputs

VAR_INPUT
    bBusy               : BOOL;
    bError              : BOOL;
    nErrorId            : UDINT ;
    nUsedCpuCount       : UDINT
    stRtPerformanceData : ARRAY [1..nMaxCpuCount] OF ST_RtPerformanceData;
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.

nUsedCpuCount

UDINT 

Number of CPU cores used by TwinCAT

stRtPerformanceData

ARRAY [1..nMaxCpuCount] OF ST_RtPerformanceData

RealTime Performance data

The constant nMaxCpuCount is in the ParameterList of the Tc2_Utilities Library and can be set between 1..64, default is 64. See Global parameters in the Tc2_Utilities Library.

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