Showing results for 
Search instead for 
Did you mean: 

Occasional nonresponsive Modbus slave.

Hello everybody,


I am making a measurement program for a system and a part of this system is a weather station that is read out using a Campbell CR1000. I already found somewhere else on this board how to communicate with this device using modbus. This is working fine most of the time, but occasionally (after 3-12 hours, measuring every minute) there is no more response, even after retrying a couple of times (see the attached VI). If I restart the program, it works fine again.

Is there a better way to retry a modbus command than just sending it again? Should I do something else first? Is there a way to improve responsiveness at all? 




0 Kudos
Message 1 of 5



Thanks for your posting in this forum.

To open your vi I need the subvi "MB Serial Master" . Could you send it to me to?





0 Kudos
Message 2 of 5

Thanks for the reply, the subvi's that you need are in this library.


In the meantime I found a work-around for the non-responsiveness. In the case where there is no reply I wait 10 seconds and then try again, this seems to work but is not ideal.

Message 3 of 5



Thanks for your feedback. I think that it could be the traffic in your communication line for VISA. Sometimes you will have a not enough time for read/write VISA and timeout will happened.

With that delay you will give enough time to your communication data nevertheless in high traffic situation.


I will close this forum and if you have any other request, it will be great to hear it from you.


Best regards,

0 Kudos
Message 4 of 5

I havent looked at you code, but I have never had any issues with the modbus library, and any loss of response is often instrument related from my experience atleast.


Some instruments are slow, perhaps giving them time to complete their action solves some stability? Some weird bad instruments actually internally (like when writing a holding register) do a lot of heavy stuff after updating that holding register) that affects the resources the instrument has. Perhaps polling with a bit longer dT often solves it? An easy bench mark test of the equipment is writing a lot to the device, with no delay, and measure/log the delay between you send and the instrument answers, log this over a day or something. It should give out a good profile how stable the instrument is over time when putting constant communication pressure on it using maximum speed. Some instruments get horrible unstable after a couple of hours or more, others are just perfecttly stable even at maximum speed and are just unbreakable. Perhaps at one point it has a dataloss or something and is unable to parse the modbus command you send correctly (all depends on how "bad" the instrument is, and how it handles this).


0 Kudos
Message 5 of 5