Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The code for the pressure sensor is based off its techincal data (Gems Sensors & Controls, n.d.), where the minum current of 4mA equals a pressure of 0bar and the maximum current of 20mA equals a pressure of 350mbar.

...

Linear interpolation is performed with the following function (Chapra and Canale, 2015),


This means that the inputs needs to be,

...

And the outputs needs to be,

  • bar_read:REAL;

This Function block could have been a Function. However, to make it easy to expand on the function block in the future, it was created as a Function Block.


The coded implementation looks like this,

Image Added


Visually the new function block looks as following,


References:

Chapra, S.C. and Canale, R.P. (2015). Numerical Methods for Engineers. 7th ed. New York: McGraw-Hill Education. [pdf] Available at: https://gdcboysang.ac.in/About/Droid/uploads/Numerical%20Methods.pdf (Accessed: 28 May 2024).


Gems Sensors & Controls. (n.d.). 3500 Series: Compact Low Pressure OEM Pressure Transmitters. [pdf] Available at: https://media.distrelec.com/Web/Downloads/_t/ds/Gems_3500_eng_tds.pdf (Accessed: 28 May 2024).