Scale and compare

The high-level output turns on above 80 % and turns off only below 75 %.

Step by step

Pick a step. The rungs are drawn by the editor after Core scans the program up to that step.

1. 12 mA. SCALE gives 50 %. Neither branch passes, so HighLevel is off.

StepRaw_mALevelHighLevel
1. 12 mA12500
2. 18 mA1887.51
3. 17 mA1781.251
4. 16.5 mA16.578.1251
5. 15.5 mA15.571.8750
6. 16.5 mA16.578.1250

Why it works

  • SCALE maps 4 to 20 mA onto 0 to 100 %, so 12 mA is 50 %.
  • The first branch turns HighLevel on above 80. The second branch is a seal: once HighLevel is on it stays on while Level is at least 75.
  • Steps 4 and 6 have the same level but a different result. The 5 % gap is the deadband. Without it, a level hovering at 80 turns the output on and off every scan.

Common mistakes

  • One compare for on and offGRT Level 80 alone chatters when the level ripples around 80.
  • Ignoring a broken sensorBelow 4 mA the scaled value goes negative. Check for a low mA value and treat it as a fault.

Instructions used

Related