LGF_SearchMinMax_UDInt (FC / V3.0.1)

Overview

Author: Siemens Digital Industries

Short description

This function searches, in an array of the data type UDInt, for the maximum and minimum value and the respective index in the array.

Block Interface

LGF_SearchMinMax_UDInt (FC)
   Ret_Val  Void
    
   minValue  UDInt
    
   minValueIndex  DInt
    
   maxValue  UDInt
    
   maxValueIndex  DInt
    
Array[*] of UDInt  values  Array[*] of UDInt
       
   

Output parameter

IdentifierData type Description
Ret_ValVoid Void - Function has no return value
minValueUDInt Minimum value found in the array
minValueIndexDInt Index of the minimum found value in the array.
The start index of the array plus `minValueIndex` results in the array index of the smallest value. The index starts with 0.
maxValueUDInt Maximum value found in the array
maxValueIndexDInt Index of the maximum found value in the array.
The start index of the array plus `maxValueIndex` results in the array index of the smallest value. The index starts with 0.

In/Out parameter

IdentifierData type Description
valuesArray[*] of UDInt Array in whose fields the maximum and minimum are searched

Functional description

An array of any size is connected via the values input. The elements are then compared in turn. The smallest and largest values, as well as their corresponding index are output to the array.

Note
If there are several identical min. or max. values, the index of the first min. or max. value is output.

Change log

Version & DateChange description
01.00.00Simatic Systems Support
11.11.2019First release
copied from "LGF_SearchMinMax" and reworked to array[*]
03.00.00Simatic Systems Support
23.04.2020Set version to V3.0.0, harmonize the version of the whole library
03.00.01Simatic Systems Support
09.02.2021Insert documentation