All exercises

Pressure Comparator

Monitor a pressure value against a static threshold to determine if a critical motor state is reached.

beginner

Parameters

NameTypeUsageDescription
In_PressureREALInputCurrent pressure reading to monitor.
Out_MotorCriticalBOOLOutput1 when pressure is below the threshold, 0 otherwise.

Behavior

  1. Compare the input In_Pressure to the internal Threshold value.
  2. If In_Pressure is less than the Threshold, set Out_MotorCritical to 1.
  3. If In_Pressure is greater than or equal to the Threshold, set Out_MotorCritical to 0.

Edge Cases

  • Performance when In_Pressure is exactly equal to the threshold.
  • Handling of negative REAL values for In_Pressure.

Constraints

  • Threshold must be initialized to 36464.0.
  • Comparison logic must execute every scan.

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.