How-to
Exchanging HMI memory data with a custom PC application
Short answer
Yes. The panel is the master and the PC program is the endpoint it polls: set the HMI project to Memory Link, then implement that command set, addressing and framing so every read and write the screen sends gets a valid answer. The exact model's communication manual supplies the frame format and memory areas; nothing else should be guessed.
On this page
Yes, a custom PC application can read and write the memory an HMI terminal displays, and the panel maker documents the way to do it. The screen is the master: it polls the memory areas its objects reference, and your program is the endpoint that answers each request. On terminals of the NS and NT class the mode built for a host-side program is Memory Link, published in the model's communication manual. That manual supplies the frames, the memory areas and the data encodings; this article supplies the method, the tests and the decisions around it.
The screen polls; your program answers #
Every object on the panel — a numeric display, a lamp, a bar graph, an input field — is bound to an address in a memory area. The terminal reads those addresses cyclically to refresh what it shows, and it writes operator entries back to the same kind of addresses. It does not expose the screen as pixels or label text; the exchange is data memory, and only data memory.
That is why the classic trick works: write the program to behave like the controller the panel expects. The panel cannot tell what sits at the other end of the line; it can only tell whether the frames conform. So the PC program is, at heart, a small addressed database plus a frame handler, with one hard rule: every request gets a valid reply inside the communication timeout the project configures.
Pick the method: Memory Link or a PLC driver #
Decide this before writing any code, because it decides what your program must speak. With no PLC in the project, set the panel's communications method to Memory Link: that mode exists precisely so a host computer can be the data endpoint.
| Project situation | Method to set | What the PC program does |
|---|---|---|
| No PLC; the PC is the only data source | Memory Link | Implements the Memory Link command set and answers the panel's polls |
| A real PLC already serves the screen | Keep the PLC driver | Nothing new on the panel; the PC reads and writes the PLC over the PLC's own protocol |
| The PC must sit on the panel's existing PLC link | PLC protocol emulation | Reproduces the full PLC protocol the driver expects — more work than Memory Link, worth avoiding |
The middle row is the one people miss: when a real PLC already serves the screen, the shortest path is the PC reading that PLC directly — a job for which open-source packages such as AdvancedHMI already cover common controllers — leaving the panel untouched.
One distinction keeps this clean: the way a project downloads to the panel and the way the running panel talks to equipment are separate settings, the same separation covered in separating HMI transfer method from PLC driver selection.
And if the real goal is visualization on the PC rather than feeding an existing panel, compare panel PC HMI or PLC plus HMI for meter data display before committing to a custom endpoint.
What the endpoint must implement #
From the manual, your program needs:
- Frame parsing and frame generation exactly as documented: the header, memory area, address, length, data and terminator or check fields that model uses.
- Reads answered out of a served memory map, and writes accepted, stored and acknowledged.
- Replies inside the project's communication timeout, on a listener thread of their own, so database calls or screen updates cannot push an answer past the deadline into an error.
- An address-and-operation list taken from the panel project: each address, its data type (bit or word), and whether operators write it.
- Interface parameters — serial settings, or IP address and port — read from the manual for that model and interface, never inferred from the protocol's name.
Framing is where endpoints like this fail first. PC-side communication libraries live by the same rule, where exact line framing decides whether a reply is recognized at all.
Build the endpoint step by step #
- Identify the exact terminal model and its interface — authoring software differs by line, and Omron's NB series is configured in NB-Designer, a free download from the manufacturer's site — then get that model's communication manual, starting with how to find the right HMI manual for your panel, and read the Memory Link chapter end to end.
- Choose the endpoint's role from the table above; with no PLC in the project, plan for Memory Link.
- In the panel project, set the communications method and the interface that will carry it, and record the interface parameters exactly as the manual states them.
- Build the address-and-operation list: every object's address, data type and direction, with the operator-written entries marked.
- Implement the endpoint around the served memory map, with the dedicated listener thread and a frame log that timestamps everything sent and received.
- Start the PC endpoint first, then download the project to the panel.
- Run the read, write and interruption tests below on test tags only.
- Bind production objects only after both directions pass for every data type on the list.
Worked example: the number the PC must store #
Illustrative example with round numbers. A numeric display object is formatted with two decimal places and must show 40.00. The word behind it holds an integer count, so the endpoint answers with 40.00 × 100 = 4000, which is 0x0FA0 as a 16-bit value (15 × 256 + 10 × 16 = 4000). If the panel shows 4000 instead, the stored word and the object's decimal format disagree: keep the word at 4000 and set the object to two decimals.
The reverse direction: an operator types 12.34 into the input field, and the write must land in your program as 12.34 × 100 = 1234. A near miss such as 123 or 12340 points to the decimal format or the data type, not to delivery. Signed 16-bit values (IEC 61131-3 INT, -32768 to +32767) and single bits are separate tests, and so is encoding: log the frame for one known value and confirm its byte order against the manual before wiring the whole tag list.
Bench tests that prove both directions #
- Read test: put a known value in the endpoint and confirm the object displays it.
- Write test: enter a distinct value through the input object and confirm the endpoint's log records exactly that value at that address.
- Interruption test: stop the endpoint, let the panel raise its communication error, restart the endpoint, and confirm values refresh with no change to the project; a final counter readout proves the catch-up.
- Per-type rule: one read and one write test for each data type on the list — bits, unsigned words, signed words — before production tags go in.
Run the write tests on the bench with the machine disconnected: a write that lands in the wrong word travels straight into whatever the machine acts on.
When values go stale or wrong #
| Observation | Where the fault lives | Next check |
|---|---|---|
| No request reaches the PC | Transport or panel communications setup | Interface selection, wiring, and whether serial or port settings match the project |
| Requests arrive but the panel errors or shows stale data | Protocol handling | Reply framing and encoding against the manual, and reply time against the timeout |
| Everything else works, one object is wrong | Object binding | That object's address, data type and decimal format |
| Values freeze only when the PC is busy | Timing | Move the listener off the UI thread; the reply is arriving after the timeout |
The frame log is the instrument here: it shows which side of the boundary the failure sits on before you touch a single tag.
Questions asked
Does the PC poll the touchscreen, or does the touchscreen poll the PC?
The terminal polls; your program answers. Every exchange starts as a request from the screen, so an unsolicited push from the PC has nowhere to land. If the application needs to send a new value, it updates the value in its own memory and the next poll carries it to the display.
Can one PC program serve several panels?
Yes, when each panel gets its own transport or connection and its own answered session. The panels do not coordinate with one another, so serve each independently, and give each its own memory map unless you deliberately want several screens mirroring the same values.
Is Memory Link compatible with a Modbus library?
No. Memory Link is the terminal maker's own protocol, with its own framing, addressing and command set, so a Modbus master or slave routine will not answer it. Using Modbus instead means choosing a panel and communications method that document Modbus as the supported option.
Why does the screen show a communication error as soon as my program stops?
That is expected behavior, not a project fault: the panel polls continuously, and when nothing answers within its timeout it raises the error while objects hold their last values. Restart the endpoint and confirm the displays refresh without changing anything in the panel project.
How do I confirm an operator's entry reached the PC?
Write a distinct test value through an input object; 12.34 on a two-decimal field should arrive as the count 1234. Check the endpoint's log for that exact number at that address. A near-match points to scaling or data type, not to delivery.