GetCtrlPerf

PLCopen motion icon Pipe Network motion icon

 Function BlockClosed A function block groups an algorithm and a set of private data. It has inputs and outputs. - Returns controller CPU performance statistics.

Inputs

Input

Data Type

Range

Unit

Default

Description

Execute

BOOL

0, 1

N/A

No default

On the rising edgeClosed The transition of a digital signal from low to high. AKA: positive edge., request to collect the controller's performance data.

DataPointCount

UDINT

2 - 240,000

Cycles

No default

The number of motion manager cycles over which performance statistics are gathered.

Outputs

Output

Data Type

Range

Unit

Description

Done

BOOL

No range

N/A

If TRUE, the command completed successfully.

Error

BOOL

No range

N/A

If TRUE, an error has occurred.

ErrorID

INT

No range

N/A

  • ErrorID = 0 indicates no error.
  • ErrorID = 1 indicates an error.

MissedCycles

UDINT

No range

N/A

Indicates the number of missing VM cycles.

MeanVmTime

LREAL

≥ 0 (zero)

Microseconds

The mean VM execution time.

StdDevVmTime

LREAL

≥ 0 (zero)

Microseconds

The standard deviation of the VM execution time.

MinVmTime

LREAL

≥ 0 (zero)

Microseconds

The minimum VM execution time.

MaxVmTime

LREAL

≥ 0 (zero)

Microseconds

The maximum VM execution time.

MeanMotMgrTime

LREAL

≥ 0 (zero)

Microseconds

The mean motion manager execution time.

StdDevMotMgrTime

LREAL

≥ 0 (zero)

Microseconds

The standard deviation of the motion manager execution time.

MinMotMgrTime

LREAL

≥ 0 (zero)

Microseconds

The minimum motion manager execution time.

MaxMotMgrTime

LREAL

≥ 0 (zero)

Microseconds

The maximum motion manager execution time.

MeanCpuIdlePct

LREAL

0 to 100

Percent

The mean percentage of time the controller CPU is idle.

StdDevCpuIdlePct

LREAL

0 to 100

N/A

  • AKD PDMM and PCMM: CPU idle period is measured across all CPU cores.
    • See Item 3, Channel 4: AKD PDMM or PCMM - Real Time Margin in the 5. The five buttons section for more information.
  • PCMM2G: CPU idle period is measured across the CPU cores that run the motion engine and PLC program.
    • See Item 3, Channel 4: PCMM2G - PLC Margin in the 5. The five buttons section for more information.

MinCpuIdlePct

LREAL

0 to 100

N/A

  • AKD PDMM and PCMM: CPU idle period is measured across all CPU cores.
    • See Item 3, Channel 4: AKD PDMM or PCMM - Real Time Margin in the 5. The five buttons section for more information.
  • PCMM2G: CPU idle period is measured across the CPU cores that run the motion engine and PLC program.
    • See Item 3, Channel 4: PCMM2G - PLC Margin in the 5. The five buttons section for more information.

MaxCpuIdlePct

LREAL

0 to 100

N/A

  • AKD PDMM and PCMM: CPU idle period is measured across all CPU cores.
    • See Item 3, Channel 4: AKD PDMM or PCMM - Real Time Margin in the 5. The five buttons section for more information.
  • PCMM2G: CPU idle period is measured across the CPU cores that run the motion engine and PLC program.
    • See Item 3, Channel 4: PCMM2G - PLC Margin in the 5. The five buttons section for more information.

Remarks

Generates a text file with performance statistics of the controller.

Figure 1: GetCtrlPerf

FBD Language Example

FFLD Language Example

IL Language Example

Not available.

ST Language Example

//Read controller performance data from last 1000 cycles (1 second at T#1ms update rate)
Inst_GetCtrlPerf( ReadPerformanceData, 1000 );
IF Inst_GetCtrlInfo.Done THEN
   MissedCycles:= Inst_GetCtrlPerf.MissedCycles;
   MaxVmTimeMs:= Inst_GetCtrlPerf.MaxVmTime;
   MaxMotionManagerTime:= Inst_GetCtrlPerf.MaxMotMgrTime;
   MeanCPUIdlePercentage:= Inst_GetCtrlPerf.MeanCpuIdlePct;
   MaxCPUIdlePercentage:= Inst_GetCtrlPerf.MaxCpuIdlePct;
END_IF;

See Also