开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Re: ModIO with libmodbus and Reset


 

Hi Kirk,

I'm struggling to understand what you are saying. :)

Are you saying that you are making changes to the configuration in the ModIO? If so, yes you need to reset the ModIO for the configuration to take effect.

When you say that "a reset in my program returns a send error", are you saying that your programs sends a modbus request to the ModIO and your program does not receive a modbus reply from the ModIO? If this is the case, then you will need to program an exception into your software as resetting the ModIO is like cycling the power on it. You will never get a response.

Your program needs to send the request to reset, then when the modbus lib times out, ditch the error and move on.

The only way the ModIO errors is if it gets an incomplete modbus request. The ModIO probably comes out of reset, and receives an incomplete modbus request that was in the middle of being sent, so the ModIO detects the error.

That said, the ModIO just ignores the request and should pick it up on the next request.

The way to handle resetting the ModIO, is to send the request to the ModIO, wait for the modbus timeout, then pause for a second or two before restarting communications with the ModIO.

Cheers,

Peter.

On 11/02/2012 10:11 AM, Kirk Wallace wrote:
I've been playing with libmodbus 3 on a Ubuntu PC and a ModIO. It works
fine, but if I make a configuration change, I need to reset the ModIO in
order for the change to take effect. The problem is that a reset in my
program returns a send error. My guess is that the reset starts before
the reply packet gets sent. Also, even after settling for a bit the next
packet sent to the ModIO errors too. Is there a recommended procedure
for doing a reset within a program? A reset seems to work okay in my
LinuxCNC application, but that runs in a loop which maybe flushes the
problem out.
--
-----------------------------------------------------------------------------
eStore:
Web : ModIO - Modbus Interface Unit
email : peter@... DigiSpeed - Isolated 10Vdc I/F
Phone : +61 421 601 665 TurboTaig - Taig Mill Upgrade board

Join [email protected] to automatically receive all group messages.