Versions Compared

Key

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

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

  •     sensor

     sensor_read:REAL;


  •     set

     set_point_in_pRh:REAL;


  •    

    alarm_delay:TIME:=T#2S;


  •    

    alarm_dead_zone:REAL:=5;


  •    

    max_pRh:REAL:=100;


  •    

    max_pRh_in_volts:REAL:=10;


  •    

    min_pRh:REAL:=0;


  •    

    min_pRh_in_volts:REAL:=0;


  •    

    alarm_high:BOOL;

       


  • alarm_low:BOOL;

       

  • pRh_read:REAL;

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

Image Added

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

Image Added

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

Image AddedImage Added