MIN_HOLD block
Short summary
Name |
MIN_HOLD |
→POU type |
|
Category |
|
Conform to →IEC-standard |
not defined in IEC-standard |
Graphical interface |
|
Available since |
version 1.43.0 (for logi.CAD 3) |
Functionality
The block is a peak detector which sets the output OUT to the minimum value assigned to the input IN. Setting the input R to the value TRUE (or an equivalent) resets the output value OUT to the current input value IN.
Restrictions
The following restrictions apply to the usage of overloadable function block instances:
The declaration is limited to local variables.
The usage as array base type is not allowed.
The usage as structure element is not allowed.
Instance data cannot be displayed in the Values of Variables view.
In-/outputs
|
Identifier |
Description |
|
Inputs: |
IN |
REAL, LREAL, USINT, UINT, UDINT, ULINT, SINT, INT, DINT or LINT |
input value |
R |
BOOL |
reset |
|
Outputs: |
OUT |
REAL, LREAL, USINT, UINT, UDINT, ULINT, SINT, INT, DINT or LINT |
minimum value |
Input EN and output ENO are available when →calling the block. See "Execution control: EN, ENO" for information on input EN and output ENO.
Example for usage within ST-editor
FUNCTION_BLOCK ExampleMinHold
VAR
iMinHold : MIN_HOLD;
inputValues : ARRAY [1..3] OF INT := [1, 10, -5];
resultValues : ARRAY [1..3] OF INT;
index : INT;
END_VAR
// Reset 'OUT' to '32767'.
iMinHold(IN := 32767, R := TRUE);
FOR index := 1 TO 3 DO
iMinHold(IN := inputValues[index], R := FALSE, OUT => resultValues[index]);
END_FOR;
// 'resultValues' evaluates to '[1,1,-5]'.
ENO := AND(resultValues[1] = 1, resultValues[2] = 1, resultValues[3] = -5);
END_FUNCTION_BLOCK
When creating your application within the ST-editor, enter a call of a block by typing the text as requested by the syntax or use Content Assist.