 #ifdef HAS_COUNTS
   event_count++;
 #endif
-  if (is_broadcast)
-    return;
+  if (is_broadcast) {
+#ifdef HAS_DIAGS
+    modbus_message_no_response_count++;
+#endif
+    return;
+  }
     
   modbus_out_cnt = 0;
   

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

}

void modbus_exception(unsigned char code) {
  char is_broadcast = modbus_in[0] == 0;
  /*
   * NEVER report an exception on a broadcast message.
   */
  if (is_broadcast) {
#ifdef HAS_DIAGS
    modbus_message_no_response_count++;
#endif
    return;
  }
    
  /*
   * Copy the command code from the input packet to the output packet,
