pcsms_q1MSCveO 发表于 2021-10-4 19:12:19

怎么用HMI的宏指令实现一键启停逻辑

怎么用HMI的宏指令实现一键启停逻辑

pcsms_BsKJa84Z 发表于 2022-6-23 11:16:50

macro_command main()
bool a,QB_lamp,MB_Rising_edge
bool on=1,off=0
GetData(a, "Local HMI", LB, 0, 1)

//产生上升沿
if a and not a then
MB_Rising_edge=1
end if

//启动自锁
GetData(QB_lamp, "Local HMI", LB, 10, 1)
if ( MB_Rising_edge and not QB_lamp ) or (not MB_Rising_edge andQB_lamp) then
SetData(on, "Local HMI", LB, 10, 1)
else
SetData(off, "Local HMI", LB, 10, 1)
end if

//复位上升沿和保持
MB_Rising_edge=0
a=a
end macro_command
页: [1]
查看完整版本: 怎么用HMI的宏指令实现一键启停逻辑