You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

The Pressure sensor utilized is from Gens and has the following parts number: 3500B350MG05G000 

The code for the pressure sensor is based off its techincal data, 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,


This means that the inputs needs to be,

  • sensor_reading:REAL;
  • max_bar:REAL;
  • max_bar_in_mAmps:REAL;
  • min_bar:REAL;
  • min_bar_in_mAmps:REAL;


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,


Visually the new function block looks as following,




  • No labels