PLC实现重复定时

PLC实现重复定时

PLC实现定时器复位其实是一个很简单的问题,无奈脑子太笨,想了一下午才搞定,写一个小的测试程序如下:

PROGRAM _CYCLIC
    (* Insert code here *)
    TON_0(IN := cmd,PT := T#3s);
    status := TON_0.Q ;
    IF status = 1
        THEN 
        cmd := 0;
        light := 0;
    ELSE
        light := 1;
    END_IF
END_PROGRAM

TON_0是一个TON功能块实例,使用方法如下:

I/O Parameter Data Type Description
IN IN BOOL Input signal
IN PT UDINT Delay time in 10 ms steps
OUT Q BOOL Output signal, the rising edge of the input signal is delayed by PT
OUT ET UDINT Elapsed time in 10 ms increments

全部评论
你好,你这是用什么软件编写的
点赞 回复 分享
发布于 2022-03-06 17:24

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务