发布于 2012-05-11 10:34:13
5楼
#include "apdefap.h"
char* _main(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)
{
#pragma option(mbcs)
// WINCC:TAGNAME_SECTION_START
// syntax: #define TagNameInAction "DMTagName"
// next TagID : 2
#define TAG_1 "BB15002"
// WINCC:TAGNAME_SECTION_END
// WINCC:PICNAME_SECTION_START
// syntax: #define PicNameInAction "PictureName"
// next PicID : 1
// WINCC:PICNAME_SECTION_END
if ((GetTagDWord (TAG_1)) & 0x4)
return "油箱温度高";
else if ((GetTagDWord (TAG_1)) & 0x8)
return "油箱温度低";
else
return "油箱温度正常";
}
谁能帮我解释下0x4或0x8的意义?这是怎么用的?
#include "apdefap.h"
char* _main(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)
{
#pragma option(mbcs)
// WINCC:TAGNAME_SECTION_START
// syntax: #define TagNameInAction "DMTagName"
// next TagID : 1
// WINCC:TAGNAME_SECTION_END
// WINCC:PICNAME_SECTION_START
// syntax: #define PicNameInAction "PictureName"
// next PicID : 1
// WINCC:PICNAME_SECTION_END
#define TAG_1 "B17005"
#define TAG_2 "B17006"
#define TAG_3 "B17007"
#define TAG_4 "B17008"
if((unsigned long )GetTagDouble(TAG_1))
return "油箱温度超低";
if((unsigned long )GetTagDouble(TAG_2))
return "油箱温度低";
if((unsigned long )GetTagDouble(TAG_3))
return "油箱温度高";
if((unsigned long )GetTagDouble(TAG_4))
return "油箱温度超高";
else
return "油箱温度正常";
}
以前我是这么做的,怎样弄成上面那种??谢谢!!!