Hi everybody,
i am working on a MODBUS RTU over rs485 line system; the master device is my Raspberry PI, and the slave is an Arduino UNO with the simple-modbus-slave firmware.
I am going crazy trying to get this to work, i have tried everything: the MODBUS slave device on codesys shows the "Not running" error, while the arduino "rx" and "tx" pins are enabled and blinking, showing the master's request, followed by the slave's response.
Any ideas?
Thanks in advance.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
you mean you have configured / mapped your serial port in that way that codesys could use it?
The only point seems that the master does not recognize the slave reposonse in the watch window (see my screenshot)?
BR
Edwin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
adc1994 hat geschrieben:
Everything works like a charm now.
I set parity to data bits, , stop bit.
It works both on a prolific usb-ttl + max485 converter/transceiver, and on the raspicomm board.
I am polling data @20ms interval.
Thanks for your help.
Hi, I have a similar problem
What arduino did you use? I use Nano
Could you post your code for arduino please?
Big thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi everybody,
i am working on a MODBUS RTU over rs485 line system; the master device is my Raspberry PI, and the slave is an Arduino UNO with the simple-modbus-slave firmware.
I am going crazy trying to get this to work, i have tried everything: the MODBUS slave device on codesys shows the "Not running" error, while the arduino "rx" and "tx" pins are enabled and blinking, showing the master's request, followed by the slave's response.
Any ideas?
Thanks in advance.
Hi,
you mean you have configured / mapped your serial port in that way that codesys could use it?
The only point seems that the master does not recognize the slave reposonse in the watch window (see my screenshot)?
BR
Edwin
These are my screens.
Thanks in advance
type:
Modbus_Slave_COM_Port
to the watch window...
BR
Edwin
Done.
It seems like a wrong response comes from the slave...
Hi,
look like CODESYS get data from the wrong slave (at lease think it gets the wrong data)
does your address fit to your slave?
BR
Edwin
Yes. The Arduino's slave id is 2 , and the slave id set in codesys is 2.
And the rx and tx leds on the slave flash correctly.
Hi,
is it possible to trace somehow the serial traffic?
BR
Edwin
Everything works like a charm now.
I set parity to 8 data bits, EVEN, 1 stop bit.
It works both on a prolific usb-ttl + max485 converter/transceiver, and on the raspicomm board.
I am polling data @20ms interval.
Thanks for your help.
Hi, I have a similar problem
What arduino did you use? I use Nano
Could you post your code for arduino please?
Big thanks