LGF_SearchMinMax_DInt (FC / V3.0.2)

Overview

Author: Siemens Digital Industries

Short description

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

Block Interface

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

Output parameter

IdentifierData type Description
Ret_ValVoid Void - Function has no return value
minValueDInt 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.
maxValueDInt 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 DInt 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
03.00.02Simatic Systems Support
14.11.2022Fix loop start index (start from lower Bound + 1)