WinCC中整点启动归档的方法。可以有效的保证数据是准点触发的。
在"Global s cript"下的Project functions编写函数cyclicarchive
BOOL cyclicarchive()
{
#pragma code ("kernel32.dll");
void GetLocalTime (SYSTEMTIME* lpst);
#pragma code();
SYSTEMTIME time;
int t1;
GetLocalTime(&time);
t1=time.wMinute;
if(t1==00)
{
SetTagBit("startarchive",1);
return(BOOL)(GetTagBit("startarchive"));
}
}
在Tagloging中的"Properties of process tag"中的"Archive Tag"tab下的Archiving type选择Cycle-selective,在"Event"标签下的"Start Event"内选择cyclicarchive函数。
我在6.0SP3下测试,采集和归档周期都设为1小时,但是变量归档并没有整点开始,大家试过吗?