威纶通官方论坛

宏指令执行太慢了,跟死机样

[复制链接]
发表于 2013-11-27 09:44:49 | 显示全部楼层 |阅读模式
我用MT6070IH连了4块仪表,写了下面的宏指令,循环执行1秒、5秒都不行,太慢了,半天都反应不过来:
macro_command main()
short a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a20
GetData(a0, "本机 触摸屏", LW, 0, 1)
GetData(a1, "本机 触摸屏", LW, 1, 1)
GetData(a2, "本机 触摸屏", LW, 2, 1)
GetData(a3, "本机 触摸屏", LW, 3, 1)

GetData(a4, "本机 触摸屏", LW, 4, 1)
GetData(a5, "本机 触摸屏", LW, 5, 1)
GetData(a6, "本机 触摸屏", LW, 6, 1)
GetData(a7, "本机 触摸屏", LW, 7, 1)

GetData(a8, "本机 触摸屏", LW, 8, 1)
GetData(a9, "本机 触摸屏", LW, 9, 1)
GetData(a10, "本机 触摸屏", LW, 10, 1)
GetData(a11, "本机 触摸屏", LW, 11, 1)

GetData(a20, "本机 触摸屏", LW, 20, 1)

SetData(a0, "MODBUS RTU", 4x, 1#41283, 1)
SetData(a0, "MODBUS RTU", 4x, 2#41283, 1)
SetData(a0, "MODBUS RTU", 4x, 3#41283, 1)
SetData(a1, "MODBUS RTU", 4x, 1#41286, 1)
SetData(a1, "MODBUS RTU", 4x, 2#41286, 1)
SetData(a1, "MODBUS RTU", 4x, 3#41286, 1)
SetData(a2, "MODBUS RTU", 4x, 1#41289, 1)
SetData(a2, "MODBUS RTU", 4x, 2#41289, 1)
SetData(a2, "MODBUS RTU", 4x, 3#41289, 1)
SetData(a3, "MODBUS RTU", 4x, 1#41292, 1)
SetData(a3, "MODBUS RTU", 4x, 2#41292, 1)
SetData(a3, "MODBUS RTU", 4x, 3#41292, 1)

SetData(a4, "MODBUS RTU", 4x, 1#41282, 1)
SetData(a4, "MODBUS RTU", 4x, 2#41282, 1)
SetData(a4, "MODBUS RTU", 4x, 3#41282, 1)
SetData(a5, "MODBUS RTU", 4x, 1#41285, 1)
SetData(a5, "MODBUS RTU", 4x, 2#41285, 1)
SetData(a5, "MODBUS RTU", 4x, 3#41285, 1)
SetData(a6, "MODBUS RTU", 4x, 1#41288, 1)
SetData(a6, "MODBUS RTU", 4x, 2#41288, 1)
SetData(a6, "MODBUS RTU", 4x, 3#41288, 1)
SetData(a7, "MODBUS RTU", 4x, 1#41291, 1)
SetData(a7, "MODBUS RTU", 4x, 2#41291, 1)
SetData(a7, "MODBUS RTU", 4x, 3#41291, 1)

SetData(a8, "MODBUS RTU", 4x, 1#41281, 1)
SetData(a8, "MODBUS RTU", 4x, 2#41281, 1)
SetData(a8, "MODBUS RTU", 4x, 3#41281, 1)
SetData(a9, "MODBUS RTU", 4x, 1#41284, 1)
SetData(a9, "MODBUS RTU", 4x, 2#41284, 1)
SetData(a9, "MODBUS RTU", 4x, 3#41284, 1)
SetData(a10, "MODBUS RTU", 4x, 1#41287, 1)
SetData(a10, "MODBUS RTU", 4x, 2#41287, 1)
SetData(a10, "MODBUS RTU", 4x, 3#41287, 1)
SetData(a11, "MODBUS RTU", 4x, 1#41290, 1)
SetData(a11, "MODBUS RTU", 4x, 2#41290, 1)
SetData(a11, "MODBUS RTU", 4x, 3#41290, 1)

SetData(a20, "MODBUS RTU", 4x, 1#40024, 1)
SetData(a20, "MODBUS RTU", 4x, 2#40024, 1)
SetData(a20, "MODBUS RTU", 4x, 3#40024, 1)

end macro_command


怎么办啊!!
您需要登录后才可以发帖 登录 | 注册

本版积分规则

回复帖子

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

GMT+8, 2024-11-24 21:20

Powered by Discuz! X3.4

© 2001-2023 Comsenz Inc.

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