IMDHMIControls LibraryShop main store

Explainer

Unity Pro topological addressing to Modbus conversion rules

SCADA and data logging Published 7 min read By IMDHMI controls team

Short answer

Unity Pro has no function that converts a topological address such as %I1.5.0 into a Modbus number. Read each module's first address from the rack configurator and add one per channel, or copy the I/O into a block of %MW words and let the iFix driver poll that block as holding registers; an OPC server removes the conversion only when one can be installed.

On this page
  1. What a topological address contains
  2. Why no formula converts it
  3. The areas the driver expects
  4. Reading a module's first address in the rack configurator
  5. Mapping the rack 1 slot 5 DDI to 1x and 3x numbers
  6. Mirroring the I/O into %MW when no OPC server is allowed
  7. Where an OPC server fits
  8. Questions asked

There is no conversion function in Unity Pro: nothing in the software turns %I1.5.0 into a Modbus number, and no slot-number formula survives a project in which the CPU's word windows have been moved. Two paths work when an iFix Modbus driver polls a Quantum. Read each module's first Modbus address in the rack configurator and add one per channel: for a DDI at rack 1 slot 5, the first input %I1.5.0 is 100001 and channel 15 is 100016. Or copy the I/O into a run of %MW words in the PLC program and give iFix only that 4x block. The first path suits a handful of points; the second is the one to build on a set installation where no OPC server can be added.

What a topological address contains #

IEC 61131-3 defines located variables as a percent sign, an area letter and a position, and Unity Pro writes the position as rack, slot and channel. The address therefore names the physical terminal: the channel the electrician wired is the channel the program reads, whatever tag the programmer hangs on it. The area letters you meet on a Quantum:

  • %I, %Q and %M: input bit, output bit and internal bit, all of type EBOOL.
  • %IW and %QW: input word and output word.
  • %MW: internal word memory.
  • %W: network exchange word, served to Modbus Plus and Ethernet services.
  • %S and %SW: system bits and system words.

The system area shows why a SCADA cannot guess: those bits keep their own documented behavior — the Grafcet startup bits are covered in Unity Pro system bits %S0 and %S1 for Grafcet startup initialization — and a number mapped by guesswork reads something else entirely.

Why no formula converts it #

The Modbus numbers behind a Quantum are not welded to slot numbers. The CPU setup positions the input and output word windows, through settings such as In_Word_Start and Out_Word_Start; the configurator folds the 1-based Modicon offset into the numbers it prints; and those windows differ between projects. A formula that works on one machine reads the wrong word on the next. Unity Pro also offers no project-wide export of a topological-to-Modbus cross-reference, so the map is assembled module by module, and the printed number is the authority: it already carries the offset and the window position, leaving nothing to compute but the channel count.

In current Control Expert projects the address style is also a per-module choice, made before the module is dropped into the rack — an M580 shows it as Topological or Device DDT at the bottom of the module screen — so two identical modules can carry different styles in one project.

The areas the driver expects #

The driver never sees %I or %MW. It sees four Modicon areas, each numbered from one, with the leading digit selecting the area and the function codes fixed by the Modbus application protocol:

Driver area Numbers Function codes What it reaches in the PLC
Coils 0x 01, 05, 15 %Q and %M bits
Discrete inputs 1x 02 %I bits
Input registers 3x 04 %IW words
Holding registers 4x 03, 06, 16 %MW and %QW words

Numbering counts from one in every area: the first holding register, 400001, is %MW0, so a holding-register number is 400001 plus the %MW index. In iFix you choose the area through the driver data type of the block, and the function code follows from it.

Reading a module's first address in the rack configurator #

Open the project and work down Project Browser, Configuration, to the PLC bus. Click the module: its slot description prints the Modbus numbers assigned to it — the first 1x number for the channels of a DDI, the first 3x number for its input word, 4x numbers where word memory is exposed. Copy those numbers into the iFix database with the matching data type. Count channels up from the printed number, one per channel, and count bits inside a channel word the same way. Never recompute the base from the slot: when a bus scan disagrees with a hand-computed number, the hand-computed number is the wrong one.

Mapping the rack 1 slot 5 DDI to 1x and 3x numbers #

The inputs, with where each comes from:

  • Module position, rack 1 slot 5: from the machine's rack layout; this is the DDI in your case, the one whose first channel carries the tag Fred.
  • The module's first 1x number, 100001: read from the configurator's slot description, not computed.
  • Channel index, 0 for Fred through 15 for a 16-channel card: from the module's channel numbering.
  • Bit index inside a channel word, 0 to 15: needed only when iFix must follow a bit of a channel rather than the channel itself.

The rule in words: each channel owns one 1x number, one above the previous channel's; a bit inside a channel word adds its bit number to the module's first number instead; the module's input word sits in the 3x area at its own printed number.

The arithmetic:

  • %I1.5.0, channel 0: 100001 + 0 = 100001.
  • %I1.5.15, channel 15: 100001 + 15 = 100016.
  • %I1.5.0.3, bit 3 of channel 0: 100001 + 3 = 100004.
  • %IW1.5.0, the module's input word: 300001, taken from the configurator the same way.

The result: Fred's digital block in the iFix database is a discrete-input (1x) point at 100001, the last channel sits at 100016, a block that must follow bit 3 of Fred's channel sits at 100004, and the whole module can be read at once by polling its input word at 300001 and testing bits on the SCADA side.

The decision: individual 1x points are right while this one module is the whole job. Once the map covers more than about two modules of bits — above roughly 32 discrete points — stop adding 1x addresses, because each one costs its own Modbus transaction and the mirror in the next section turns the same points into one 4x read.

Mirroring the I/O into %MW when no OPC server is allowed #

On a set installation that cannot take an OPC server, give the driver what it understands: a contiguous %MW block, rewritten every scan, holding copies of everything iFix needs. Where the module exposes an input word, the mirror is one line of structured text, with %MW100 as an example index for the block's first word:

(* runs every scan: copy the input word of the module into holding memory *)
%MW100 := %IW1.5.0;

Where no input word is readable, zero the word and set each bit from its own channel:

%MW100 := 0;
IF %I1.5.0 THEN %MW100.0 := 1; END_IF;
IF %I1.5.1 THEN %MW100.1 := 1; END_IF;
(* continue the same pattern through channel 15 *)

The driver reaches the block through the 4x area at the window base plus the index, so the word at %MW100 is polled as 400101 and the following words run on contiguously. Check where the CPU's 4x window ends before fixing the index: a mirror placed past that end is not the memory you think it is, and iFix reads system words there and raises false alarms.

After the block, the SCADA side needs no new PLC addresses. A point inside a word is a bit reference in the item, and how that reference is built is shown in Modbus register bit addressing in a SCADA item reference. Holding registers, not input registers, are the right home, because the block must stay writable from the program and readable in one request; that trade-off is set out in Modbus holding register vs input register: which one to use. Packing the points into one contiguous buffer instead of scattering them over single transactions is the same discipline a Modbus slave simulator follows when it maps arrays through one contiguous buffer, and a mirrored word that carries a signed count reaches iFix as a raw unsigned word the SCADA must convert, as described in Converting an unsigned 16-bit Modbus word to a signed integer.

Prove the map at the terminals: close Fred's channel and the polled word must step from 0 to 1; close channel 3 and it must read 8. Those two readings confirm the bit order and the register offset together. One safety note: the mirror is a copy one scan old, so keep every interlock and safety function in the PLC logic that reads the real inputs, never in SCADA logic that reads the mirror.

Where an OPC server fits #

When the installation allows new software, the Schneider OPC Factory Server removes the conversion entirely: export the symbol file from Unity Pro (PLC menu, Export Symbol File), point an OFS logical server at it over Modbus TCP, and the iFix OPC client browses real variable names — Fred is Fred, and no numbers appear anywhere. The wider choice between an OPC server, a raw Modbus driver and capture is compared in Read sensor data from SCADA server: OPC, Modbus or capture. On your set installation that door is closed, which makes the %MW mirror the correct design rather than a stopgap.

Questions asked

Does the same conversion work on a Premium or an M340?

The rule does; the layout does not. A Premium keeps local I/O on rack 0 in most configurations and has no remote drops, so only slot and channel vary. An M340 backplane offers 4, 6, 8 or 12 slots and distributes remote I/O through an Ethernet scanner rather than drops. In every case the configurator still prints each module's first Modbus number, and that printed number is what belongs in the driver.

Why does 400001 correspond to %MW0?

Modicon numbering counts from one, so each area's first number sits one above its zero element: holding register 400001 is %MW0, and the coil, discrete-input and input-register areas begin the same way. The one-offset is already inside the numbers the configurator prints, which is why adding a second offset by hand puts every point one register off.

Should the mirror block live in %W or %MW?

%W is the network exchange area served to Modbus Plus and Ethernet services, while %MW is plain internal memory that a Modbus TCP poll reads directly as holding registers. For a Quantum polled by an iFix Modbus driver, put the mirror in %MW: its words are readable at the 4x window base plus the index, and no gateway service has to be configured for the driver to reach them.

How can the whole map be checked quickly?

Toggle one channel at a time from the field terminals and watch the polled word: channel 0 must give 1, channel 1 must give 2, channel 2 must give 4, doubling each time. A point that moves the wrong bit is a bit-order error; a point that moves nothing is an offset or window error. Working from the terminals tests the wiring as well as the program.

Keep reading

  • How-to

    How Geo SCADA writes to an M340 PLC over Modbus TCP

    A Geo SCADA write to an M340 over Modbus TCP needs a write function code, a writable target and PLC logic that leaves the target alone. Point function 05 or 15 at %M bits and function 06 or 16 at %MW words, prove both on scratch addresses, and confirm the offset convention by writing 1234 and reading the same word back in the animation table.

    SCADA and data logging

  • Explainer

    Reading SunSpec Modbus devices into SCADA over Modbus TCP

    A standard Modbus TCP driver reads SunSpec devices. SunSpec only defines the register layout: a chain of model blocks starting at the device's documented base address, each block carrying a model identifier, a length, and int16 values you decode with per-block scale factors. The engineering work is block location and scaling, not a new transport.

    SCADA and data logging

  • Troubleshooting

    Why a Modicon M221 bit stays fixed in Kepware over Modbus TCP

    A Modbus TCP tag at 00001 that never changes usually reads the wrong Modbus object, not a broken link. The M221 does not expose its %I inputs to a read request, so match the controller's documented coil mapping, then correct Kepware's zero-based addressing option before blaming the network.

    SCADA and data logging