触摸屏的软件版本为EBproV6.02.02.392_20190606
写了一个宏指令,读取触摸屏的实时时间,与定时时间比较,如果时间超了,就把启动按钮隐藏.plc为台达plc
这些隐藏的按钮为变频器的正反转.一共有六个变频器,其中五个变频器正反装正常,而第四个变频器反转有效,正转无效,
没有写这个宏指令的程序正常,第四个变频器可以正反转,有宏指令的就不正常,想问一下怎么解决,是触摸屏的bug吗
宏指令:
- macro_command main()
- short a[3]
- short b[3]
- bool c=0
- short ys
- short ysxlh[6]
- short yjxlh[6]
- short srxlh[6]
- GetData(a[0], "Local HMI", RW, 10, 3)
- GetData(b[0], "Local HMI", LW, 9020, 3)
- GetData(ysxlh[0], "Local HMI", RW, 20, 6)
- GetData(yjxlh[0], "Local HMI", RW, 30, 6)
- GetData(srxlh[0], "Local HMI", RW, 40, 6)
- GetData(ys, "Local HMI", RW, 50, 1)
- if b[2]>a[2] then
- c = 1
- end if
- if b[2]<a[2] then
- c = 0
- end if
- if b[2]==a[2] then
- if b[1]>a[1] then
- c = 1
- end if
- if b[1]<a[1] then
- c = 0
- end if
- end if
- if b[2]==a[2] then
- if b[1]==a[1] then
- if b[0]>=a[0] then
- c = 1
- end if
- if b[0]<a[0] then
- c = 0
- end if
- end if
- end if
- if ysxlh[0]==srxlh[0] and ysxlh[1]==srxlh[1] and ysxlh[2]==srxlh[2] and ysxlh[3]==srxlh[3] and ysxlh[4]==srxlh[4] and ysxlh[5]==srxlh[5] then
- a[2]=b[2]+ys
- a[1]=b[1]
- a[0]=b[0]
- SetData(a[0], "Local HMI", RW, 10, 3)
- srxlh[0]=-1
- srxlh[1]=-1
- srxlh[2]=-1
- srxlh[3]=-1
- srxlh[4]=-1
- srxlh[5]=-1
- SetData(srxlh[0], "Local HMI", RW, 40, 6)
- end if
- if yjxlh[0]==srxlh[0] and yjxlh[1]==srxlh[1] and yjxlh[2]==srxlh[2] and yjxlh[3]==srxlh[3] and yjxlh[4]==srxlh[4] and yjxlh[5]==srxlh[5] then
- a[2]=9999
- a[1]=12
- a[0]=31
- SetData(a[0], "Local HMI", RW, 10, 3)
- srxlh[0]=-1
- srxlh[1]=-1
- srxlh[2]=-1
- srxlh[3]=-1
- srxlh[4]=-1
- srxlh[5]=-1
- SetData(srxlh[0], "Local HMI", RW, 40, 6)
- end if
- SetData(c, "Local HMI", LB, 0, 1)
- end macro_command
复制代码
|