F137_STMR

Timer 16 bit

The auxiliary timer instruction F137_STMR is a down type timer. The formula of the timer-set time is 0.01 sec. * set value s (time can be set from 0.01 to 327.67 sec.). If you use the special internal flag R900D as the timer contact, be sure to program it at the address immediately after the instruction.

Timer operation:

  • If the trigger EN of the auxiliary timer instruction (STMR) is in the ON-state, the constant or value specified by s is transferred to the area specified by d.

  • During the timing operation, the time is subtracted from the value in the area specified by d.

  • The output ENO turns ON when the value in the area specified by d becomes 0.

  • The variables s and d have to be of the same data type.

Parameters

Input

s (WORD, INT, UINT)

16-bit area or equivalent constant for timer set value

Output

d (WORD, INT, UINT)

16-bit area for timer elapsed value

Example

POU header

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
		bstart: BOOL:=FALSE;
			(*activates the timer*)
		iSetValue: INT:=600;
			(*six seconds (600 * 0,01s)*)
		iElapsedValue: INT:=0;
		bTimerOutput: BOOL:=FALSE;
			(*set to TRUE after 6s have elapsed*)
	END_VAR

LD body

BODY
    WORKSPACE
        NETWORK_LIST_TYPE := NWTYPELD ;
        ACTIVE_NETWORK := 0 ;
    END_WORKSPACE
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 5 ;
        NETWORK_BODY
B(B_VARIN,,iSetValue,7,2,9,4,);
B(B_VAROUT,,iElapsedValue,16,2,18,4,);
B(B_CONTACT,,bstart,4,1,6,3,);
B(B_COIL,,bTimerOutput,23,1,25,3,);
B(B_F,F137_STMR!,Instance,9,0,16,4,,?DEN?D@'s'?AENO?Cd);
L(1,2,4,2);
L(6,2,9,2);
L(16,2,23,2);
L(1,0,1,5);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

Modified on: 2019-01-26Feedback on this pagePanasonic hotline