Timer with switch-off delay
The function block TOF allows you to program a switch-off delay, e.g. to switch off the ventilator of a machine at a later point in time than the machine itself.
Input
timer ON
an internal timer is started if a falling edge is detected at IN. If a rising edge is detected at IN before PT has reached its value, Q will not be switched off
switch-off delay (PT = preset time)
16-bit value: 0–327.27s
32-bit value: 0–21,474,836.47s (32-bit value not available for FP3, FPC, FP5, FP10/10S)
resolution 10ms each
Output
signal output
reset (FALSE) if PT = ET
elapsed time
indicates the current value of the elapsed time
The value can be changed during counting operation by writing to the variable from the programming editor.
Q is switched off with a delay corresponding to the time defined in PT. Switching on is carried out without delay.
If IN (as in the time chart t3 to t4) is set prior to the lapse of the delay time PT, Q remains set (time chart for t2 to t3).
All input and output variables used for programming this function have been declared in the POU header. The same POU header is used for all programming languages.
VAR
copy_name: TOF;
start: BOOL:=FALSE;
set_value: TIME:=T#0s;
signal_output: BOOL:=FALSE;
current_value: TIME:=T#0s;
END_VAR
If start is reset, this signal is transferred to signal_output with a delay corresponding to the period of time set_value.
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 6 ;
NETWORK_BODY
B(B_FB,TOF!,copy_name,9,1,14,5,,?BIN?BPT?AQ?AET);
B(B_CONTACT,,start,3,2,5,4,);
B(B_VARIN,,set_value,7,3,9,5,);
B(B_VAROUT,,current_value,14,3,16,5,);
B(B_COIL,,signal_output,21,2,23,4,);
L(1,3,3,3);
L(5,3,9,3);
L(14,3,21,3);
L(1,0,1,6);
END_NETWORK_BODY
END_NET_WORK
END_BODY
copy_name( IN:= start ,
PT:= set_value ,
Q=> signal_output ,
ET=> current_value );
If you want to call the function block in an instruction list, enter the following:
CAL |
copy_name(IN:= start,, PT:= set_value,, Q:= signal_output,, ET:= current_value,) |