IMDHMIControls LibraryShop main store

How-to

Expose PLC values to an OPC server through guest memory blocks

SCADA and data logging Published 6 min read

Short answer

Copy every value the OPC server needs into a Do-more guest block with a ladder MOVE, cast 32-bit reals at an even DLV address and configure the server tag as REAL, and let clients write outputs only to a V-memory staging word the ladder moves to the physical output. DLY is data, not an output alias, and Modbus clients read through MRX and MWX.

On this page
  1. Two paths, one boundary
  2. Stage the values into guest blocks
  3. Keep the fractional part: even addresses and REAL tags
  4. Octal guest addresses are not decimal Do-more addresses
  5. Write outputs through a staging word, never through DLY
  6. Serve Modbus clients with MRX and MWX
  7. Buy throughput with one device per server
  8. Questions asked

An OPC server that speaks the DirectLogic protocol cannot see your Do-more nicknames, structures or physical I/O; it reads three guest blocks — DLV for words, DLX and DLY for discretes. So the integration is staging work: MOVE every value the server needs into those blocks, cast 32-bit reals at even DLV addresses with the :R suffix and configure the server tag as REAL, and route every client write to a V-memory word that ladder logic carries to the output. Modbus clients skip the guest blocks entirely and use MRX and MWX. The steps, addresses and arithmetic follow.

Two paths, one boundary #

The DirectLogic protocol is supported on the Do-more as a guest protocol: it reaches a limited area of memory and nothing else. That is deliberate. Neither the DirectLogic protocol nor Modbus authenticates anything, and the Do-more memory map is configurable — you add blocks, change block lengths, build heap items and structures — so a transparent map would be ambiguous as well as unsecured.

Path What the server sees Use it for
DirectLogic protocol over Ethernet (KEPdirect) DLV, DLX and DLY guest blocks only Values you explicitly MOVE in
Modbus TCP (Cogent, Ignition, any Modbus client) Whatever the MRX and MWX instructions transfer Bulk data, since those instructions reach all internal memory

Decide which path each client is on before touching the ladder, because the two paths fail differently.

Stage the values into guest blocks #

  1. List every value the server must read or write, with its type: bit, 16-bit word, 32-bit real.
  2. Allocate one contiguous DLV range for words and reals, and DLX for status bits. Contiguity pays off again under Modbus throughput, and it keeps the second word of every real out of trouble.
  3. Add one rung per value. The working example moved the PID process variable with MOVE SimPID.PV DLV2002, which made V2002 visible to the server, the HMI and the data-logging client.
  4. Confirm the copy in Do-more Data View first, then read the same guest location from the server's test client — before any downstream scaling exists to confuse the result.
  5. For status bits, the example used MOVE X0 DLX0 to expose the loop's manual/auto state. Verify polarity in your program; that one read low as manual and high as auto.

Keep the staging rungs together in one program section. If the editor misbehaves around nicknames or program stages, the MOVE nickname display and stage sorting fixes page covers those quirks.

Worked allocation, illustrative: 8 real values with the first one at DLV3000. Each real occupies 2 words, so the block is 8 × 2 = 16 words — DLV3000 through DLV3015, casts at 3000, 3002, 3004 … 3014, all even, and the next free word is DLV3016.

Keep the fractional part: even addresses and REAL tags #

A 32-bit real occupies two consecutive 16-bit locations. The cast is written with a colon-R suffix and requires an even address: DLV2000:R and DLV22:R are valid, DLV19:R is not. Reserve the second word of each pair; another value parked there corrupts the real.

The server side must agree. Configure the tag as REAL rather than the driver's default unsigned word, or the client shows an integer, a wrong number or a dead tag. The agreement governs writes too — the same mismatch is why a SCADA write to a PLC real address fails silently with no error to chase.

If the server side truly cannot be a real type, the fallback is the scaled integer: multiply by 10 in the ladder, divide by 10 in the client. An illustrative PV of 152.36 arrives as 152.3 or 152.4 — one decimal, rounding decided by the MOVE — and a client that forgets the ÷10 reads ten times high. Use the :R cast; keep ×10 for the corner case.

Octal guest addresses are not decimal Do-more addresses #

DirectLogic addresses count in octal; Do-more native blocks count in decimal. The same digits are different locations.

Worked conversion: DirectLogic V2000 is octal, so its value is 2×512 + 0×64 + 0×8 + 0 = 1024 decimal — it corresponds to Do-more V1024. In the other direction, Do-more V2000 decimal converts as 3×512 + 7×64 + 2×8 + 0 = 1536 + 448 + 16 = 2000, so it appears as DirectLogic V3720.

The decision: never translate an address across the boundary. Stage the value into a guest block and point the server at the guest location. This radix difference is one more reason a full memory map is not offered.

Write outputs through a staging word, never through DLY #

DLY is data the protocol can see; it is not an alias for the physical outputs. On a DL06, writing Y over the server moves the relay because Y is the native map that protocol was built for. The Do-more guest block is a separate block with its own numbering: in the test that documented this path, writing DLY15 to operate Y15 actually operated Y10.

The pattern that works: the client writes a plain V-memory word, and one rung carries it to the output. The documented example used MOVE V2020 Y15, with the client writing 0 or 1 to V2020. Verify all three points independently with the machine in a safe state — the client-written word, the consuming rung, the physical point. If the wrong point moves, stop and find the mapping; do not probe neighboring addresses.

One safety note, here where it belongs: this protocol authenticates nobody, so a staging word is a network control input. The permissive and interlock logic that qualifies it belongs in the ladder, and no physical output should be exposed just to make a tag writable. On the Modbus side, safe writes to PLC output registers follow the same staging discipline.

Serve Modbus clients with MRX and MWX #

Two published attempts failed before the working one: WY0 sent to MHR1 in the belief that MHR1 presents as holding register 40001, and WY0 sent to V3000 through an ECOM-based driver. Data View showed V3000 tracking WY0, and the OPC Quick Client read zero in both cases. That is a reported result: it tells you to verify each boundary, not that those addresses are wrong everywhere.

The setup that worked with Cogent and Ignition used the MRX and MWX instructions, after IP addressing on the simulator laptop was corrected. Because MRX and MWX access all internal memory, this path needs no guest blocks and no heap items.

Check the server's address convention when you map registers: Modbus addressing is displayed either as a one-based reference such as 40001 or as a zero-based offset, and the same register wears both labels. Then verify the value at three places — Data View source, instruction destination, OPC client — before trusting the tag.

Buy throughput with one device per server #

The performance rules on the Modbus path:

  • Each device transacts one communication at a time; a server that accepts multiple connections gets parallel transactions from multiple devices.
  • Run one device per server. One device shared by two servers serializes both and destroys throughput.
  • Minimize transactions per server: group data contiguously and read the maximum items per transaction.
  • Reads in $TopOfScan and writes in $BottomOfScan organize the code but do not change throughput, because the Modbus instructions are multi-scan either way.

Worked load: 50 samples per second on each of 10 gauges is 10 × 50 = 500 samples per second — 500 words as integers, 1000 words as reals. Staged contiguously, one transaction per poll carries the whole set; scattered, it costs ten serialized transactions on a device that runs one at a time. Decision: one contiguous block, one device per server, and the sample rate becomes a scheduling question instead of a protocol wall.

Questions asked

Why can't KEPdirect read my Do-more nicknames like SimPID.PV?

The DirectLogic protocol reaches the Do-more controller only through the DLV, DLX and DLY guest blocks. It is a guest protocol by design: the protocol carries no security, and the Do-more memory map is configurable, so a transparent mapping would be ambiguous and would expose internal memory over an unsecured link. MOVE the value into a guest location and point the server tag at that guest address.

How do I recognize an odd-address or overlapping real fault after the system is running?

The tag does not usually fail dead — it reads a wildly wrong or wildly changing number, because half the bits belong to a different value. Watch Data View on the pair of words as hex while the client reads the tag: if the low word changes when some unrelated staging rung fires, another value is parked in the second word of the pair. Also check the count parity of the downstream clients: a client polling the same guest word as an integer will flip the real's low word every scan, so only the REAL-configured tag may touch it.

Can I switch real outputs from the HMI by writing DLY?

No. DLY is a data block the DirectLogic protocol can see, not an alias for the physical outputs — in one documented test, writing DLY15 operated Y10. Have the client write a V-memory staging word instead, and let a ladder rung move that word to the output through whatever permissive logic belongs there.

Why does my Modbus tag read zero in the OPC client while Data View shows the right value?

Somewhere between the PLC location and the server tag, the value is not on the path you think. Two setups that failed this way published WY0 to MHR1 and to V3000 through an ECOM-based driver; both read zero in the client. The path that worked used the MRX and MWX instructions. Check the instruction, the driver, and whether the server counts Modbus addresses from a one-based reference like 40001 or a zero-based offset.

How do I get 50 samples per second from ten pressure gauges?

Group them. Each Modbus device runs one transaction at a time, so give each server its own device and put all ten gauge words in one contiguous block that a single transaction reads. Ten scattered registers cost ten serialized transactions per poll; one contiguous block costs one. Heap items are not needed on the Modbus path because MRX and MWX reach all internal memory.

Keep reading

  • Troubleshooting

    Fixing CODESYS OPC DA memory growth stopping SCADA reads

    The reads stop because WinCoDeSysOPC.exe, a 32-bit OPC DA server process, climbs to its 2 GB memory ceiling over weeks and then stops serving tags; killing it only resets the clock. The resolution that held was installing the current, licensed CODESYS OPC DA server — 3.5.22.40 in place of the CODESYSV35SP10Patch2 install — and proving it through the old failure window.

    SCADA and data logging

  • Troubleshooting

    Getting Citect SCADA talking to a Mitsubishi iQ-R PLC

    Fix the transport before anything else: the Citect MELSECQ port on TCP_BOARD must match the iQ-R's SLMP connection module exactly — protocol, port number and IP address. If tags above device 65,535 fail, that is the MELSEC Q protocol's 16-bit address ceiling, and no setting fixes it; move to Mitsubishi's OPC MX UA server with a Citect OPC client driver.

    SCADA and data logging

  • How-to

    Connect an S7-1500 to SCADA over OPC UA from TIA Portal

    The S7-1500 has a built-in OPC UA server from firmware V2.0, deactivated by default. Enable it in the CPU device properties in TIA Portal, select the installed server license, copy the endpoint URL, and download. Paste the opc.tcp address into any OPC UA SCADA client, trust the certificates on both sides, then browse the PLC variables and map them to SCADA tags.

    SCADA and data logging