   switch(modbus_in[1]) {
     case FC_READ_COILS:
     case FC_READ_DISCRETE_INPUTS:
-      if (is_broadcast)
+      if (is_broadcast) {
+#ifdef HAS_DIAGS
+        modbus_message_no_response_count++;
+#endif
         goto done;
-        
+      }
       slave_read_multiple_coils();
       break;
     case FC_WRITE_SINGLE_COIL:
       slave_write_single_coil();
       break;
+#ifdef HAS_DIAGS
+    case FC_DIAGNOSTICS:
+      slave_diagnostics();
+      break;
+#endif
 #ifdef HAS_COUNTS
     case FC_GET_COMM_EVENT_COUNTER:
-      if (is_broadcast)
+      if (is_broadcast) {
+#ifdef HAS_DIAGS
+        modbus_message_no_response_count++;
+#endif
         goto done;
-        
+      }
       slave_get_comm_event_counter();
       break;
 #endif
 #ifdef HAS_LOG
     case FC_GET_COMM_EVENT_LOG:
-      if (is_broadcast)
+      if (is_broadcast) {
+#ifdef HAS_DIAGS
+        modbus_message_no_response_count++;
+#endif
         goto done;
-        
+      }
       slave_get_comm_event_log();
       break;
 #endif


  write_eeprom_short(address, value);
}
#endif

/*

#endif

#ifdef HAS_FILES

/*
 * RECORD_SIZE controls both the maximum number of registers in each record as well
 * as the number of records in the file.  The value should support the largest possible
 * record, and no more.
 */
#define  RECORD_SIZE  64
#define  FILE_BASE 128

