恭喜,你发布的帖子
发布于 2019-08-01 14:46:58
14楼
帮我看看,谢谢
sRet=SysMalloc(10);
if (((GetTagWord("Motor0.PUTCommand")&0x1)==0 )&& ((GetTagWord("Motor0.PUTCommand")&0x2)==0))
strcpy(sRet,"停止");
if (((GetTagWord("Motor0.PUTCommand")&0x1)==1) && ((GetTagWord("Motor0.PUTCommand")&0x2)==0))
strcpy(sRet,"运行");
if (((GetTagWord("Motor0.PUTCommand")&0x1)==0) && ((GetTagWord("Motor0.PUTCommand")&0x2)==1))
strcpy(sRet,"故障");
return (sRet);
}
我给Motor0.PUTCommand赋值2时,故障条件满足,显示不对
你这样写的目的是干什么?
sRet=SysMalloc(10);
if (GetTagWord("Motor0.PUTCommand")==0 )
strcpy(sRet,"停止");
if (GetTagWord("Motor0.PUTCommand")==1)
strcpy(sRet,"运行");
if (GetTagWord("Motor0.PUTCommand")==2)
strcpy(sRet,"故障");
return (sRet);
}
请填写推广理由:
分享
只看
楼主