Find Max Value
Find and output the maximum integer of two provided DINT inputs.
beginner
Parameters
| Name | Type | Usage | Description |
|---|
| In_Value1 | DINT | Input | First value to compare |
| In_Value2 | DINT | Input | Second value to compare |
| Out_MaxValue | DINT | Output | The greater of the two input values |
Behavior
- Compare In_Value1 and In_Value2.
- If In_Value1 is greater than or equal to In_Value2, copy In_Value1 to Out_MaxValue.
- If In_Value2 is greater than In_Value1, copy In_Value2 to Out_MaxValue.
Edge Cases
- Both inputs are equal.
- Negative values are involved in the comparison.
- One or both inputs are the minimum or maximum possible DINT values.
Constraints
- The comparison must be performed during every scan cycle where the AOI is enabled.
Ready to start?
Open this exercise in Rungs Studio, write your solution, then click Test in the toolbar to verify your work against the built-in test cases.