Infosys在阅读器中打开 / AI 翻译

CX7000 series · 0 次阅读

Measuring processing time in the PLC program

This sample shows you how to determine the processing time of a program code with the help of a small PLC program. This allows you to measure, for example, how long the PLC needs for a mathematical function, a loop or a specific program part. The resolution is 1 ns per digit.

Sample

VAR
    MeasureStart    : T_DCTIME64;
    MeasureResult   : T_DCTIME64;
END_VAR

PROGRAM:
MeasureStart:=F_GetActualDcTime64(); (*Insert your program code to measure the processing time*)
MeasureResult:=F_GetActualDcTime64()-MeasureStart;

Prerequisites

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.0

PC or CX (x86, x64, Arm®)

Tc2_EtherCAT