Memory Map Editor — User Guide
Design the memory map of a PLC or a microcontroller device by device and block by block, keep an eye on the capacity as you go, and produce the specification, the paste-ready lists for your PLC software and the source code from that one set of data.
1. Overview
Control design starts by deciding which signal is assigned to which device (address). The Memory Map Editor keeps that assignment table in two levels — a “device / node” and the “blocks (modules)” inside it — and continuously checks that you stay inside the device limits of the PLC model you selected.
It runs entirely in the browser, with no external libraries and no server. What you type is saved automatically inside the browser on this machine only, and is never sent anywhere.
2. Tutorial (building your first map)
- Pick a vendor and a model in “PLC setup…”. The device ranges (for example
D0–D12287 on a Mitsubishi Q series) and the way the numbers advance (decimal or hexadecimal) are filled in for you.
- You can start typing straight into the table — the default container is “Unclassified”. To split the map by machine or by unit, add devices and blocks with “+ Add” at the top of the tree on the left (or by right-clicking), or receive the structure from the System Diagram Editor. You can also tidy up later with “Group the selected rows into a new block”.
- Type the names directly into the table. As in Excel, Enter confirms and moves down and Tab moves right; typing in the “+ New variable” row at the bottom adds a row (the type and the direction are carried over from the row above). Lists from Excel and device comments from a PLC go into “Import…”.
- “Assign addresses…” (Ctrl+R) fills everything in at once: BOOLs into M devices, numeric types into D devices, and so on.
- Check the usage of each device on the “Usage” tab at the right. Anything over the limit turns red and is listed in the checks.
- “Copy by device…” builds a list per device and pastes straight into GX Works and the like.
3. Devices and blocks
The tree on the left has three levels: project → device → block. A device is a coarse unit such as a panel, a robot or a conveyor; a block is a functional unit inside it — command, status, parameters and so on. Clicking an entry shows only the variables in that scope, and selecting a device or the whole project inserts a heading row for each block.
Blocks can be dragged onto another device in the tree. Drag a block onto a column of the ① diagram (M, D and so on) to reserve its range from the address where you drop it. The size is 16 points (10 words on word devices); if the block already has a range in that column, it keeps its size and only moves. While you drag, the planned range is shown faintly on the column, and spots that overlap other blocks turn red and cannot be used. Select variable rows, then drag them by the row number onto a block in the tree to move just those variables. Each row of the tree shows the device range it occupies (for example D100–D131 / M0–M15), in red when it exceeds the limit.
① Reserve ranges and ② Assign addresses: a memory map is built in two steps. With the project or a device selected in the tree (① Reserve ranges), decide the device range each block uses (e.g. M0–M15, D100–D109). With a block selected (② Assign addresses), decide each variable’s address inside the reserved ranges. Blocks whose ranges are not decided yet are shown as “Not reserved”.
4. PLC model and device ranges
“PLC setup…” offers Mitsubishi Electric (MELSEC-Q / iQ-R / iQ-F), OMRON (NJ / NX), KEYENCE (KV-8000), Siemens (S7-1500 / S7-1200), a microcontroller (byte addressing) and IEC 61131-3 (%M). Choosing one fills the table with the devices available on that model — code, name, style, radix and range.
When a machine has several PLCs, there is one memory map per PLC. Press “To Memory Map” in the system diagram and choose a PLC to get that PLC’s map; switch between them with the PLC name button at the top. For signals exchanged between PLCs, right-click the other PLC’s device and use “Check against the memory map of …” to find differences, and “Copy missing variables” to copy them with inputs and outputs swapped (addresses are not copied).
Every value in that table can be edited. If you changed the number of device points in the CPU parameters, or your design rules limit the usable range, simply rewrite the range; the change is saved with the project JSON. The style of a device is bit (one point per bit, such as M0), word (16 bits per point, such as D0), ch.bit (the KEYENCE convention, where R100 is bit 0 of channel 1) or byte (microcontroller).
5. Reserving an area and building the rows (Ctrl+B)
When you already know the range you want to hold, reserving an area is the quick route. Give it a device, a type, a start address and a number of points (or an end address), and all of those rows are created at once, as a table with the addresses already filled in. There is no need to press “Add” one row at a time.
- Each type gets its own area. Reserving “BOOL in M0–M255” and “WORD in D100–D163” separately keeps the two in separate blocks, so BOOLs and WORDs never end up mixed in one column.
- When reserving BOOLs inside a word device, tick “Split each word into 16 bits” and you get the 16 rows
D200.0–D200.F.
- The names can be the address itself, a prefix plus a sequence number, or left empty.
- Adding a row at the end of an area continues the addresses automatically — the same happens when a paste adds rows.
A reserved area appears in the tree as, for example, M area (BOOL) M0–M255 (BOOL), and the heading row of the table shows “Reserved: …”. Asking for more than the limit is reported as an error.
6. Pouring in data from Excel or a specification
To fill a reserved area, paste the table from Excel or from your specification as it is.
- Pasting a single column: select the first name cell and press Ctrl+V. The cells are filled from the top down (addresses are left alone). If there are not enough rows they are added, and inside an area the following addresses are filled in too.
- Pasting devices with comments: paste a table that contains devices, such as
M0 Start request, and the rows with the matching addresses are overwritten. Only genuinely new addresses are added as new rows.
- Pasting a table with a header: with a header row such as name, type, direction, address, initial value and comment, the columns are recognised whatever their order. The “Import…” dialog works the same way and also offers “Overwrite rows that already use the same address”.
7. Assigning addresses (new, shift, relocate)
Everything to do with addresses lives in one dialog: “Assign addresses…” (Ctrl+R). Pick the method at the top.
- Assign from scratch: choose the target (the selected block, the selected rows, only variables without an address, or all of them) and a destination device for BOOLs and for numeric types, and they are numbered in order. The default start is “after what is already used on that device”; tick the option to fill earlier gaps instead.
- Change only the start address (bulk shift): the order inside the block is kept and only the first address moves.
- Relocate a whole block to another device: the variables of a block are packed again into free space on another device. “Find free space” fills in the first free address.
Pressing Ctrl+D in the table copies the cell above; in the address column it continues the addresses instead, which is handy for filling a few rows quickly. Keeping 32-bit and wider types on their natural boundary means no padding is inserted when the map is turned into a C struct, so it matches the real memory.
8. Watching the usage, and not running out
The “Usage” tab on the right shows a gauge per device area. Above 70% it turns yellow, over the limit it turns red, and underneath it lists the blocks that use that device. Drag a block chip onto the gauge of another device and all of that block's variables move into free space there. An address typed by hand beyond the limit, or an automatic assignment that does not fit, is reported as an error and the assignment is not carried out.
9. Importing from a PLC
“Import…” accepts an Excel table with a header row, and also the device comments exported by PLC programming tools as they are: GX Works2 / GX Works3 (the "D100","Start request" form), KV STUDIO, and the variable tables of Sysmac Studio / CX-Programmer (Name, Data Type, AT, Comment). If the first column looks like a device the format is detected automatically, and the type is filled in from the device style (bit device = BOOL, word device = WORD). The block to import into is chosen at the top of the dialog.
10. Copy by device, and exports
“Copy by device…” builds a list per device area, sorted by address — D devices, M devices and so on. The format can be device comments, global labels or a detailed list, and one click copies it as TSV, ready to paste into the device comment editor or the label editor of GX Works. Everything else you can export lives in one place: “Output → Export…” (Ctrl+E). Pick Markdown (with a chapter per device and block and a usage summary), CSV, TSV or JSON — each says where it is meant to be pasted — and press “Copy to clipboard” or “Save to a file”. Importing is gathered the same way under “File → Import…”.
11. Code generation
“Generate code…” (Ctrl+G) produces three formats. The C / C++ struct header builds one struct per device and block, turns gaps into reserved members and packs BOOLs into bit-fields (with #pragma pack(push,1) and a size assertion). The C address definitions are a light #define list of addresses and bits. The IEC 61131-3 global variables come out as VAR_GLOBAL … END_VAR, with a comment separating each device and block.
12. Keyboard shortcuts
13. Working with the other tools
This is the second of the four design tools. The buttons at the right of the toolbar carry your data backwards and forwards.
- System Diagram Editor: decide the devices, blocks and networks (“← System Diagram” opens it and hands over the devices and blocks of this list)
- Memory Map Editor (this tool): assign the variables and addresses
- Timing Chart Editor: decide how the variables move in time and what causes what (“To Timing Chart →”; with rows selected, only those variables are handed over)
- Flowchart Editor: turn the cause-and-effect relations into program flow
The JSON you save uses the schema shared by all four tools (devices / variables / triggers). Devices and blocks received from the system diagram are ready to be used as containers for variables, and the variables you already have are not touched. Working flat, without any hierarchy, is perfectly fine — the default container is “Unclassified”.
For the thinking behind this kind of drawing — what belongs on one sheet and the pitfalls seen on site — see the guide How to build a PLC memory map (in Japanese). All four editors are listed on the FA Spec Tools home page.
Please send bug reports and feature requests to yk.builds.space@gmail.com. Steps to reproduce the problem — and, if you can, the saved JSON file — make it much quicker to look into.