怎么用HMI的宏指令实现一键启停逻辑
怎么用HMI的宏指令实现一键启停逻辑 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]