Strange characters in Serial monitor with ModbusMaster library

I use the ModbusMaster library(with MAX485 IC) to make a modbus network, however it is not as easy as i thought. I want to figure out where it is going wrong, so I added a little debug line to the library.

for (i = 0; i < u8ModbusADUSize; i++)

So I can see if the data that is being send is correct.

The data that is supposed to be sent is : 0x 01 01 0020 0010 3C0C
What i get in my serial monitor is: 11 20010<3C C

I’m not sure if this is correct or not, can anybody help me?
Here is my arduino code:

#include <ModbusMaster.h>
#define MAX485_DE      3
#define MAX485_RE_NEG  2
#define SLAVE_ID       1
uint16_t Adres, Aantal;
// instantiate ModbusMaster object
ModbusMaster node;
void preTransmission()
  digitalWrite(MAX485_RE_NEG, 1);
  digitalWrite(MAX485_DE, 1);
void postTransmission()
  digitalWrite(MAX485_RE_NEG, 0);
  digitalWrite(MAX485_DE, 0);
void p(char X) {

   if (X < 0x10) {Serial.print("0");}

   Serial.print(X, HEX);

void setup()
  pinMode(MAX485_RE_NEG, OUTPUT);
  pinMode(MAX485_DE, OUTPUT);
  // Init in receive mode
  digitalWrite(MAX485_RE_NEG, 0);
  digitalWrite(MAX485_DE, 0);
  // Modbus communication runs at 115200 baud
  // Modbus slave ID 1
  node.begin(1, Serial);
  // Callbacks allow us to configure the RS485 transceiver correctly

void loop()

  uint8_t result, i;
  uint16_t data[6];

  // Read 16 coils from address 33 tot 48
  result = node.readCoils(Adres, Aantal);
  if (result == node.ku8MBSuccess)
    Serial.println("Modbus successvol");
    for (i=0;i<6;i++){
  else {
    Serial.print("Modbus onsuccesvol, Error: ");


max485 pins+arduino.png

read about the difference between Serial.print and Serial.write