armink / FreeModbus_Slave-Master-RTT-STM32

Add master mode to FreeModbus. | 在 FreeModbus 中添加主机模式
Other
1.57k stars 818 forks source link

Pin Connection #31

Open gourav1996 opened 5 years ago

gourav1996 commented 5 years ago

Where to connect DE and RE Pin of rs485 converter to stm32f4. And How to configure it?

Thank you.

armink commented 5 years ago

https://github.com/armink/FreeModbus_Slave-Master-RTT-STM32/blob/master/FreeModbus/port/rtt/portserial.c#L131

see MODBUS_SLAVE_RT_CONTROL_PIN_INDEX definition

gourav1996 commented 5 years ago

Thank you for your replay. Just few more things, I want to get data of a meter from holding register value 40002, it's slave id is 121, and it's baudrate is 9600. Could you please suggest me where to define these?

Thank you.

armink commented 5 years ago

baudrate can be changed by eMBMasterInit: https://github.com/armink/FreeModbus_Slave-Master-RTT-STM32/blob/master/APP/src/app_task.c#L94

the slave id and register value's change, please see eMBMasterReqReadHoldingRegister demo on app_task.c