| 
 
     
 
  | 
功能描述:点按钮发脉冲的同时记录下当前系统的日期,下次再点按钮时日期更新。- int gscAction( void )
 
 - {
 
 - BOOL Button;
 
 - char* pszValue = NULL;
 
 - char szValue[11];
 
  
- //Get the current value of the tag
 
 - Button=GetTagBit("P3FROMHMISP3B");  //P3FROMHMISP3B为点按钮发脉冲信号所对应的变量
 
 - pszValue = GetTagChar("Date");    //Date为System Info驱动组中8位文本型日期变量MM-DD-YYYY
 
  
- if(pszValue != NULL);
 
 - {
 
 - //Copy the string
 
 - strncpy(szValue,pszValue,10);
 
 - SetTagChar("T1",szValue);    //T1为内部文本变量,获取当前系统日期
 
 - }
 
 - //User-defined code where the
 
 - //user can process the return value
 
 - if (Button)
 
 - {
 
 - SetTagChar("T1_Save",GetTagChar("T1"));    //T1_Save为内部文本变量2,用于存放获取的日期
 
 - }
 
 - return 0; 
 
 - }
 
  复制代码 |   
 
 
 
 |