AnnexF/cmd_monitor_il.txt
author Andrey Skvortsov <andrej.skvortzov@gmail.com>
Sun, 14 Oct 2018 20:14:13 +0300
changeset 1073 24ef30a9bcee
parent 0 fb772792efd1
permissions -rwxr-xr-x
revert commits improved performance of some extensible Standard Functions (ADD, MUL, AND, OR, XOR)

Following commits are reverted:
mjsousa 0b275a2 improve performance of some extensible Standard Functions (ADD, MUL, AND, OR, XOR) -- increase hardcoded limit to 499
mjsousa 2228799 improve performance of some extensible Standard Functions (ADD, MUL, AND, OR, XOR) -- Add comments!!
mjsousa ce81fa6 improve performance of some extensible Standard Functions (ADD, MUL, AND, OR, XOR)"

The reason is that they cause regression in some cases (if function is
used as argument for function block, for example) and this is not
fixed for a long time.
FUNCTION_BLOCK CMD_MONITOR
 VAR_INPUT AUTO_CMD : BOOL ; (* Automated command *)
          AUTO_MODE : BOOL ; (* AUTO_CMD enable *)
            MAN_CMD : BOOL ; (* Manual Command *)
        MAN_CMD_CHK : BOOL ; (* Negated MAN_CMD to debounce *)  
          T_CMD_MAX : TIME ; (* Max time from CMD to FDBK *)
               FDBK : BOOL ; (* Confirmation of CMD completion     
                                by operative unit *)               
                ACK : BOOL ; (* Acknowledge/cancel ALRM *)         
 END_VAR
 VAR_OUTPUT CMD : BOOL ;   (* Command to operative unit *)
           ALRM : BOOL ;   (* T_CMD_MAX expired without FDBK *)
 END_VAR
 VAR CMD_TMR : TON ;    (* CMD-to-FDBK timer *)
     ALRM_FF : SR ;     (* Note over-riding S input: *)
 END_VAR                (* Command must be cancelled before
                              "ACK" can cancel alarm *)
 (* Function Block Body *)
LD	T_CMD_MAX	
ST	CMD_TMR.PT	(* Store an input to the TON FB *)
LD	AUTO_CMD	
AND	AUTO_MODE	
OR(	MAN_CMD	
ANDN	AUTO_MODE	
ANDN	MAN_CMD_CHK	
)		
ST	CMD	
IN	CMD_TMR	(* Invoke the TON FB *)
LD	CMD_TMR.Q	
ANDN	FDBK	
ST	ALRM_FF.S1	(* Store an input to the SR FB *)
LD	ACK	
R	ALRM_FF	(* Invoke the SR FB *)
LD	ALRM_FF.Q1	
ST    	ALRM	

END_FUNCTION_BLOCK