How to Communicate Arduino Mega to PLC Via Modebus Rs485

I am using Arduino Mega as a slave to communicate via Modbus Rs485 to Master PLC (Brand Name:FATEK).
I am sharing picture of PLC Modbus Table for understanding.
PLC MODBUS table Values.png
My PLC Does not accept address less than Six Digits.
I have read the datasheet of ATmega and used UCSR and build a program (with 8 bit data, None Parity bit and one stop bit.)
I am using TTL to Rs485 Module. and after that i used RS485 to USB adopter to communication with PC on Tera Term software.

// 8 bit data, None Parity bit and one stop bit BAUD rate 9600 output at UDR0 register.
#include <avr/io.h>
#define Freq 16000000 //My Arduino has 16MHZ frequency
#define BAUD 9600
#define BRC ((Freq/16/BAUD)-1)
void setup()
{
 pinMode(2, OUTPUT); // TTL to Rs485   DE and RE pin to transmit data
 UBRR0H=(BRC>>8);
 UBRR0L=BRC;
 UCSR0B=(1<<TXEN0);
 UCSR0C=(1<<UCSZ01)|(1<<UCSZ00);
}
 void loop ()
 {
   digitalWrite(2, HIGH);  // TTL to Rs485   DE and RE pin to transmit data
   UDR0='1';  // UDR0 register, it output '1' on screen after 2 seconds with hardware connection 
              // (Via TTL to RS485 and Rs485 to USB converter.)
   delay(2000);
 }

This Program Worked fine with PC and it give value of UDR0 register on software tera team.
But to work with PLC which only accept six digit address, i dont know how to give station number and UDR register an address of six digits to be accessed by PLC.
i can not use library they allow only 5 digit address of Register bank.
Please Help me i am new to programming.

PLC MODBUS table Values.png

There is more to modbus than just writing a value to your serial port tx register. Have a look here.

markd833:
There is more to modbus than just writing a value to your serial port tx register. Have a look here.

Yes it does thanks. I already have TTL_to_RS485 converter and its working fine. But my question is about programming. How to give register an address number to be accessed by other Master devices via Rs485.

Have a look at the Arduino modbus library. The source code is freely available so you can see how it works.