威纶通官方论坛

按钮点击无效问题

[复制链接]
发表于 2020-11-8 10:50:13 | 显示全部楼层 |阅读模式

触摸屏的软件版本为EBproV6.02.02.392_20190606
写了一个宏指令,读取触摸屏的实时时间,与定时时间比较,如果时间超了,就把启动按钮隐藏.plc为台达plc
这些隐藏的按钮为变频器的正反转.一共有六个变频器,其中五个变频器正反装正常,而第四个变频器反转有效,正转无效,
没有写这个宏指令的程序正常,第四个变频器可以正反转,有宏指令的就不正常,想问一下怎么解决,是触摸屏的bug吗

宏指令:

  1. macro_command main()
  2. short a[3]
  3. short b[3]
  4. bool c=0
  5. short ys

  6. short ysxlh[6]
  7. short yjxlh[6]
  8. short srxlh[6]

  9. GetData(a[0], "Local HMI", RW, 10, 3)
  10. GetData(b[0], "Local HMI", LW, 9020, 3)

  11. GetData(ysxlh[0], "Local HMI", RW, 20, 6)
  12. GetData(yjxlh[0], "Local HMI", RW, 30, 6)
  13. GetData(srxlh[0], "Local HMI", RW, 40, 6)

  14. GetData(ys, "Local HMI", RW, 50, 1)

  15. if b[2]>a[2]  then
  16.   c = 1
  17. end if
  18. if b[2]<a[2]  then
  19.   c = 0
  20. end if
  21. if b[2]==a[2] then
  22.         if b[1]>a[1]  then
  23.                 c = 1
  24.         end if
  25.         if b[1]<a[1]  then
  26.                 c = 0
  27.         end if
  28. end if
  29. if b[2]==a[2] then
  30.         if b[1]==a[1] then
  31.                 if b[0]>=a[0] then
  32.                         c = 1
  33.                 end if
  34.                 if b[0]<a[0] then
  35.                         c = 0
  36.                 end if
  37.         end if
  38. end if


  39. 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
  40.         a[2]=b[2]+ys
  41.         a[1]=b[1]
  42.         a[0]=b[0]
  43.         SetData(a[0], "Local HMI", RW, 10, 3)
  44.         srxlh[0]=-1
  45.         srxlh[1]=-1
  46.         srxlh[2]=-1
  47.         srxlh[3]=-1
  48.         srxlh[4]=-1
  49.         srxlh[5]=-1
  50.         SetData(srxlh[0], "Local HMI", RW, 40, 6)
  51. end if


  52. 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
  53.         a[2]=9999
  54.         a[1]=12
  55.         a[0]=31
  56.         SetData(a[0], "Local HMI", RW, 10, 3)
  57.         srxlh[0]=-1
  58.         srxlh[1]=-1
  59.         srxlh[2]=-1
  60.         srxlh[3]=-1
  61.         srxlh[4]=-1
  62.         srxlh[5]=-1
  63.         SetData(srxlh[0], "Local HMI", RW, 40, 6)
  64. end if

  65. SetData(c, "Local HMI", LB, 0, 1)

  66. end macro_command


复制代码



发表于 2020-11-9 08:52:08 | 显示全部楼层
您好  请您将有效的相关信息:公司名称  贵姓 以及联系方式 问题详况(最好将程序发送过来)
发送至tech@weinview.cn,我司会有对应人员为您跟进沟通问题,谢谢!
发表于 2020-11-13 10:08:56 | 显示全部楼层
请教一下
数组比较是否想等 只能一个一个这样比较吗?
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]
有没有什么别的好方法?
发表于 2020-11-13 17:13:51 | 显示全部楼层
请教一下
数组比较是否想等 只能一个一个这样比较吗?
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]
有没有什么别的好方法?

您好
欢迎您来威纶通论坛交流疑问。
论坛有分“HMI综合版”“Macro宏指令版”“变频器综合版”等
请大家“对号发帖”,谢谢配合。
您需要登录后才可以发帖 登录 | 注册

本版积分规则

回复帖子

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

GMT+8, 2024-9-20 13:47

Powered by Discuz! X3.4

© 2001-2023 Comsenz Inc.

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