• Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Modbus: Reset value at Communication Error

    Scheduled Pinned Locked Moved Mervis
    3 Posts 2 Posters 1.6k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      DickesC
      last edited by

      Hi

      I am reading some values from a modbus power meter (e.g. active power in watts)

      Everything fine so far.

      But i have a little problem:

      If the power of the power meter fails, mervis gets a communication error.
      The PLC value stays at the last value read from the power meter.

      How can i "reset" this value to "0" if there is a communication error?

      Thanks

      Martin KudláčekM 1 Reply Last reply
      Reply Quote 0
      • Martin KudláčekM
        Martin Kudláček @DickesC
        last edited by

        Hi @dickesc,
        simply - you cannot. But I think you are trying to somehow get the information about the failed communication, is that correct?

        If so, each Modbus group of elements has so called "attributes", which are special variables, which for example tell you when the last communication occured, and what is the last state of the communication exchange:

        0_1563460736405_6a8e4e53-2944-49f0-9c3e-545fe6350972-image.png

        What you are probably looking for is the _commerror variable. When true, the current value in all the elements is not correct, since the communication is broken. If false, the values are correct.

        Include this _commerror variables into your program to detect and work around the communication errors.

        Best regards,
        Martin

        1 Reply Last reply
        Reply Quote 0
        • D
          DickesC
          last edited by

          Hi

          Thanks, works perfectly!

          1 Reply Last reply
          Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post