All exercises

Find Max Value

Find and output the larger of two DINT inputs every scan in this rungs.dev AOI. Handles equal values, negative values, and the full DINT range correctly.

beginner

Parameters

NameTypeUsageDescription
In_Value1DINTInputFirst value to compare
In_Value2DINTInputSecond value to compare
Out_MaxValueDINTOutputThe greater of the two input values

Behavior

  1. Compare In_Value1 and In_Value2 every scan using standard DINT comparison semantics.
  2. If In_Value1 is greater than or equal to In_Value2, copy In_Value1 to Out_MaxValue.
  3. If In_Value2 is greater than In_Value1, copy In_Value2 to Out_MaxValue.
  4. The AOI must handle equal values, negative values, and full-range DINT inputs.

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.