Skip to content

Bug when writing more than 12 Boolean variables  #8

Description

@FiloCara

Hello

There is a bug which prevent to write more than 12 Boolean variables at the same time.
This issue is strictly related to the one I opened a while ago for the node-red-contrib-s7 package (st-one-io/node-red-contrib-s7#90)

Steps to reproduce:
Write more than 12 Boolean variables at the same time using the writeItems method of the S7ItemGroup class. This raises a request timeout.

Problem:
After investigating, the problem seems related to the way the reqItemLength variable is computed.

A writing_var (s7) request for multiple Boolean variables requires the following bytes:

  • HEADER: 10 bytes
  • PARAMETERS: 2 bytes + 12 bytes per variable
  • DATA: 4 bytes per variable + 1 byte per variable + 1 extra fill byte per variable (something like a separator character)

The reqItemLength does not take into account the fill byte.
I'm going to open a pull request to fix it.

Filippo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions