有关一个C脚本的问题? 点击:1324 | 回复:0



0987654321

    
  • 精华:0帖
  • 求助:0帖
  • 帖子:6帖 | 39回
  • 年度积分:0
  • 历史总积分:118
  • 注册:2003年12月10日
发表于:2007-01-11 08:54:00
楼主
 在WinCC中,线段的COLOR属性编了如下C脚本:

#include "apdefap.h"
 long _main(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)
{
// WINCC:TAGNAME_SECTION_START
// syntax: #define TagNameInAction "DMTagName"
// next TagID : 2
#define TAG_1 "HOLE_POS_FROM_WHD1_PER"
#define TAG_2 "Zone2"
#define COLOR_1 4227327
#define COLOR_2 CO_YELLOW
#define COLOR_3 16744703
#define COLOR_4 CO_CYAN
#define limit 1

// WINCC:TAGNAME_SECTION_END

// WINCC:PICNAME_SECTION_START
// syntax: #define PicNameInAction "PictureName"
// next PicID : 1
// WINCC:PICNAME_SECTION_END

if (((GetTagDWord (TAG_2)) & 0x1) &&  !((GetTagDWord (TAG_2)) & 0x2))
{
static double limitValue[2] = {limit *78,limit*79};
static long value[3] = {COLOR_4,COLOR_1,COLOR_1};
return value[Check_LimitsD (GetTagDouble (TAG_1), 3, &limitValue[0])];
}
if (((GetTagDWord (TAG_2)) & 0x2) &&  !((GetTagDWord (TAG_2)) & 0x1))
{
static double limitValue[2] = {limit *78,limit*79};
static long value[3] = {COLOR_1,COLOR_2,COLOR_2};
return value[Check_LimitsD (GetTagDouble (TAG_1), 3, &limitValue[0])];
}
if (((GetTagDWord (TAG_2)) & 0x1) &&  ((GetTagDWord (TAG_2)) & 0x2))
{
static double limitValue[2] = {limit *78,limit*79};
static long value[3] = {COLOR_2,COLOR_3,COLOR_3};
return value[Check_LimitsD (GetTagDouble (TAG_1), 3, &limitValue[0])];
}
if((GetTagDWord(TAG_2)) & 0x4) 
{
static double limitValue[2] = {limit *78,limit*79};
static long value[3] = {COLOR_3,COLOR_4,COLOR_4};
return value[Check_LimitsD (GetTagDouble (TAG_1), 3, &limitValue[0])];
}
}

那位高手能帮我解释一下,程序中Check_LimitsD 函数是什么意思,他是c标准函数马?我原以为是搞这套程序的工程师编的函数,但在project function中没有找到,有知道的麻烦告诉我一下,谢谢


热门招聘
相关主题

官方公众号

智造工程师