NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
Flapke
Posts: 8
0 Kudos

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? 

 

Cheers,

Arjen.

Active Participant
Hossein128
Posts: 341
0 Kudos

Re: Occasional nonresponsive Modbus slave.

Hello,

 

Thanks for your posting in this forum.

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

 

Thanks,

 

Hossein

Member
Flapke
Posts: 8

Re: Occasional nonresponsive Modbus slave.

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.

Active Participant
Hossein128
Posts: 341
0 Kudos

Re: Occasional nonresponsive Modbus slave.

Hi,

 

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,

Member
Corny
Posts: 101
0 Kudos

Re: Occasional nonresponsive Modbus slave.

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).

 

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page