启动一个脉冲定时器的完整的STL程序如下:
A Enable_input;
FR Timer t;
A Start_input;
L Duration;
SI Timer;
A Reset_input;
R Timer;
L Timer;
T Binary_time_value;
LD Timer;
T BCD_time_value;
A Timer;
= Timer_status;
采用SCL,调用脉冲定时器编程如下:
BCD_time_value:=S_PULSE (
T_NO:=Timer,
S : = Start_input,
TV: =Duration.
R: = Reset_input,
Q : = Timer_status,
BI : =Binary_time_value),