Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. ModbusTCP support

ModbusTCP support

Scheduled Pinned Locked Moved Support
5 Posts 4 Posters 29.5k Views
  • 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.
  • M
    M
    mmarin11
    wrote on last edited by
    #1

    Dear community. We are trying to monitor power generators which use ModbusTCP protocol

    Is there ModbusTCP support in NetXMS 3.8?

    Is someone using NetXMS to monitor power generator using Modbus protocol?

    Thank you

    1 Reply Last reply
    0
    • V
      V
      Victor Kirhenshtein
      wrote on last edited by
      #2

      Hi,

      currently MODBUS/TCP is not supported, although we plan to add it.

      Best regards,
      Victor

      1 Reply Last reply
      0
      • D
        D
        Dawid Kellerman
        wrote on last edited by
        #3

        What you could do is use node-red with modbus and mqtt

        Write some code on nodered, poll the modbus and forward the answer to a particular topic mqtt on netxms is listening to.
         I do something similar on a click plc (modbus) but can unfortunately not share my code but it is easy to do from the tutorials.

        Hope it helps

        1 Reply Last reply
        0
        • A
          A
          alex_rhys-hurn
          wrote on last edited by
          #4

          Hi,

          What we do is as follows:

          1. Deploy an Ubuntu Virtual Machine in the same VLAN as the Monitoring network
          2. Install MBPoll (https://github.com/epsilonrt/mbpoll)
          3. Install NetXMS Agent
          4. Write a script that uses mbpoll to poll your modbus devices and return data.
          5. Call the script from within netxms agent as ExternalParameter
          6. NetXMS Agent will send the data back to NetXMS Server (over encrypted link)
          7. Create your nodes for the data you want.

          Here is an example, this is a Moxa Gateway that is polling Comap Genset controls (but this can be modified to poll any Modbus device as long as you know the IP, Slave Address and Register you want to poll):

          The "G2Mode=" part of the statement in below command is the name of the Node that will be passed to NetXMS
          The "-r 168" part of the statement in below command is the Modbus Register that you want to read
                    echo -n G2Mode= & mbpoll -a $MBADDR $IPADDR -c 1 -t 4 -r 168 -1 | awk 'NR==14' | awk '{$1=""; print $0}' | awk '{$1=$1}1'

          Output of the above command looks like (This case a text string is returned to show what mode the Genset is in, could be OFF,MAN,ON,AUTO):
                    G2Mode=AUTO
          So NetXMS would see the Object and DCI as G2Mode, and the data as AUTO

          Script to poll generators

          #!/bin/sh
          # Created: 30-Mar-2020
          # This is a single script used by ExternalParametersProvider in NetXMS to collect multiple values on an interval:
          # Doc: https://www.netxms.org/documentation/adminguide/agent-management.html#externalparametersprovider
          # Topic: Collect various parameters from Gensets
          
          #Define IP Address of Moxa Mgate in Generator
          IPADDR=a.b.c.d
          #Define Modbus Slave Address of Comap in Generator
          MBADDR=6
          #Define the Parameters to use in DCI and then poll via Modbus, and output everything on 1 line with no spaces
          #The modbus register to poll is defined by -r
          
          echo -n G2Mode= &  mbpoll -a $MBADDR $IPADDR -c 1 -t 4 -r 168 -1 | awk 'NR==14' | awk '{$1=""; print $0}' | awk '{$1=$1}1'
          echo -n G2EngineState= &  mbpoll -a $MBADDR $IPADDR -c 1 -t 4 -r 163 -1 | awk 'NR==14' | awk '{$1=""; print $0}' | awk '{$1=$1}1'
          echo -n G2ActivePower= &  mbpoll -a $MBADDR $IPADDR -c 1 -t 4 -r 264 -1 | awk 'NR==14' | awk '{$1=""; print $0}' | awk '{$1=$1}1'
          echo -n G2ApparentPower= &  mbpoll -a $MBADDR $IPADDR -c 1 -t 4 -r 274 -1 | awk 'NR==14' | awk '{$1=""; print $0}' | awk '{$1=$1}1'
          echo -n G2PowerFactor= &  mbpoll -a $MBADDR $IPADDR -c 1 -t 4 -r 261 -1 | awk 'NR==14' | awk '{$1=""; print $0}' | awk '{$1=$1}1'
          echo -n G2TempCoolant= &  mbpoll -a $MBADDR $IPADDR -c 1 -t 4 -r 17 -1 | awk 'NR==14' | awk '{$1=""; print $0}' | awk '{$1=$1}1'
          echo -n G2TempRoom= &  mbpoll -a $MBADDR $IPADDR -c 1 -t 4 -r 35 -1 | awk 'NR==14' | awk '{$1=""; print $0}' | awk '{$1=$1}1'
          echo -n G2PressLubeOil= &  mbpoll -a $MBADDR $IPADDR -c 1 -t 4 -r 16 -1 | awk 'NR==14' | awk '{$1=""; print $0}' | awk '{$1=$1}1'
          echo -n G2-V-L1-N= &  mbpoll -a $MBADDR $IPADDR -c 1 -t 4 -r 249 -1 | awk 'NR==14' | awk '{$1=""; print $0}' | awk '{$1=$1}1'
          echo -n G2-V-L2-N= &  mbpoll -a $MBADDR $IPADDR -c 1 -t 4 -r 250 -1 | awk 'NR==14' | awk '{$1=""; print $0}' | awk '{$1=$1}1'
          echo -n G2-V-L3-N= &  mbpoll -a $MBADDR $IPADDR -c 1 -t 4 -r 251 -1 | awk 'NR==14' | awk '{$1=""; print $0}' | awk '{$1=$1}1'
          echo -n G2-V-L1-L2= &  mbpoll -a $MBADDR $IPADDR -c 1 -t 4 -r 253 -1 | awk 'NR==14' | awk '{$1=""; print $0}' | awk '{$1=$1}1'
          echo -n G2-V-L2-L3= &  mbpoll -a $MBADDR $IPADDR -c 1 -t 4 -r 254 -1 | awk 'NR==14' | awk '{$1=""; print $0}' | awk '{$1=$1}1'
          echo -n G2-V-L3-L1= &  mbpoll -a $MBADDR $IPADDR -c 1 -t 4 -r 255 -1 | awk 'NR==14' | awk '{$1=""; print $0}' | awk '{$1=$1}1'
          echo -n G2Frequency= &  mbpoll -a $MBADDR $IPADDR -c 1 -t 4 -r 256 -1 | awk 'NR==14' | awk '{$1=""; print $0}' | awk '{$1=$1}1'
          echo -n G2CurrentL1= &  mbpoll -a $MBADDR $IPADDR -c 1 -t 4 -r 258 -1 | awk 'NR==14' | awk '{$1=""; print $0}' | awk '{$1=$1}1'
          echo -n G2CurrentL2= &  mbpoll -a $MBADDR $IPADDR -c 1 -t 4 -r 259 -1 | awk 'NR==14' | awk '{$1=""; print $0}' | awk '{$1=$1}1'
          echo -n G2CurrentL3= &  mbpoll -a $MBADDR $IPADDR -c 1 -t 4 -r 260 -1 | awk 'NR==14' | awk '{$1=""; print $0}' | awk '{$1=$1}1'
          echo -n G2BatteryV= &  mbpoll -a $MBADDR $IPADDR -c 1 -t 4 -r 13 -1 | awk 'NR==14' | awk '{$1=""; print $0}' | awk '{$1=$1}1'
          echo -n G2RunHours= &  mbpoll -a $MBADDR $IPADDR -c 1 -t 4:int -r 3587 -B -1 | awk 'NR==14' | awk '{$1=""; print $0}' | awk '{$1=$1}1'
          echo -n G2NumStarts= &  mbpoll -a $MBADDR $IPADDR -c 1 -t 4 -r 3589 -1 | awk 'NR==14' | awk '{$1=""; print $0}' | awk '{$1=$1}1'
          echo -n G2NumUnscStarts= &  mbpoll -a $MBADDR $IPADDR -c 1 -t 4 -r 3590 -1 | awk 'NR==14' | awk '{$1=""; print $0}' | awk '{$1=$1}1'
          echo -n G2kWhours= &  mbpoll -a $MBADDR $IPADDR -c 1 -t 4:int -r 3595 -B -1 | awk 'NR==14' | awk '{$1=""; print $0}' | awk '{$1=$1}1'
          

          NetXMS agent config file /etc/nxagentd.conf:

          #GCP1, poll every 10 sec
          ExternalParametersProvider = /home/admin/gensets/gcp1.sh:10
          

          People with more skills in scripting both bash and nxsl can probably massivley improve this, but so far its working.

          Enjoy.

          1 Reply Last reply
          0
          • D
            D
            Dawid Kellerman
            wrote on last edited by
            #5

            Hi alex_rhys-hurn
            Really elegant solution certainly easier to implement than mine.
            From the little that I know seems like this might even give the developers a simple working opensource solution to ship with..

            Thank you for sharing!

            1 Reply Last reply
            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
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            Powered by NodeBB Contributors
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups