modbus rtu + industrial motor frequency inverter

Hello everyone,

I am trying to control a three phase motor frequency inverter through Modbus RTU protocol.
Frequency inverter is Teco 7200MA. Its modbus protocol manual is here

I am using arduino Uno and Max485, connected to the uno rx/tx pins 0/1

the wiring I am using is:

I am using 150 ohms resistor at both ends of A and B lines.

I wonder if I need to connect the arduino ground with inverters ground as well? I don't want to experiment and fry something.

Also I do not understand ModbusMaster library.
I need to write data to Holding register though Modbus 0x10 function code, which is supported, but I can not understand how to do that?

my very simple setup of arduino is as follows

//include software serial library
#include <SoftwareSerial.h>
//include modbus library
#include <ModbusMaster.h>

// instantiate ModbusMaster object, serial port 0, Modbus slave ID 5
ModbusMaster teco(0, 5);

#define d3 4 //d3 line

void setup(){

  //set data rate for serial

  // initialize Modbus communication baud rate

  pinMode(5, INPUT);
  pinMode(6, OUTPUT);
  pinMode(4, OUTPUT);
  digitalWrite(4, HIGH);

void loop(){

  static uint32_t i;
  uint8_t j, result;
  uint16_t data[6];


  //Data value1 of address 0x0000 = 0x0001, run teco forward
  teco.writeMultipleRegisters(0x0000, 1);
  teco.writeMultipleRegisters(0x0001, 1);

  //Data value2 of address 0x0001 = 0x7530 (run at maximum speed)
  teco.writeMultipleRegisters(0x0001, 1);
  teco.writeMultipleRegisters(0x7530, 1);


this command sequence should start the motor, as per TECO manual p26. The inverter shows, that it is receiving the message, but does not do anything. Everything is setup as shown in the manual, slave addresses maches - number 5, baud rate maches; other required functions are set in the inverter to acceppt commands from RS458 line.
i am keeping the chip select constatntly high, because i am trying only to send data to the inverter.

Could anyone please explain, how to send the commands using the ModbusMaster library?
I even tried writing the whole command sequence in bits with requird start and stop bits and send them through serial write, which did not help either.