如何在WinCC中读取系统时间,使用c脚本:
#pragmacode("kernel32.dll");
VoidGetLocalTimes(SYSTEMTIME*lpst);
#pragmacode();
SYSTEMTIMEtime;
GetLocalTime(&time);
SetTagWord("Varname",time.wYear);
SetTagWord("Varname",time.wMonth);
SetTagWord("Varname",time.wDayOfWeek);
SetTagWord("Varname",time.wDay);
SetTagWord("Varname",time.wHour);
SetTagWord("Varname",time.wMinute);
SetTagWord("Varname",time.wSecond);
SetTagWord("Varname",time.wMilliseconds);
楼主最近还看过