Maximum Capture (MAXC)

The Maximum Capture (MAXC) instruction retains the maximum value of the input over time and allows the user to re-establish a maximum as needed.
Available Languages
Ladder Diagram
This instruction is not available in ladder diagram logic.
Function Block
This instruction is not available in function block.
Structured Text
MAXC(MAXC_tag);
Operands
Structured Text
Operand
Type
Format
Description
MAXC tag
MAXIMUM_CAPTURE
Structure
MAXC structure
MAXIMUM_CAPTURE Structure
Input Parameter
Data Type
Description
EnableIn
BOOL
Enable input. If cleared, the instruction does not execute and outputs are not updated.
Default is set.
In
REAL
The analog signal input to the instruction.
Valid = any float
Default = 0.0
Reset
BOOL
Request to reset control algorithm. The instruction sets Out = ResetValue as long as Reset is set.
Default is cleared.
ResetValue
REAL
The reset value for the instruction. The instruction sets Out = ResetValue as long as Reset is set.
Valid = any float
Default = 0.0
Output Parameter
Data Type
Description
EnableOut
BOOL
Enable output.
Out
REAL
The calculated output of the algorithm.
See Structured Text syntax for more information on the syntax of expressions within structured text.
Description
The MAXC instruction executes this algorithm:
Condition
Action
Reset is set
LastMaximum = Reset value
Out = LastMaximum
Reset is cleared
If In > LastMaximum then update LastMaximum.
Out = LastMaximum.
Affects Math Status Flags
No
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related faults.
Execution
Structured Text
In Structured Text, EnableIn is always True during a normal scan. If the instruction is in the control path activated by the logic, it executes.
Condition
Action
Prescan
EnableIn and EnableOut bits are cleared to false.
Normal Execution
EnableIn and EnableOut bits are set to true.
The instruction executes.
Postscan
EnableIn and EnableOut bits are cleared to false.
Examples
If Reset is set, the instruction sets Out=ResetValue. If Reset is cleared, the instruction sets Out=In when In> LastMaximum. Otherwise, the instruction sets Out= LastMaximum.
Structured Text
MAXCTag.In := input_value; MAXCTag.Reset := reset_input; MAXCTag.ResetValue := reset_value; MAXC(MAXCTag); result := MAXCTag.Out;
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal