Modbus RTU Holding Registers 40001 ...

Modbus RTU Holding Registers 40001 ...

A program has this line:
    mb_status = MODBUS(3, -1, mbh, $04, addr, 40001, 1, 1)

That is for reading the value from the server device.  The syntax is value = MODBUS(3, slot, handle, modbus function code[, parameters])

4 is Read Input Registers, so the value of the Start Address must be something between 0 and 9998.  Input Registers in a PLC will be 10001 - 19999 but we do not use the 10000 base, we start at 0.

It shows a start address of 40001 but that will be for Holding Registers which is function 3.  Again, do not use the 40000 base, just start at 0.

So the command should be this:

mb_status = MODBUS(3, -1, mbh, $03, addr, 0, 1, 1) ' the value from holding register 40001 will be put in VR(1)
    • Related Articles

    • Modbus RTU Trio slave

      We have connected many different brands of HMI to the Trio using Modbus RTU on RS232. Typical serial communications setup below. baudrate = 9600 ADDRESS = 1 SETCOM(baudrate, 8, 1, 2, 1, 4) ' 8 bits, one stop bit, even parity The HMI will use Modbus ...
    • Trio - Modbus TCP Client

      The Trio firmware can open a Modbus Client port and communicate with any Modbus Server. Port number is usually 502. You need to have the document from the slave vendor that lists the register numbers in the Modbus connection of the device. Probably ...
    • Modbus TCP and Ethernet IP on Flex-6-Nano

      Q. Can we run and use Modbus TCP server and Ethernet IP server on Flex-6-Nano at the same time? A. Yes you can use both in parallel. They open different "port" numbers on the Ethernet communications but have the same IP Address. For example Modbus is ...
    • AN-363 MODBUS RTU connecting to Stepper Drive

      This document is a guide to users wanting to use the Motion Coordinator MC4/5/6 as a Modbus master connected to a typical slave device. The actual example used is the Moons ST stepper drive.
    • AN-366 MODBUS TCP response time

      When planning a network and the communication links between devices, the available response time is often needed to allow the system designer to work out how much data can be transferred.  This document lists the results of some timing tests on ...