IMD SolutionComputing LibraryShop main store

Troubleshooting

DeviceBridge writeback to DataLayer fails as readonly

Edge computing and IIoT Published 8 min read By IMD Solution engineering team

Short answer

Enabling WriteBack in DeviceBridge does not create the MQTT-to-DataLayer return path by itself. The write executes only when a writeback tag inside the collector logic is bound to a writable DataLayer node by its full path, the incoming payload field matches that node's type, and the device license covers the two-direction arrangement. The readonly error names the endpoint the write addressed, so test the destination node directly before changing the binding.

On this page
  1. Why does enabling WriteBack still leave the return path dead?
  2. How do I prove the command message reaches DeviceBridge?
  3. How does the collector route a received value into a writeback tag?
  4. Why does the write to var2 report Endpoint var2 is readonly?
  5. Does the DataLayer writeback route need a two-device license?
  6. What does a working writeback configuration contain?
  7. Which failure do you have?
  8. Questions asked

Enabling WriteBack in DeviceBridge does not create the MQTT-to-DataLayer return path by itself. The function only executes writes inside the collector logic, against a writeback tag bound to a writable DataLayer node, and a second boundary sits in licensing: the DataLayer connection counts as a device, and the two-direction arrangement needs a two-device license. This article follows the return direction in the order you meet it — prove the message arrives, prove the collector routes it, prove the destination accepts a write, then prove the license covers the route — and ends with the decision for each failure you can hit on the way.

Why does enabling WriteBack still leave the return path dead? #

WriteBack is not a master switch that makes every exposed DataLayer endpoint writable: the function runs only inside the DeviceBridge collector logic, so a received MQTT value changes nothing until a writeback tag in that logic selects a writable destination node for it.

Treat the two directions as separate proofs. A working publication proves that DeviceBridge can read the node, wrap it through the simple JSON collector and deliver it through the MQTT connector — it proves nothing about a subscription on the return topic. A write sent by a client directly to the DeviceBridge writeback DataLayer endpoint is not processed as a write operation at all, which is why an enabled function with no writeback tag produces silence instead of an error.

Route What a pass proves What it does not prove
Publish, KVD node to broker Read path, collector mapping and connector delivery That anything subscribes on the return topic
Writeback, broker to collector to node The whole return route, including the write result Nothing — this is the route you are building
Direct write to the writeback endpoint Nothing — this route is not processed Not a fallback for the collector route

The return route has the same shape as any MQTT writeback: subscribe, route, write. That pattern is worked out end to end, for a PLC register as the destination, in the article on subscribing to MQTT and writing the value back to the PLC.

How do I prove the command message reaches DeviceBridge? #

Publish one controlled test command to the command topic and follow it across three handoffs — client to broker, broker to DeviceBridge subscription, subscription to collector — before changing any collector logic.

  • Client to broker. Read the broker address, port and transport settings from the connector and compare them with the command client's settings, then check the broker's client and message diagnostics to see whether the publish arrived at all.
  • Broker to subscription. The broker must list DeviceBridge as a connected subscriber of the command topic. Compare the subscription topic character by character and check the authorization that lets that client subscribe; a wrong topic or a denied subscription looks identical to silence from the client side.
  • Subscription to collector. If delivery succeeds and still no write attempt appears, the message is stopping at routing — go to the writeback tag binding.

A session that connects but carries no payloads is its own failure shape, the one behind a gateway that shows a TCP connection but sends no payload, and the broker-side checks in that article apply here unchanged. If the command client cannot reach the broker in the first place, work through why a device cannot publish MQTT to a broker on your PC before touching DeviceBridge.

How does the collector route a received value into a writeback tag? #

Route the value explicitly: create a writeback tag inside the collector, bind it to the destination node's full DataLayer path, and connect the incoming payload field to that tag — without the tag, a delivered message has no destination and no write follows.

Creating a second variable in KVD does not create that binding, and a JSON property named var2 does not select the KVD node: payload names and DataLayer names only meet through the writeback tag. Compare the received payload against the field the collector actually reads and separate three cases before blaming permissions — a missing field, a value delivered as a JSON string, and a numeric value. If no write attempt appears after receipt, correct the routing or the payload extraction first, because the destination's access rights are irrelevant to a message the collector never connects.

Read access and write access are separate capabilities. A tag that publishes correctly can still expose only a read operation at the collector layer, and the deciding observation is a successful write through the same destination route the collector will use — never a successful publish.

Why does the write to var2 report Endpoint var2 is readonly? #

The error Endpoint var2 is readonly. identifies the object DeviceBridge addressed — a collector endpoint, a device tag and a KVD node can all carry the name var2 while exposing different operations, so the next step is to test the exact destination, not the name.

The known writable node in this setup is samples/kvd/implicit_one_level/var1. A short name such as var2 is not a complete DataLayer address: read the full configured path for the second variable, which on the same KVD device follows the same pattern, samples/kvd/implicit_one_level/var2.

Open the destination in a DataLayer browser and read three things from it: current value, data type and advertised operations. Then, with the application in an approved test state, write a type-compatible value directly to that exact node and read it back. One caution before that test: if a running process consumes this variable, a direct write moves the process, so test on a variable nothing downstream reads.

The direct write decides the case. If it fails, the destination is the fault: KVD populates its model node instances from ctrlX Data Layer models in YAML format, so a node whose model never declared the write operation comes up read-only and must be redeclared with it. If it succeeds, the binding is the fault: DeviceBridge is addressing a read-only intermediary under the name var2, and correcting the destination binding — not the working KVD node — is the fix.

Does the DataLayer writeback route need a two-device license? #

Yes: the DataLayer connection counts as one device, and the arrangement that publishes it to MQTT and writes MQTT values back is a two-device case, so a single-device entitlement cannot run the return route even when every binding is correct.

Count device entries, never variable names. Worked example from this arrangement: two KVD variables on one DataLayer device entry give 2 variables + 1 device entry = 1 counted device, which the publish path consumes on its own. The return direction is what makes it a two-device case, as documented for DeviceBridge licensing: a one-device entitlement covers 1 counted device, the two-direction arrangement requires 2, so 2 - 1 = 1 and the license is short by exactly one device. Adding a variable added nothing; adding the return direction adds the second device.

Check the allowed device count against the configured device entries in the installed application's licensing information, and read the save and apply diagnostics: a licensing rejection names the device configuration, while the readonly message names an endpoint. Those are different faults with different fixes — an entitlement problem is solved at the license, an endpoint problem at the binding. Confirm that the installed release supports DataLayer writeback in your arrangement with the application supplier before restructuring the configuration or purchasing a license.

What does a working writeback configuration contain? #

Six configured items carry the return path: the recorded outbound baseline, a full-path destination, a bound writeback tag, a type-matched payload connection, a clean apply with diagnostics read, and one observed write result before regular commands run.

  1. Record the working outbound setup first — the DataLayer path, the collector mapping, the MQTT topic and the connector settings — so a change made for the return path cannot silently break the publish path.
  2. Select the destination by its full DataLayer path, for example samples/kvd/implicit_one_level/var2, and only after the node advertises both read and write in a DataLayer browser.
  3. Create the writeback tag inside the collector and bind it to that full path.
  4. Connect the incoming command field to the writeback tag with a matching type: a JSON number into a numeric node, a string only where the node holds a string.
  5. Apply the configuration and read the diagnostics: rejected device entries point at licensing, readonly endpoints point at bindings, conversion failures point at type mismatches.
  6. Send one controlled command, watch the collector's write result, and read the value back in KVD before sending anything else.

Keep command messages off the topic that carries published status; an echoed publication must never be able to act as a command.

Which failure do you have? #

Map the symptom to its boundary before changing anything: silence points at the missing writeback tag, Endpoint var2 is readonly. points at the destination binding or the node's declared operations, and a licensing rejection on apply points at the device count.

  • Publishes correctly, writeback silent — the collector has no writeback tag bound or the payload field was never connected; build the tag route and check the payload extraction first.
  • Write attempted, readonly verdict returned — run the direct-write test on the exact full-path node; a failing direct write means redeclare the node's operations, a passing one means correct the DeviceBridge binding.
  • Configuration rejected on save or apply — compare configured device entries with the allowed count; this arrangement is a two-device case, so obtain the two-device license through official channels.

Once the message arrives, the tag is bound to a writable full-path destination, the direct write passes and the entitlement covers two devices, a single controlled command that changes the value in KVD closes the loop.

Questions asked

Does anything happen when a client writes directly to the DeviceBridge writeback DataLayer endpoint?

No. The WriteBack function does not process direct write operations to that endpoint, so a direct write produces no routed value change and no error from the writeback path itself. The return value has to arrive as a subscribed MQTT message and pass through a configured writeback tag inside the collector logic. That silence is why an enabled function with no writeback tag looks like a dead return path.

How do I create a second writable variable in the Key Value Database app?

The Key Value Database app populates model node instances from ctrlX Data Layer models in YAML format, a file with the yaml extension. Declare the second variable in that model with both read and write operations, load it so the node instance is created, then open the node in a DataLayer browser and confirm both operations are advertised before you bind a writeback tag to it. A node declared without the write operation comes up read-only.

Can a published status value end up written back into the DataLayer?

Yes, if the return route subscribes to a topic that also carries published status. The broker redelivers what the gateway publishes to every subscriber of that topic, so a status update can arrive as if it were a command and be written into the node. Keep the command topic separate from the status topic, and authorize the writeback subscription only on the command topic.

How do I tell a licensing rejection apart from a write rejection?

By when each one appears. A licensing rejection surfaces when the configuration is saved or applied, against the device entries the application counts, and it names the configuration rather than a variable. A write rejection appears at runtime, after a subscribed message is routed, and names the endpoint the write addressed, as the readonly verdict does. Fix entitlement problems at the license, and endpoint problems at the binding or the node's declared operations.

Keep reading

  • Troubleshooting

    Why MQTT Engine writes fail with Bad_NodeIdUnknown

    Bad_NodeIdUnknown on an MQTT Engine tag write is an OPC UA namespace lookup failure at the server executing the write — the node id is not in its address space. It is not a VPN fault: with good edge tags and a live Engine tag, fix the write target's node path, not the transport.

    Edge computing and IIoT

  • Troubleshooting

    Cyclic communication enabled but no Edge connection or key

    An enabled cyclic communication setting is permission, not a connection. Put the Edge endpoint port inside the documented 33333 to 33340 range, prove the service reachable on that port instead of trusting an ICMP ping, then complete the documented key provisioning; commissioned means r4446.17 reads Yes and r4446.0 reads Yes.

    Edge computing and IIoT

  • Explainer

    Edge gateway Modbus TCP polling over the WAN port

    When a data gateway supports MQTT as a client only, drop the broker hop: configure the Modbus TCP poll to target the device's IP address in the same subnet as the gateway's WAN interface. The gateway opens the TCP connection itself, so polled values keep updating with the internet link down. Verify by pulling the uplink and watching one known register.

    Edge computing and IIoT

Why an OPENQUERY historian query fails as a 128-character identifier