read DHT11 (temp sensor) from modbus master

hi everybody!
I want to read temperature sensor DHT11, from “Modbus poll” software that acts as master simulator. I used Arduino UNO, MAX 485, RS485 to USB converter and modbus_rtu_slave sketch (see attachment. downloaded from http://sites.google.com/site/jpmzometa/ ).

I don’t know how dht11 sketch (see another attachment) must be into modbus_rtu_slave sketch ?

modbus_rtu_slave.txt (21.4 KB)

dht11.txt (1.21 KB)

Check this link - http://forum.arduino.cc/index.php?topic=223286.0 -

robtillaart:
Check this link - http://forum.arduino.cc/index.php?topic=223286.0 -

I used arduino as a slave and laptop as a master. how do i can modify modbus_rtu_slave sketch to read temperature sensor from laptop?

The link shows how - to some extend - can combine multiple tasks. That should help you forward.

I have another question. in the modbus_rtu_slave sketch there is a code that i could not understand:

/* slave registers example /
enum {
MB_REG0,
MB_REG1,
MB_REGS /
total number of registers on slave */
};

I should assign my temperature sensor data to these registers?

there is not answer?

there is described how to do it...but apparently nobody does it for you