Modbus communication error

More
6 years 9 months ago - 6 years 9 months ago #155171 by jsskangas
Hello

I am converting my Spindle to RS485 modbus to get one servo axis more.
My idea is to use HW COM port: ttyS0 and rs232 to 485 converter.

I have tested that RS485 converter works with VFD setup software.
Also I verified that baud rate is correct and it is in correct mode 19200, RTU and 8-N-1.





I Tested Linuxcnc with this USB to RS232 to verify that there is no HW problem.

ttyUSB0 is found:


Here is Config for modbus:




It was trying to send something (indicated by TX led in usb to rs232 conveter), but no modbus connection was made.
I was using same setup usb to rs232 + rs232 to rs485 converter to test connection with VFd softaware and it works.

Any Idea what i am missing?
Clearly something in Linux or linuxcnc..
Last edit: 6 years 9 months ago by jsskangas.

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago - 6 years 9 months ago #155233 by Mike_Eitel
Have you tried RTS on?
RS485 needs switching of direction
Last edit: 6 years 9 months ago by Mike_Eitel.

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago #155234 by cmorley
Replied by cmorley on topic Modbus communication error
It's been awhile since I did classicladder modbus but ...

run linuxcnc in a terminal and set classicladder's modbus debug setting high.
that should show the raw commands being sent and received on classicladders's side.

Sometime changing the element offset, timeouts etc. also if you can try at a slower baud rate first might be helpful.

Chris

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago - 6 years 9 months ago #155235 by jsskangas
OK

I am not expert in modbus so for me this does not tell much.

It outputs this:

Serial flush all!
INFO CLASSICLADDER- Modbus I/O module to send: Lgt=8 <- Slave address-1 Function code-4 Data-8 35 0 1 23 A4
INFO CLASSICLADDER- MODBUS Length we should receive=4 (+3)
Serial config...
Set RTS=1
Serial writing...
Writing done!
Set RTS=0
select() for serial reading...
Serial reading...
5 chars found
INFO CLASSICLADDER- Modbus I/O module received: Lgt=5 -> (Slave address-1 - Function code-84 ) 1 82 C0
ERROR CLASSICLADDER- MODBUS-EXCEPTION RECEIVED:84 (Excep=1)
ERROR CLASSICLADDER- MODBUS-INCORRECT RESPONSE RECEIVED FROM SLAVE!!!
Serial flush all!
INFO CLASSICLADDER- Modbus I/O module to send: Lgt=8 <- Slave address-1 Function code-4 Data-8 35 0 1 23 A4
INFO CLASSICLADDER- MODBUS Length we should receive=4 (+3)
Serial config...
Set RTS=1
Serial writing...
Writing done!
Set RTS=0
select() for serial reading...
Serial reading...
5 chars found
INFO CLASSICLADDER- Modbus I/O module received: Lgt=5 -> (Slave address-1 - Function code-84 ) 1 82 C0
ERROR CLASSICLADDER- MODBUS-EXCEPTION RECEIVED:84 (Excep=1)
ERROR CLASSICLADDER- MODBUS-INCORRECT RESPONSE RECEIVED FROM SLAVE!!!
Serial flush all!
Last edit: 6 years 9 months ago by jsskangas.

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago #155239 by cmorley
Replied by cmorley on topic Modbus communication error
Again been awhile but...

You are getting a response from the VDF.
I believe it's telling you the function (4 - read registers) is not available.
I don't see from to snippet if function 6/16 is working.
Do you have info on the modbus commands the VFD uses ?

Chris

Please Log in or Create an account to join the conversation.

More
6 years 9 months ago - 6 years 9 months ago #155240 by jsskangas
Hello

If you look at my first post, second picture.
There is there is two messages i tried trough ModBus.
First one is read register 2100, this went OK.
Then write register 2001, again ok.
and you can see answer from VFD to those requests.


I did look a manual and all requester and written register exists.
Last edit: 6 years 9 months ago by jsskangas.

Please Log in or Create an account to join the conversation.

Time to create page: 0.226 seconds
Powered by Kunena Forum