
          // set the ISUS sample rate
          if( (srchptr=strstr(cbuf, "RATE,")) != NULL ){

            if(strchr(srchptr, '?') != NULL){
              printf("ACK,RATE?,%lu\n", isus_sleep);
              SerInFlush();
              continue;
              }

            i = gotVal = 0;
            srchptr = strtok(srchptr, ",");
            while( (srchptr = strtok(NULL, ",")) != NULL ){
              ++i;
              if(i == 1){
                input_var = strtoul(srchptr, &endptr, 10);
                if( errno == ERANGE ){
                  printf("NAK,RATE,OverflowErr: %s\n", srchptr);
                  i = ERROR;
                  break;
                  }
                else if( (input_var == 0) && (endptr == srchptr) ){
                  printf("NAK,RATE,ConvertErr: %s\n", srchptr);
                  i = ERROR;
                  break;
                  }
                else if( (input_var < 5) || (input_var > 45000) ){
                  printf("NAK,RATE,RangeErr [5,45000]: %s\n", srchptr);
                  i = ERROR;
                  break;
                  }
                else
                  ++gotVal;
                }
              }

            if( (gotVal == 1) && (i != ERROR) ){
              printf("ACK,RATE,%lu\n", input_var);

              SerInFlush();
              if( SerGetsTmout(abuf, sizeof(abuf), GET_ACK_TIMEOUT) > 0 ){
                if( MatchACK(abuf) == ACK ){               // if ACK update non-volatile RTC
                  isus_sleep = input_var;
                  WrDS1994(DS1994_ROM, ISUSSLP_PTR, sizeof(ulong), (ulong*)&isus_sleep);
                  SyncNextSample();
                  SerInFlush();
                  continue;
                  }
                }

              sprintf(ebuf, "RATE Command ACK Failure");
              LogErrorMsg(ebuf, (int)COMMAND_ACK_FAILURE, sys_message_enable);

              SerInFlush();
              continue;
              } // end gotVal1 if
            else{
              if(i != ERROR)
                printf("NAK,RATE,FormatErr\n");

              SerInFlush();
              continue;
              }

            } // end set ISUS RATE if


