npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

node-red-contrib-modbus-tcp-full-avd

v1.0.0

Published

Volledige MODBUS TCP node voor Node-RED met ondersteuning voor alle functies en adresbereik

Readme

node-red-contrib-modbus-tcp-full-avd

Volledige MODBUS TCP node voor Node-RED met ondersteuning voor alle MODBUS functies en het volledige adresbereik (0-65535).

Features

  • TCP Client en Server modes - Verbind als client of luister als server
  • MODBUS Client en Server modes - Verzend requests of reageer op requests
  • Alle MODBUS functies - Ondersteuning voor functie codes 01-24
  • Volledige adresbereik - 0-65535 voor alle data types
  • Automatische reconnect - Herverbind automatisch bij verbindingsverlies
  • Retry mechanisme - Configureerbare retries bij fouten
  • Exception handling - Volledige ondersteuning voor MODBUS exception codes

Installatie

Via Node-RED Palette Manager

  1. Open Node-RED
  2. Ga naar Menu → Manage palette
  3. Klik op "Install" tab
  4. Zoek naar "node-red-contrib-modbus-tcp-full-avd"
  5. Klik op "Install"

Via NPM

npm install node-red-contrib-modbus-tcp-full-avd

Handmatige Installatie

  1. Download of clone deze repository
  2. Navigeer naar de Node-RED user directory (meestal ~/.node-red)
  3. Kopieer de bestanden naar ~/.node-red/node_modules/node-red-contrib-modbus-tcp-full-avd
  4. Herstart Node-RED

Gebruik

TCP Client + MODBUS Client (Meest Voorkomend)

Deze combinatie wordt gebruikt om data te lezen/schrijven van een MODBUS TCP server.

Configuratie

  • TCP Mode: Client
  • Host: IP-adres van de MODBUS server
  • Port: Poort van de MODBUS server (standaard 502)
  • MODBUS Mode: Client
  • Unit ID: MODBUS Unit ID (standaard 1)

Voorbeeld: Read Holding Registers

msg = {
    function: 3,
    address: 0,
    quantity: 10
}

Voorbeeld: Write Single Register

msg = {
    function: 6,
    address: 0,
    value: 1234
}

Voorbeeld: Write Multiple Coils

msg = {
    function: 15,
    address: 0,
    values: [true, false, true, false]
}

TCP Server + MODBUS Server

Deze combinatie wordt gebruikt om MODBUS data aan te bieden aan clients.

Configuratie

  • TCP Mode: Server
  • Port: Poort om op te luisteren (standaard 502)
  • MODBUS Mode: Server
  • Unit ID: MODBUS Unit ID (standaard 1)
  • Max Connections: Maximum aantal gelijktijdige verbindingen

Data Update

msg = {
    type: "holdingRegisters",  // coils, discreteInputs, holdingRegisters, inputRegisters
    address: 0,
    value: 1234                 // Single value
}

Of voor meerdere waarden:

msg = {
    type: "holdingRegisters",
    address: 0,
    values: [1, 2, 3, 4, 5]    // Array van waarden
}

Ondersteunde MODBUS Functies

| Functie | Code | Beschrijving | Status | |---------|------|--------------|--------| | Read Coils | 01 | Leest discrete outputs | ✅ | | Read Discrete Inputs | 02 | Leest discrete inputs | ✅ | | Read Holding Registers | 03 | Leest holding registers | ✅ | | Read Input Registers | 04 | Leest input registers | ✅ | | Write Single Coil | 05 | Schrijft één coil | ✅ | | Write Single Register | 06 | Schrijft één register | ✅ | | Write Multiple Coils | 15 | Schrijft meerdere coils | ✅ | | Write Multiple Registers | 16 | Schrijft meerdere registers | ✅ |

Configuratie Opties

TCP Instellingen

  • TCP Mode: Client of Server
  • Host: IP-adres (alleen Client mode)
  • Port: TCP poort (standaard 502)
  • Reconnect Interval: Interval voor reconnect bij verbindingsverlies (ms)
  • Connection Timeout: Timeout voor verbinding (ms)
  • Max Connections: Maximum aantal verbindingen (alleen Server mode)

MODBUS Instellingen

  • MODBUS Mode: Client of Server
  • Unit ID: MODBUS Unit ID (0-255)
  • Byte Order: Big Endian of Little Endian
  • Address Offset: 0 (0-based) of 1 (1-based addressing)

Client Instellingen

  • Request Timeout: Timeout voor requests (ms)
  • Retry Count: Aantal retries bij fouten
  • Retry Interval: Interval tussen retries (ms)

Input/Output Format

Input (Client Mode)

{
    function: 1-24,              // MODBUS functie code
    address: 0,                  // Start adres
    quantity: 10,                // Aantal registers/coils (voor read)
    value: 123,                  // Single value (voor write)
    values: [1, 2, 3],           // Multiple values (voor write)
    unitId: 1,                   // Optioneel: Unit ID override
    timeout: 5000                // Optioneel: Timeout override
}

Output (Client Mode)

{
    function: 3,                 // MODBUS functie code
    address: 0,                  // Start adres
    quantity: 10,                // Aantal gelezen items
    data: [1, 2, 3, ...],       // Gelezen data array
    timestamp: Date,             // Response timestamp
    responseTime: 45             // Response tijd in ms
}

Error Output

{
    error: {
        code: 2,                 // Exception code
        message: "Illegal Data Address",
        function: 3,             // Requested functie
        address: 0               // Requested adres
    }
}

Adresbereik

  • Coils: 0 - 65535
  • Discrete Inputs: 0 - 65535
  • Holding Registers: 0 - 65535
  • Input Registers: 0 - 65535

Troubleshooting

Verbindingsproblemen

  • Controleer of de host en poort correct zijn geconfigureerd
  • Controleer firewall instellingen
  • Controleer of de MODBUS server actief is

Timeout Errors

  • Verhoog de request timeout waarde
  • Controleer netwerk latency
  • Controleer of de MODBUS server reageert

Exception Codes

  • 01: Illegal Function - Functie code niet ondersteund
  • 02: Illegal Data Address - Adres buiten bereik
  • 03: Illegal Data Value - Ongeldige waarde
  • 04: Server Device Failure - Server fout

Licentie

MIT

Auteur

ModBUSTester Project

Versie

1.0.0