您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 信息化管理 > WINCC画面读取系统时间
ÈýÖÖ·½·¨£¬¹©Â¥Ö÷Ñ¡Ôñ£º1¡¢±äÁ¿¹ÜÀíÆ÷-´´½¨SYSTEMINFOͨµÀ£¬´´½¨×Ö·û´®ÄÚ²¿±äÁ¿£¬Ñ¡Ôñ¶ÔÓ¦µÄÈÕÆÚ¸ñʽÒÔ¼°Ê±¼ä¸ñʽ¼´¿É¡£2¡¢Îı¾¶ÔÏó-ÊôÐÔ-Îı¾£¬Ê¹ÓÃC½Å±¾£¬´¥·¢ÖÜÆÚ1S£º#pragmacode(kernel32.dll)BOOLGetLocalTime(LPSYSTEMTIME);#pragmacode()charszReturn[255];SYSTEMTIMEsysTime;GetLocalTime(&sysTime);//sprintf(szReturn,%dÄê%dÔÂ%dÈÕ,sysTime.wYear,sysTime.wMonth,sysTime.wDay);//ÈÕÆÚsprintf(szReturn,%d:%d:%d,sysTime.wHour,sysTime.wMinute,sysTime.wSecond);//ʱ¼äreturnszReturn;3¡¢Îı¾¶ÔÏó-ÊôÐÔ-Îı¾£¬Ê¹ÓÃVBS½Å±¾£¬´¥·¢ÖÜÆÚ1S£ºDimtNowtNow=Now()'Text_Trigger=CStr(Year(tNow))&Äê&CStr(Month(tNow))&ÔÂ&CStr(Day(tNow))&ÈÕ'#ÈÕÆÚText_Trigger=CStr(Hour(tNow))&:&CStr(Minute(tNow))&:&CStr(Second(tNow))'#ʱ¼ä#includeapdefap.hvoidOnLButtonDown(char*lpszPictureName,char*lpszObjectName,char*lpszPropertyName,UINTnFlags,intx,inty){//WINCC:TAGNAME_SECTION_START//syntax:#defineTagNameInActionDMTagName//nextTagID:1#defineApcCB_CH1_CG1_MULTI_STAGE_PLUGGINGCB_CG1_MULTI_STAGE_PLUGGING//WINCC:TAGNAME_SECTION_END//WINCC:PICNAME_SECTION_START//syntax:#definePicNameInActionPictureName//nextPicID:1//WINCC:PICNAME_SECTION_ENDif(GetTagBit(ApcCB_CH1_CG1_MULTI_STAGE_PLUGGING))SetTagBit(ApcCB_CH1_CG1_MULTI_STAGE_PLUGGING,0);elseSetTagBit(ApcCB_CH1_CG1_MULTI_STAGE_PLUGGING,1);}
本文标题:WINCC画面读取系统时间
链接地址:https://www.777doc.com/doc-1202252 .html