Modbus RTU Error

Hi, All. I’m running a PAC project in an Epic that involves moving a head back and forth using a Parker motor drive. The Epic communicates with the drive via RS485 Modbus RTU so I’ve imported the Modbus library into my project. The program continually reads and writes coils to the drive but when it needs to make a move it also writes holding registers (function 16, O22Modbus16PresetMultipleRegistersWithInt) that contain the parameters of the move (position, speed, etc.). If the write is successful, via the status parameter in the library, the program activates the move by turning on the appropriate coil. It then waits for the move to complete before loading the next move.

However, more often than not the status parameter is not ok. It’s a 4 which is described as “Slave Device Failure” in the library. Since it’s not ok, the program doesn’t activate the move. It does keep trying though and eventually the write does succeed and the move happens. The effect of this is that the head does move back and forth but sometimes there are pauses between moves anywhere from less than a second to 2 or 3 seconds.

Does anybody know what this error code refers to specifically? Is it an error in the protocol (bad checksum or some such) or is it specifically returned by the drive to say that the write failed for some reason?

Any help is appreciated. Thanks.

Error code 4 is “An unrecoverable error occurred while the server was attempting to perform the requested action.” from the Modbus Application Protocol manual.

This comes from the slave device - so it is responding with this error code. So the Parker doesn’t like something about what you are sending it at that time. Maybe it is getting too many requests too quickly, or there is some value you are sending that it does not like. You may need to check with Parker on this one.

Have you tried slowing down your writes? I don’t necessarily mean the baud rate, but instead mean time delays between serial port commands. I had an issue with this on S2 controllers years ago that actually led to a hardware revision in the serial ports of S2’s. If the turnaround times were too fast it would fail.

These writes only happen when a move is started so there’s a few seconds between writes. I do hammer at it though if it fails. I’m just not sure. The nature of the project has changed in the last day, though. Instead of continually moving back and forth, it’s just going to move once then park for a little while. I don’t know. I’d like to solve this for future projects and for my own peace of mind. Hopefully Parker will have some answers. Thanks for your replies.