Raw Analog Values
Part of the Analog and Sequences section of Coddy's PLC Programming journey. Lesson 3 of 17.
A switch only says above or below. Most tanks also have a level transmitter: a sensor that measures how full the tank is, anywhere from empty to full. It is an analog input: a number, not TRUE or FALSE.
The PLC's input card turns the signal into a whole number, the raw value. Here Level is an INT from 0 (empty) to 32767 (full), wired to %IW0. Real input cards use other ranges: a Siemens card reads 0 to 27648, so check the card's manual. Open the I/O table and watch it change while the tank fills.
To act at a level, compare the raw number. 80 % is 32767 × 0.8, rounded: 26214.
The number 80 would be wrong here. Level passes 80 a moment after the tank starts to fill.
Challenge
EasyMake the tank fill to half instead of High. In the fill rung, replace the High contact with a compare box that passes power while Level is below 16384, which is 50 %.
Try it yourself
{"v":1,"lang":"ld","tags":[],"rungs":[{"els":[{"t":"par","branches":[[{"t":"no","tag":"Start"}],[{"t":"no","tag":"Fill"}]]},{"t":"no","tag":"Stop"},{"t":"nc","tag":"High"},{"t":"coil","tag":"Fill"}]}]}All lessons in Analog and Sequences
1Analog Inputs
Fill to HighHysteresisRaw Analog ValuesScaling to PercentA High Level AlarmA ThermostatPractice on your own: PLC playground