ArduinoModbus Works for UNO but not MKR

Hi, I have been using the below code from the ArduinoModbus repository. It works perfectly with an Arduino Uno however if I use an MKR WiFi 1010 board the master gets a timeout error and shows nothing. The master I'm using is called ModScan. The Uno connects to my laptop via USB-B and the MKR by USB-mimi. What could cause one baord to work fine but the other to not?

/*
  Modbus RTU Server Kitchen Sink
  This sketch creates a Modbus RTU Server and demonstrates
  how to use various Modbus Server APIs.
  Circuit:
   - MKR board
   - MKR 485 shield
     - ISO GND connected to GND of the Modbus RTU server
     - Y connected to A/Y of the Modbus RTU client
     - Z connected to B/Z of the Modbus RTU client
     - Jumper positions
       - FULL set to OFF
       - Z \/\/ Y set to OFF
  created 18 July 2018
  by Sandeep Mistry
*/

#include <ArduinoRS485.h> // ArduinoModbus depends on the ArduinoRS485 library
#include <ArduinoModbus.h>


const int numHoldingRegisters = 10;


void setup() {


  Serial.println("Modbus RTU Server Kitchen Sink");

  // start the Modbus RTU server, with (slave) id 42
  if (!ModbusRTUServer.begin(1, 9600)) {
    Serial.println("Failed to start Modbus RTU Server!");
    while (1);
  }

 
  // configure holding registers at address 0x00
  ModbusRTUServer.configureHoldingRegisters(0x00, numHoldingRegisters);

}

void loop() {
  // poll for Modbus RTU requests
  ModbusRTUServer.poll();
  
    ModbusRTUServer.holdingRegisterWrite(1, 70);

}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.