Modbus Rtu reading value from HMI (master device)

Hi. As you know in modbus protocol there is a master and slave devices. master request data from slaves and slaves answers.

In my example I am using pc as my hmi (siemens tia portal). so pc is like my master device. arduino is my slave device and communication protocol is modbusRtu. I am using ModbusRtu library in my arduino.

I can read all kinds of data created on arduino via pc hmi (master). But I need to read any hmi input data with my slave device (arduino). because in some examples users enter data to hmi panel and devices run according to this input data. as an example this input data (which will user enter to hmi) can be run time of a device, or it can be total number of products that will pass through the conveyor.

in tia portal hmi applications, you can write this input data to plc's %M0.0 ( plc'sinternal memory bits).

I know that in modbus protocol slave's can not read data from master. But i wanted to consult you in case you maybe suggest me any way to solve this problem. thanks.

No idea about HMI, TIA or modbusRtu. Is there anything usable in siemens tia hmi send data over modbus to arduino - Google Search

dear, you can send only bit data to slave, as an example code

"bitRead( au16data[1], 0 ); //Read bit 0 of the au16data[1] variable and put it on pin 6 of the Arduino" with this code you can control an output of the slave device with master (pc hmi). But as I mentioned I need to write slave device's registers with master, and then I will read them in slave device. I asked to the person who wrote the ModbusRtu library and he told me "The only way to solve this is to make the master write these registers to the slave. "... he emailed me but did not send how to do this :slight_smile:

thanks for your help.