DeltaV talks Modbus well and strings badly. This note is about using the first fact to get around the second: a Modbus interface that can reach **any** parameter in a DeltaV system, not just the ones somebody mapped into a dataset ahead of time.
The idea started as a way to *write* large numbers of setup parameters (the bioreactor case at the end). What I built first, and have run against a live system, is the *read* half: hand it a list of parameter paths and it returns the values, over plain Modbus TCP, with no OPC server anywhere.
## The problem
A Modbus dataset in DeltaV is a fixed map: register 40001 is this parameter, 40002 is that one. That is fine for the hundred values a SCADA polls cyclically. It is useless when the question is "what is the gain on every PID loop in the plant right now", or "do the CRCs in the safety logic solvers match the database". Those are thousands of parameters, read once, and nobody is going to map them.
DeltaV has one feature that breaks the fixed map: the **dynamic reference**. A module can hold a reference whose target path is itself a parameter, written at runtime. Point it at a path and the module sees that parameter's value and status. The problem is getting the path *into* the controller, because the path is a string, and DeltaV has very poor support for strings. Modbus integers, though, are well supported.
## The method
A Modbus master (Python) holds the list of paths. A DeltaV PK controller, acting as the Modbus TCP **server**, runs 16 identical slots. For each slot the master streams the path in as integers, the slot assembles the string, points its dynamic reference at it, and the referenced value appears in an output register. Sixteen slots are a sliding window over an address space of any size.
```mermaid
sequenceDiagram
participant M as Modbus master (Python)
participant S as PK slot (Action + Calc blocks)
M->>S: WIN = START, WSEQ = n
S-->>M: ACK = n (every slot has consumed the word)
loop one 16-bit register per step, two characters
M->>S: WIN = packed codes, WSEQ = n+1
S-->>M: ACK = n+1
end
Note over S: NUL code seen, path complete, dynamic reference pointed at it
S-->>M: BOUND bit (good) or FAILED bit (no such path)
M->>S: read VALUE as float, or VALUE_INT as exact 32-bit integer
```
### Encoding the path
Every character that appears in a DeltaV path fits a 42-symbol alphabet: `A-Z 0-9 _ / . - [ ]` (brackets for raw CHARM I/O references). I measured identifier frequency across a whole-system export and found them 99.8 % uppercase, so paths are folded to uppercase and 42 symbols is all it takes. Each symbol is a 6-bit code, two codes are packed into one 16-bit register (first character in the high byte), code 0 is the end of the path. Two control values on the same register: `0xFFFF` starts a new path, `0xFFFE` clears an unused slot.
Why 16-bit and not 32? Every value in a DeltaV Calc block is a single-precision float. Integers above 2^24 lose bits. Two characters per register keeps the arithmetic exact.
### Streaming, not buffering
The obvious design is a 64-register buffer per slot that the controller walks with an index. DeltaV Calc has no arrays, no `FOR`, no `CASE`, no `MID`, at most six nested `IF`s and 10,000 bytes per block. So the slot holds exactly one input register, `WIN`, plus a shared step counter, `WSEQ`. The master writes all 16 `WIN`s and bumps `WSEQ`; each slot appends two characters and moves on. Finished slots keep acknowledging so the batch stays in step. Nothing is buffered anywhere.
### Two blocks per slot
- **ASSEMBLE** is an Action block, one-shot, enabled by `WSEQ <> WSEEN`. It unpacks the register, maps each code to its character through 42 flat `IF CODE = k THEN CH := "x"` lines (depth one, so the six-layer limit never matters), appends to the path string and, on the terminator, writes the string into the dynamic reference. About 4.8 KB.
- **READ** is a Calc block that runs every scan. It reads the reference's value and status, and runs a settle timer that resolves to **BOUND** (good) or **FAILED** (the path never bound, so it is not a real parameter). About 0.7 KB.
A Manager module fans the 16 slots' status bits into four words and computes `ACK` as the minimum of the slots' step counters. The Calc text for the slot is generated by a script from the alphabet table, so changing the alphabet is a rerun, not an edit.
### Two guarantees
**No dropped characters.** One wrong character is a different parameter or garbage, so the master does not send word n+1 until `ACK` equals n. Taking the minimum across slots means a lagging slot is waited for, never skipped. No sleeps.
**A bad path is reported, not read as stale.** The settle timer either sees the reference bind or declares the slot FAILED, and the master records that row as a bind failure. A row never silently carries the previous value.
### Footprint
Seventeen registers in (16 words and the step counter), 37 out (16 floats, 16 exact integers and five status words). The assembled strings and the references are internal parameters, not Modbus I/O, so the whole interface fits one DST.
### Deliberately slow
Testing showed this wants to run slowly. A dynamic reference takes several seconds to let go of its old target, bind the new one and come up with good status, and pushing words faster than the controller acknowledges them gains nothing. So the master waits for the acknowledge on every word and waits out the settle time on every bind. At roughly two seconds per word and a few seconds per bind, a batch of 16 takes about half a minute and 790 parameters take about 22 minutes. That is the right trade. This is a tool for sweeps, audits and setup, not a cyclic poll.
## What it has done
- A full PID tuning snapshot: gain, reset and rate on every loop in a large system, 2,162 parameters in 50 minutes, every one returned good.
- A safety-system CRC inventory: the live signature CRC of every SIF in every logic solver, 790 values as exact 32-bit integers, for comparison against the CRCs recorded in the configuration export. That is how you prove a logic solver is running what the database says it is, across a whole site, without opening a single module.
- The status mechanism earned its keep on the first pilot, when one module's parameters came back BAD instead of a number.
## Lessons from the DeltaV side
- Single quotes are a parameter reference, double quotes are a string literal. An empty `''` is an empty *reference* and downloads as "Unresolved Parameter". Every literal is double-quoted.
- `HI` and `LO` are reserved alarm words. Use `HIGH` and `LOW`.
- A dynamic reference has to be created as dynamic and seeded with a placeholder path, or the empty reference fails to download.
- Cross-module paths must start with `//`. Without it the reference resolves locally and fails.
- A string can be built by concatenation but never taken apart. Paths go in; string *values* cannot come out. Targets are floats, integers and discretes.
- DeltaV cannot tell you a parameter's type. The reference coerces whatever it points at to its own type, so the type comes from your list, not from the controller. Exact integers need their own 32-bit integer output beside the float.
## The write direction
The same slot writes as well as reads. Once the reference is bound, a value assigned through it lands in the target parameter, the READ block confirms it took, and the slot is cleared for the next target. That makes this a very low-level connection into DeltaV: any parameter in the system, written from Python over Modbus, which is enough to drive any kind of process from outside. The read half is what the jobs so far have needed, and it carries no risk to the process; the write half is where the original idea came from.
The original motivation was writes. Consider bioreactors being prepared for a run. Each might have 200 to 500 parameters when you count alarm limits, discrete settings and timers, and there are several similar lines. With a landing module like this, any computer that speaks Modbus can set every one of them, read each back to verify, and move on, with the recipe held in a database DeltaV cannot talk to (a Flask front end over PostgreSQL, say). The same mechanism would let a device bind itself to I/O based on where it was plugged into the network, with no operator involved: see [[Automatically Bind Equipment based on where it's plugged in to ethernet.]]. It works between sites, too.
## Contact
If you want this on your system, get in touch. DeltaV engineering consultations are available to discuss particular use cases.
**Bruce Schaller, PE**
Control System Integrators, Providence, Rhode Island
[
[email protected]](mailto:
[email protected])
+1 401 441 1557
[controlsysint.com](https://controlsysint.com)