RS485 RTU communication

Hi,

I must say i´m very new to the arduino. I intend to have an HMI console (slave) communicating data with an arduino mega (master). I´ve been reading that the modbus RTU communication protocol doesn´t let the slaves communicate with the master directly, but only trough a permission from the master. Since i want to have a login menu in the hmi, how do i get the hmi sending that data to the arduino. Also which concerns should i have with that protocol.

Thanks.

Every half second or so the master asks the slave if there is any data to send.

A Google search for "the disadvantages of modbus" returns lots of results.

As @mikb55 says the Master polls the Slave for data. In most situations the Master is collecting data from, and sending instructions to, lots of Slaves. If you only have two devices the HMI and the Arduino it really does not make much difference which is the Master so you could make it the HMI.

Modbus is a relatively simple, widely implemented protocol used to send numeric values (Registers) and binary signals (Coils).

To decide if it is a good protocol for your application you really need to define first what information needs to be exchanged between the devices.

You mention RS485 you will need a shield to connect RS485. Don't be tempted to try to connect RS232, RS422 or RS485 devices directly to the Arduino Rx & Tx pins the voltages are wrong and will damage them

ardly:
Modbus is a relatively simple, widely implemented protocol used to send numeric values (Registers) and binary signals (Coils).

Thanks for your responses, that means i cannot send to the arduino ASCII text for example?

Modbus is not geared towards text, though I suppose you could write values into registers and have the Arduino interpret them as text.

Often though you don't need to send text. The HMI may display several textual options to a user, the user picks one and the HMI just tells the Arduino that option 'x' was selected. Both systems 'know' what option number 'x' is, the text does not need to be passed.

Here is the manual;

I need to ask you another question first, can i create variables externally, like for example with a touch pannel to the arduino?

prokiller1800:
I need to ask you another question first, can i create variables externally, like for example with a touch pannel to the arduino?

I am not sure what you mean by external variables. You can connect a touch panel to an Arduino using a shield and then the Arduino can interact with it i.e. use it for input and output.
Here is a link to a page with information and a video about one product.
https://www.mouser.co.uk/new/newhavendisplay/newhaven-tft-arduino-shield/