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

crewso_plc_new

v0.0.1

Published

A Node-RED node to interact with Siemens S7 PLCs

Readme

Modifications NodeS7 - Support LINT/ULINT

Résumé des modifications

Ce projet ajoute le support complet des types de données 64 bits (LINT, ULINT, RLINT, RULINT) pour les automates Siemens S7-1500.

Types de données supportés

Types 64 bits ajoutés en écriture :

  • LINT : Long Integer (entier signé 64 bits, big-endian)
  • ULINT : Unsigned Long Integer (entier non signé 64 bits, big-endian)
  • RLINT : Reversed Long Integer (entier signé 64 bits, little-endian)
  • RULINT : Reversed Unsigned Long Integer (entier non signé 64 bits, little-endian)

Plages de valeurs :

  • LINT : -9,223,372,036,854,775,808 à 9,223,372,036,854,775,807
  • ULINT : 0 à 18,446,744,073,709,551,615
  • RLINT : -9,223,372,036,854,775,808 à 9,223,372,036,854,775,807
  • RULINT : 0 à 18,446,744,073,709,551,615

Fichiers modifiés

1. s7item.js

  • Ajout : Support d'écriture pour LINT, ULINT, RLINT, RULINT dans la fonction bufferWriteByDataType()
  • Modification : Validation des types de données pour accepter BigInt en plus de number
  • Note : La lecture de ces types était déjà supportée via readBigInt64BE(), readBigUInt64BE(), etc.

Détails techniques

Fonction bufferWriteByDataType()

Validation des types (lignes 428-435)

case "LINT":
case "ULINT":
case "RLINT":
case "RULINT":
    // Accept both number and BigInt for 64-bit types
    if (typeof data !== 'number' && typeof data !== 'bigint') {
        throw new NodeS7Error('ERR_INVALID_ARGUMENT', 
            `Data for item of type '${type}' must be a number or BigInt`);
    }
    break;

Écriture dans le buffer (lignes 512-522)

/** 64-bit signed/unsigned types (big-endian) */
case "LINT":
    return buffer.writeBigInt64BE(typeof data === 'bigint' ? data : BigInt(data), offset);
case "ULINT":
    return buffer.writeBigUInt64BE(typeof data === 'bigint' ? data : BigInt(data), offset);
/** Reversed 64-bit types (little-endian) */
case "RLINT":
    return buffer.writeBigInt64LE(typeof data === 'bigint' ? data : BigInt(data), offset);
case "RULINT":
    return buffer.writeBigUInt64LE(typeof data === 'bigint' ? data : BigInt(data), offset);

Utilisation

Exemples d'adresses

DB non optimisé :

// LINT en DB1, offset 0
"DB1,LINT0"      // Forme longue
"DB1,LI0"        // Forme courte (alias)

// ULINT en DB5, offset 100
"DB5,ULINT100"   // Forme longue
"DB5,ULI100"     // Forme courte (alias)

// Tableau de 5 LINT en DB10, offset 50
"DB10,LINT50.5"  // Forme longue
"DB10,LI50.5"    // Forme courte (alias)

Variables globales (M, I, Q) :

// LINT en mémoire M, offset 0
"MLINT0"         // Forme longue
"MLI0"           // Forme courte (alias)

// ULINT en entrée I, offset 20
"ILINT20"        // Forme longue
"IULI20"         // Forme courte (alias)

// LINT en sortie Q, offset 10
"QLINT10"        // Forme longue
"QLI10"          // Forme courte (alias)

Aliases disponibles

| Type complet | Alias court | Description | |--------------|-------------|-------------| | LINT | LI | Long Integer (signé, 64 bits, big-endian) | | ULINT | ULI | Unsigned Long Integer (non signé, 64 bits, big-endian) | | RLINT | RLI | Reversed Long Integer (signé, 64 bits, little-endian) | | RULINT | RULI | Reversed Unsigned Long Integer (non signé, 64 bits, little-endian) |

Exemple de code Node-RED/JavaScript

// Lecture d'un LINT
const item = new S7Item("MonLint", "DB1,LINT0");

// Écriture d'un LINT avec un nombre
await endpoint.writeItems([
    { name: "MonLint", address: "DB1,LINT0", value: 123456789 }
]);

// Écriture d'un LINT avec un BigInt (pour de très grandes valeurs)
await endpoint.writeItems([
    { name: "MonLint", address: "DB1,LINT0", value: 9223372036854775807n }
]);

// Écriture d'un ULINT
await endpoint.writeItems([
    { name: "MonUlint", address: "DB1,ULINT8", value: 18446744073709551615n }
]);

Compatibilité

Automates supportés :

  • ✅ S7-1500 (support natif LINT/ULINT)
  • ✅ S7-1200 firmware récent (support natif LINT/ULINT)
  • ⚠️ S7-300/400 : Ces automates ne supportent pas nativement LINT/ULINT, mais vous pouvez les utiliser comme blocs de 8 octets

Configuration requise :

  • Node.js 10.4.0 ou supérieur (pour le support de BigInt)
  • DB non optimisé sur l'automate (pour un accès par offset)

Notes importantes

  1. BigInt vs Number : JavaScript peut gérer des entiers jusqu'à 53 bits avec Number. Pour les valeurs au-delà, utilisez BigInt (suffixe n)

  2. DB optimisé vs non optimisé :

    • Les types LINT/ULINT fonctionnent uniquement avec des DB non optimisés
    • Dans TIA Portal : Propriétés du DB → décocher "Accès optimisé au bloc"
  3. Endianness :

    • LINT/ULINT : Big-endian (format standard S7)
    • RLINT/RULINT : Little-endian (rarement utilisé, mais disponible)

Tests recommandés

Avant d'utiliser en production, testez :

  1. Lecture/écriture simple : Vérifiez qu'une valeur écrite peut être relue correctement
  2. Valeurs limites : Testez les valeurs minimales et maximales
  3. Tableaux : Testez l'écriture de tableaux de LINT/ULINT
  4. Conversion BigInt : Vérifiez que les grandes valeurs sont correctement gérées

Support et contribution

Pour toute question ou problème :

  • Vérifiez que votre DB est bien non optimisé
  • Vérifiez la version de Node.js (≥ 10.4.0)
  • Vérifiez que l'offset est correct et aligné (multiple de 8 pour LINT/ULINT)

Licence

Ce code conserve la licence GPL-3.0+ du projet NodeS7 original. Copyright: (c) 2018-2020, Guilherme Francescon Cittolin