Using Realtime Monitor time stamps

MATLAB® commands, such as tic and toc, are popular ways to analyze the performance of code sections in MATLAB®. These commands are not usable in this form during TwinCAT runtime.

For this purpose, TwinCAT provides the TwinCAT Realtime Monitor, which evaluates time stamps in the source code and displays them for analysis. Setting Realtime Monitor time stamps is supported in MATLAB® code, i.e. the time stamps are set in MATLAB® and can be evaluated by the Realtime Monitor after code generation and instantiation in TwinCAT. Running time stamps in MATLAB® results in output to the MATLAB® console.

Class: TwinCAT.ModuleGenerator.Realtime.LogMark

Methods: Start, Stop and Mark

MATLAB® documentation: doc("TwinCAT.ModuleGenerator.Realtime.LogMark")

Using Realtime Monitor time stamps 1:

Example in MATLAB®

TwinCAT.ModuleGenerator.Samples.Start("BaseStatisticsLogMark")