News:

  • November 17, 2025, 09:25:52 AM

Login with username, password and session length

Author Topic: MODBUS TCP with H2-D1ME CPU  (Read 145 times)

jktucker92

  • Newbie
  • *
  • Posts: 1
MODBUS TCP with H2-D1ME CPU
« on: November 05, 2025, 04:00:44 PM »
I am working with the Do-More PLC's for the first time and have a question about using Modbus TCP with these PLC's.  For the old DL260 CPU, Modbus was straight-forward and a PLC memory address could be read and written to after you used the excel spreadsheet to map a PLC address to a Modbus holding register.  For the H2-D1ME CPU, what I'm reading is the only memory addresses available via Modbus TCP are the MHR, MIR, MC and MI addresses.  I use Ignition to interface with my PLC's, and I want Ignition to be able to read a setpoint from the PLC memory and be able to change that setpoint.  I don't see how I can do this.  For example, the setpoint is a real number, say R0, while I can copy that memory to the MHR address space to read via Modbus, I can't change that value in Ignition.
What am I missing?  Is there another way to handle this.  I also want to be able to read the position of a relay that controls a valve and also operate that valve.  I have some concepts using multiple values to read and write these values, but that gets very complicated.  Is there a way to mirror the R address space to the MHR address space for read-write capability?  Is there another method I should be using to connect Ignition to these PLCs?

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3770
    • Host Engineering
Re: MODBUS TCP with H2-D1ME CPU
« Reply #1 on: November 05, 2025, 05:24:26 PM »
Instead of using R as your setpoint, use casts of Modbus 16 bit Holding Register block (MHR).  Two gotchas in Do-more is that REAL casts of a memory location must be aligned on DWORD boundaries (so even MHR addresses), and the 2nd gotcha is there is no Modbus address 0 (everything starts at offset 1 with Modbus, e.g. Modbus Holding Register 40001 maps to MHR1, so you can't use MHR0, but you can use MHR2 or MHR10 for the cast).

To help out, let's use Nicknames.  Instead of assigning the Nickname MySetpoint to R0, assign it to MHR10:RD (the : is a "cast operator"), which means look at Holding Register 40010 and 40011 (MHR10 and MHR11) as a DWORD REAL.

To learn about casts, there's a video that helps with that:
https://www.youtube.com/watch?v=BvTuz6H3sD4

The easiest way to assign a nickname to a cast is from within the Doc Editor (Ctrl+D), hit the Add button and enter MHR10:RD in the Element field (see screen shot).

Then just use and enter MySetpoint in your logic, data view, trend view, everywhere (or enter MHR10:RD).  The Auto-Complete should make entering the Nickname easy.

The behavior for the relay is simpler, just use MC (Modbus Coil) instead of a C bit for everything that is read/write via Modbus.  No casts needed for bit memory (bit is a bit).

The purpose of these reserved memory areas is to protect the memory locations that are NOT accessible via Modbus.  In a 260, ANYTHING can write to I/O since EVERYTHING is mapped to Modbus memory (you just need that spreadsheet).  In Do-more, ONLY put the Modbus accessible data in your MHR, MIR, MC, MI data blocks.  Nothing else is accessible via Modbus (not X, not Y).

There are similar blocks for legacy DirectLOGIC data types: DLX, DLY, DLC, DLV that are octal.  So a 260 could read/write using RX/WX to Do-more to those memory blocks.  There is also DLRX, DLWX instructions for Do-more program performing the legacy DL protocol to those legacy PLCs.  Similar reasoning for the DL blocks as for the Modbus blocks.