恭喜,你发布的帖子
发布于 2019-12-21 10:12:14
2楼
c9是计数器,应该是整型变量吧。
DWORD wValue;
wValue = GetTagDWordStateQCWait("c9",&dwState, &dwQC);
wValue:c9值
dwState:变量状态,0表示没有错误,非0,各种的错误,参考"Tag statuses".
dwQC:变量的质量代码。如果质量代码的值为 0x80(优)或 0x4C(初始值),就是好的。其它的都是有问题的。参考“变量的质量代码”
#include "apdefap.h"
int gscAction( void )
{
{
DWORD dwState;
DWORD dwQC;
BOOL bValue,tongxun;
dwState = 0xFFFFFFFF;
//Get the tag value
//dwstate is the tag state
bValue = GetTagBitStateQCWait("c9",&dwState,&dwQC);
//Create a string which includes the tag value
if (bValue)
{
// User defined code if the
// value of the tag is true
SetTagBit("tongxun",0);
}
else
{
// User defined code if the
// value of the tag is false
SetTagBit("tongxun",1
);
}
}
return(0);
这样可以吗
请填写推广理由:
分享
只看
楼主