Loading…

Method Name: current_date_time_method

Method ID: 0x46C8

Method Label: Current Date/Time

Method Help:


  • {
  • char status[3];
  • int j;
  • int iHour, iMinite, iSecond, iTime;
  • DD_STRING sHour, sMinite, sSecond, sTime, sDummy;
  • _set_all_resp_code(0);
  • _set_xmtr_all_resp_code(0);
  • _set_device_status(0xFF,0);
  • _set_xmtr_device_status(0xFF,0);
  • send(190, status); if(status[0]) { display_response_status(190, status[0]); DELAY(3,"|en|Aborting method due to last error"); process_abort(); }
  • iTime = current_time_device_int;
  • iHour = (iTime/32000) / 3600; iMinite = ((iTime/32000)-(3600*iHour)) / 60; iSecond = (iTime/32000)-(3600*iHour + 60*iMinite); sHour = itoa( ( iHour),"|en|sDummy", ( 10) ); for(j=2-strlen(sHour); j>0; j--) { sHour ="|en|0" + sHour; }; sMinite = itoa( ( iMinite),"|en|sDummy", ( 10) ); for(j=2-strlen(sMinite); j>0; j--) { sMinite ="|en|0" + sMinite; }; sSecond = itoa( ( iSecond),"|en|sDummy", ( 10) ); for(j=2-strlen(sSecond); j>0; j--) { sSecond ="|en|0" + sSecond; }; sTime = sHour +"|en|:" + sMinite +"|en|:" + sSecond;
  • sTime = BUILD_MESSAGE(sTime);


Please login for more