AnnexF/hysteresis_st.txt
author mjsousa
Sat, 08 Feb 2014 18:33:32 +0000
changeset 858 c5f145364a4f
parent 0 fb772792efd1
permissions -rwxr-xr-x
Fix get_datatype_info_c::is_subrange(), which did not work when using base type! (we now use get_equivtype() instead of get_base_type() )
0
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
     1
FUNCTION_BLOCK HYSTERESIS
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
     2
    (* Boolean hysteresis on difference *)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
     3
    (* of REAL inputs, XIN1 - XIN2      *)
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
     4
  VAR_INPUT XIN1, XIN2, EPS : REAL; END_VAR
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
     5
  VAR_OUTPUT Q : BOOL := 0; END_VAR
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
     6
  IF Q THEN IF XIN1 < (XIN2 - EPS) THEN Q := 0; END_IF ;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
     7
  ELSIF XIN1 > (XIN2 + EPS) THEN Q := 1 ;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
     8
  END_IF ;
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
     9
END_FUNCTION_BLOCK
fb772792efd1 Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff changeset
    10