威纶通官方论坛

宏指令怎么做上升沿

[复制链接]
发表于 2024-4-28 14:08:35 | 显示全部楼层 |阅读模式
各位好

  请问用宏指令怎么做上升沿?



macro_command main()

bool b=1,c=0,quanxuan,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30

GetData(a11, "Local HMI", LB, 301, 1)
GetData(a12, "Local HMI", LB, 302, 1)
GetData(a13, "Local HMI", LB, 303, 1)
GetData(a14, "Local HMI", LB, 304, 1)
GetData(a15, "Local HMI", LB, 305, 1)
GetData(a16, "Local HMI", LB, 306, 1)
GetData(a17, "Local HMI", LB, 307, 1)
GetData(a18, "Local HMI", LB, 308, 1)
GetData(a19, "Local HMI", LB, 309, 1)
GetData(a20, "Local HMI", LB, 310, 1)
GetData(a21, "Local HMI", LB, 311, 1)
GetData(a22, "Local HMI", LB, 312, 1)
GetData(a23, "Local HMI", LB, 313, 1)
GetData(a24, "Local HMI", LB, 314, 1)
GetData(a25, "Local HMI", LB, 315, 1)
GetData(a26, "Local HMI", LB, 316, 1)
GetData(a27, "Local HMI", LB, 317, 1)
GetData(a28, "Local HMI", LB, 318, 1)
GetData(a29, "Local HMI", LB, 319, 1)
GetData(a30, "Local HMI", LB, 320, 1)
GetData(quanxuan, "Local HMI", LB, 400, 1)

if a11==1 and a12==1 and a13==1 and a14==1 and a15==1 and a16==1 and a17==1 and a18==1 and a19==1 and a20==1 and a21==1 and a22==1 and a23==1 and a24==1 and a25==1 and a26==1 and a27==1 and a28==1 and a29==1 and a30==1  then


SetData(b, "Local HMI", LB, 400, 1)

end if





在这里,  if a11==1 and a12==1 and a13==1 and a14==1 and a15==1 and a16==1 and a17==1 and a18==1 and a19==1 and a20==1 and a21==1 and a22==1 and a23==1 and a24==1 and a25==1 and a26==1 and a27==1 and a28==1 and a29==1 and a30==1 then  

我想要只有一个上升沿有效,就是说当a11-a30,全部为1 时候,LB400等于1,   这个只是上升沿有效,过了就没有效了,或者说a11-a30等于1延时0.2秒之后  LB400=1,    过了0.2秒就没有触发LB400的能力



发表于 2024-8-2 14:55:50 | 显示全部楼层
使用元件“PLC控制”。或者在宏里自己做中间点的复位。
您需要登录后才可以发帖 登录 | 注册

本版积分规则

回复帖子

Archiver|小黑屋|威纶通官网 ( 粤ICP备06054553号 )

GMT+8, 2024-11-23 16:23

Powered by Discuz! X3.4

© 2001-2023 Comsenz Inc.

快速回复 返回顶部 返回列表