     DEBUG_PRINT("Receiving data: ");
     boolean sendResponse = false;
     while (client.available() > 0) {
+      DEBUG_PRINT("_");
       char c = client.read();
       DEBUG_PRINTHEX(c);
-      DEBUG_PRINT(" ");
   
       if (c == 0x0A) {
         sendResponse = true;
+        commTime = millis();  
         client.flush(); // clear input buffer
         break;
       }
     }
-    Serial.println();
+    DEBUG_PRINTLN();
   
     // send response
     if (sendResponse) {

  }

  if (!clientConnected) {
    // connection is considered to be established only when data are received
    client = server.available();
    if (client) {

#define TCP_PORT        502    // Modbus TCP default port
#define EMPTY_VAL       -100.0 // empty float value of measurement
#define MODBUS_HDR_LEN  9      // length of Modbus TCP header
#define DISCONN_TIME    10000  // inactive time before client disconnect, ms
#define REINIT_TIME     20000  // inactive time before reinit Ethernet, ms

#define DEBUG

#ifdef DEBUG
 #define DEBUG_PRINT(val)       Serial.print(val)
