In order to simulate the function block for the moisture sensor, a global variable list is created. It contained the following variables,

  • sensor_read:REAL;


  •  set_point_in_c:REAL;


  • alarm_delay:TIME:=T#2S;


  • alarm_dead_zone:REAL:=200;


  • max_ppm:REAL:=4000;

       

  • max_ppm_in_volts:REAL:=10;

       

  • min_ppm:REAL:=0;

       

  • min_ppm_in_volts:REAL:=0


  • alarm_high:BOOL;

       

  • alarm_low:BOOL;

       

  • ppm_read:REAL;

A CO2 function block was created in the program, which looked like the following,

Then the visualizer for the simulator was created and looked like this,

With the two states for too high CO2 level and too low CO2 level, shown below,

  • No labels