CPU_LOAD

../_images/cc698a92e389f3790a33139000eba54e
Parameter Value
Library_File_Name Diag_AC500_V10.lib
Firmware V1.0.2
Type Type_Function_Block_History
Group -

The Function Block CPU_LOAD outputs the CPU capacitiy utilization in [%].

The following is displayed:

current load

minimum load

maximum load

average (avg) load

The instance CPU of the Function Block CPU_LOAD is declared in the global variables list GL_AC500_Diagnosis. The integrated visualization of the Function Block accesses the variables of this instance.

In order to include the Function Block into an AC500 project, it is only necessary to call the Function Block instance. Example in ST:

CPU(EN := TRUE);

The values are entered as 0.01% values into the internal structure strVisuData of the type strCPU_LOAD in the instance CPU of the Function Block CPU_LOAD. To obtain the values in [%], they have to be divided by 100. The structure is composed as follows:

TYPE strCPU_LOAD :
STRUCT
  Current : WORD; (* current value *)
  Avg : WORD; (* average value *)
  Minimum : WORD; (* minimum value *)
  Maximum : WORD; (* maximum value *)
  Counter : DWORD; (* counter *)
  Conf : WORD; (* bit 0 = 1 (1) –> Update CPU_load *)
      (* bit 1 = 1 (2) –> Heap check *)
END_STRUCT
END_TYPE

If the user program should have access to these values, this is done as follows:

CPU.strVisuData.Variable.

In the following example, the value of the current CPU load is read and assigned to the variable wCurrentCPULoad:

../_images/c6f0c432e389f6940a33139000eba54e

Using the visualization Visu_CPU_Load, the values are represented graphically Visualizations.

The same values can also be polled using the PLC browser command “cpuload”.