发布于 2011-03-09 10:40:02
2楼
#include "apdefap.h"
char* _main(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)
{
#pragma option(mbcs)
#define apc_tag "ActValue"
#define apc_tag1 "SetValue"
static char TrendTag[120];
static char TrendTag1[120];
static long int Index_Trend = 0;
sprintf (TrendTag,"%s" apc_tag,GetTagPrefix (GetParentPicture(lpszPictureName), GetParentPictureWindow (lpszPictureName)));
sprintf (TrendTag1,"%s" apc_tag1,GetTagPrefix (GetParentPicture(lpszPictureName), GetParentPictureWindow (lpszPictureName)));
SetIndex(lpszPictureName, "Tr_Ctrl", Index_Trend);
if (Index_Trend == 0){
Index_Trend++;
return TrendTag;
}
if (Index_Trend == 1){
Index_Trend = 0;
return TrendTag1;
}
}
运行起来只是第一条曲线在来回显示2个变量的值,第二条曲线显示无效组态(Invalid Configuration)。(wincc7.0+sp1)
本意是在同一趋势控件上同时显示2个变量的曲线。