Register reading with Modbus TCP

Forum Home Forums Communicating with Devices Modbus Register reading with Modbus TCP

Viewing 15 posts - 1 through 15 (of 23 total)
  • Author
    Posts
  • #16347
    zzmMG
    Participant

    Hello all,

    I was able to successfully connect rapidscada 6.4 to a modbus TCP device (power analyzer).
    Now, I want to read data from registers lika voltage, current …
    How am I supposed to adjust values in the appropriate channel?
    The device documentation says following as example:
    Request:
    Address: 0A, Peripheral number: 10 in decimals.
    Function: 04, Read function.
    Initial Register: 0000, on which the reading will start.
    No. of Registers: 0002, number of registers read.
    CRC: 70B0, CRC Character.

    expected response:
    Address: 0A, Responding peripheral number: 10 in decimals.
    Function: 04, Read function.
    No. of bytes: 04, No. of bytes received.
    Registers: 0000084D, value of the phase voltage of L1: VL1 x 10 : 212.5V
    CRC: 8621, CRC Character.

    Any documentation will be appreciated.
    Thanks for your help

    #16349
    manjey73
    Participant

    In input script – Cnl/10

    #16350
    manjey73
    Participant

    In configuration Modbus – group – Input Registers.
    Value – 4 bytes uint.
    Maybe change byte

    #16352
    Mikhail
    Moderator

    Hello,
    This video may help.
    If you add links to the screenshots of your settings and data, it would be useful to resolve the questions.

    #16354
    zzmMG
    Participant

    Thanks. Now I am progessing.

    I cannot get min / max value changed (or read?), min in registers 164-165 and max 106-107

    I use configuration Modbus – group – holding Registers – Value – 4 bytes uint for both element and command

    following result of command:

    Send: 00 0e 00 00 00 0b 01 10 01 64 00 02 04 00 00 08 98
    Receive: 02 07 00 00 00 06 01
    Receive: 10 01 64 00 02
    OK

    #16359
    Mikhail
    Moderator

    Try the Modbus parser https://rapidscada.net/modbus/ to find mistakes in requests.

    #16368
    zzmMG
    Participant

    My bad, the register i was trying to write to was not meant to be written but reset only. The parser helped a lot.

    Thx

    #16683
    rapidscadaaks
    Participant

    Hi
    I have a Waveshare Modbus RTU(D) Relay with has 8 channels each of Digital Inputs and Outputs.
    I am able to use to digital outputs using commands and also check their status.

    I am however not able to read status of Digital Inputs. Waveshare manual gives following parameters for reading input status:
    Modbus Function Code 0x02
    Address (HEX) 1×0000 …… 1×0007 for the 8 channels

    I have tried various combinations and have not succeeded

    I will be grateful for assistance

    #16684
    rapidscadaaks
    Participant

    Details & manual of the device:

    https://www.waveshare.com/wiki/Modbus_RTU_Relay_(D)

    #16686
    Mikhail
    Moderator

    Hi,
    Please copy a part of the communication line log to check data packets, and provide screenshots of the Modbus template.

    #16692
    rapidscadaaks
    Participant

    Hi
    I have the screenshots ready. Please advise how to attach as I do not seem to find option for uploading file

    #16693
    rapidscadaaks
    Participant
    #16694
    Mikhail
    Moderator

    Hi,
    Could you copy the packets from the communication line log as text?
    They can be found in a text file in the logs directory.

    #16698
    rapidscadaaks
    Participant

    Hi
    In 100% cases, Digital Input is failing

    2025-07-23 18:10:48 Session with the device [47] Waveshare_Relay_Test
    Request element group “Relays”
    Send (8): 01 01 00 00 00 08 3D CC
    Receive (2/2): 01 01
    Receive (4/4): 01 00 51 88
    OK
    Request element group “Digital Input”
    Send (8): 01 02 00 00 00 08 79 CC
    Receive (0/2):
    Error: communication failed
    Request element group “Digital Input”
    Send (8): 01 02 00 00 00 08 79 CC
    Receive (0/2):
    Error: communication failed
    Request element group “Digital Input”
    Send (8): 01 02 00 00 00 08 79 CC
    Receive (0/2):
    Error: communication failed

    2025-07-23 18:10:52 Session with the device [47] Waveshare_Relay_Test
    Request element group “Relays”
    Send (8): 01 01 00 00 00 08 3D CC
    Receive (2/2): 01 01
    Receive (4/4): 01 00 51 88
    OK
    Request element group “Digital Input”
    Send (8): 01 02 00 00 00 08 79 CC
    Receive (0/2):
    Error: communication failed
    Request element group “Digital Input”
    Send (8): 01 02 00 00 00 08 79 CC
    Receive (0/2):
    Error: communication failed
    Request element group “Digital Input”
    Send (8): 01 02 00 00 00 08 79 CC
    Receive (0/2):
    Error: communication failed

    2025-07-23 18:10:56 Session with the device [47] Waveshare_Relay_Test
    Request element group “Relays”
    Send (8): 01 01 00 00 00 08 3D CC
    Receive (2/2): 01 01
    Receive (4/4): 01 00 51 88
    OK
    Request element group “Digital Input”
    Send (8): 01 02 00 00 00 08 79 CC
    Receive (0/2):
    Error: communication failed
    Request element group “Digital Input”
    Send (8): 01 02 00 00 00 08 79 CC
    Receive (0/2):
    Error: communication failed
    Request element group “Digital Input”
    Send (8): 01 02 00 00 00 08 79 CC
    Receive (0/2):
    Error: communication failed

    2025-07-23 18:11:00 Session with the device [47] Waveshare_Relay_Test
    Request element group “Relays”
    Send (8): 01 01 00 00 00 08 3D CC
    Receive (2/2): 01 01
    Receive (4/4): 01 00 51 88
    OK
    Request element group “Digital Input”
    Send (8): 01 02 00 00 00 08 79 CC
    Receive (0/2):
    Error: communication failed
    Request element group “Digital Input”
    Send (8): 01 02 00 00 00 08 79 CC
    Receive (0/2):
    Error: communication failed
    Request element group “Digital Input”
    Send (8): 01 02 00 00 00 08 79 CC
    Receive (0/2):
    Error: communication failed

    2025-07-23 18:11:04 Session with the device [47] Waveshare_Relay_Test
    Request element group “Relays”
    Send (8): 01 01 00 00 00 08 3D CC
    Receive (2/2): 01 01
    Receive (4/4): 01 00 51 88
    OK

    #16706
    Mikhail
    Moderator

    Hi,

    According to Modbus Parser, the following data is requested:
    https://ibb.co/bjB7xMyC

    Does it match the Modbus register map?

Viewing 15 posts - 1 through 15 (of 23 total)
  • You must be logged in to reply to this topic.