AnnexF/weigh_st.txt
changeset 0 fb772792efd1
equal deleted inserted replaced
-1:000000000000 0:fb772792efd1
       
     1 FUNCTION WEIGH : WORD     (* BCD encoded *)
       
     2   VAR_INPUT  (* "EN" input is used to indicate "scale ready" *)
       
     3     weigh_command : BOOL;
       
     4     gross_weight : WORD ; (* BCD encoded *)
       
     5     tare_weight : INT ;
       
     6   END_VAR
       
     7 (* Function Body *)
       
     8 IF weigh_command THEN
       
     9   WEIGH := INT_TO_BCD (BCD_TO_INT(gross_weight) - tare_weight);
       
    10 END_IF ;
       
    11 
       
    12 END_FUNCTION                     (* Implicit "ENO" *)