威纶通官方论坛

为什么宏指令不运行

[复制链接]
发表于 2013-10-21 13:49:32 | 显示全部楼层 |阅读模式
macro_command main()
int a,b,c
GetData(a, "Local HMI", LW, 9017, 1)
b=a/59
if b==1 then
c=c+1
SetData(c, "Local HMI", LW, 0, 1)
end if
end macro_command

我在屏里面运运LW0的值不加,一直为0,望解答,谢谢
 楼主| 发表于 2013-10-21 15:09:44 | 显示全部楼层
望解答,谢谢
 楼主| 发表于 2013-10-21 15:55:34 | 显示全部楼层
macro_command main()
unsigned short c
unsigned char a,b
GetData(a, "Local HMI", LW, 9017, 1)
b=a/50
if b==1 then
c=c+1
end if
SetData(c, "Local HMI", LW, 0, 1)
end macro_command
是设定不对,这样设就对了,不过还有问题,进来第一次C不为0,不知那么清0
发表于 2013-10-23 13:11:23 | 显示全部楼层
定义的时候赋值为为就好了,unsigned short c=0
您需要登录后才可以发帖 登录 | 注册

本版积分规则

回复帖子

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

GMT+8, 2024-5-19 11:13

Powered by Discuz! X3.4

© 2001-2023 Comsenz Inc.

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