Textual Ladder Logic Notation with Unicode Box-Drawing Characters

By | February 25, 2018

I recently completed a simple PLC project and wanted a way to document the ladder program only using text. Here’s what I came up with for a simple PLC where each program element can be represented with 3 characters:

   ┌001─002─003─004─005─006┐  ┌NOTES───────────────────────────────────────────┐
001├─I1─────────────────∫Q1┤  │Button pushes at I1 toggles light at Q1         │
002├─I2─────────────────∫Q2┤  │Button pushes at I2 toggles light at Q2         │
003├─I3─────────────────∫Q3┤  │Button pushes at I3 toggles light at Q3         │
004├─I4─────────────────∫Q4┤  │Button pushes at I4 toggles light at Q4         │
005├─I5─────────────────∫Q5┤  │Button pushes at I5 toggles light at Q5         │
006├─I6─────────────────∫Q6┤  │Button pushes at I6 toggles light at Q6         │
007├─I2┬────────────────RQ1┤  │Non-I1 button push turns off light at Q1        │
008├─I3┤                   ┤  │                                                │
009├─I4┤                   ┤  │                                                │
010├─I5┤                   ┤  │                                                │
011├─I6┘                   ┤  │                                                │
012├─I1┬────────────────RQ2┤  │Non-I2 button push turns off light at Q2        │
013├─I3┤                   ┤  │                                                │
014├─I4┤                   ┤  │                                                │
015├─I5┤                   ┤  │                                                │
016├─I6┘                   ┤  │                                                │
017├─I1┬────────────────RQ3┤  │Non-I3 button push turns off light at Q3        │
018├─I2┤                   ┤  │                                                │
019├─I4┤                   ┤  │                                                │
020├─I5┤                   ┤  │                                                │
021├─I6┘                   ┤  │                                                │
022├─I1┬────────────────RQ4┤  │Non-I4 button push turns off light at Q4        │
023├─I2┤                   ┤  │                                                │
024├─I3┤                   ┤  │                                                │
025├─I5┤                   ┤  │                                                │
026├─I6┘                   ┤  │                                                │
027├─I1┬────────────────RQ5┤  │Non-I5 button push turns off light at Q5        │
028├─I2┤                   ┤  │                                                │
029├─I3┤                   ┤  │                                                │
030├─I4┤                   ┤  │                                                │
031├─I6┘                   ┤  │                                                │
032├─I1┬────────────────RQ6┤  │Non-I6 button push turns off light at Q6        │
033├─I2┤                   ┤  │                                                │
034├─I3┤                   ┤  │                                                │
035├─I4┤                   ┤  │                                                │
036├─I5┘                   ┤  │                                                │

And here’s an image of what it should look like in case your browser is having trouble rendering the Unicode characters and fixed width font:

Image of Ladder Logic Notation With Unicode Box Drawing Characters

All you need is some type of text editor (I used Google Docs for this) and a monospaced font that implements the unicode box-drawing characters (I used Courier New font which is available pretty much anywhere).

How to use it

  • Line numbers are on the left.
  • Each ladder rung has space for 6 circuit elements, each being represented by 3 or fewer characters. In my example:
    • The letter “I” represents an input, so “I3” is the third input.
    • The letter “Q” represents an output relay, so Q4 is the fourth output relay.
    • The “R” in front of a “Q” represents a reset operation, so “RQ3” means to reset (turn off) relay number 3. In the same way, the integral sign means toggle and an “S” would mean set.
    • This notation mirrors the ladder logic notation in the PLC I used for the project (see below). Use whatever notation works for your situation.
  • If you need more circuit elements per line or more characters to represent each of your elements, simply modify the structure to fit your needs. So for example if you need 8 elements per line, add a -007-008 to the to the top line and adjust the rest of ladder accordingly. If you need 4 characters to represent your circuit elements, add another zero to the numbers in the top line, so 003 would become 0003

How to enter the Unicode characters.

The simplest way to enter the Unicode characters is to simply copy mine from the code block above and paste them into your document.

If you want to enter them yourself, you’ll have to search for “How to enter unicode characters on [Windows10, Mac, Iphone, Chromebook, etc].” It’s different for every platform.

You’ll need the character codes for each element. They are:

  • ─ U+2500 Box Drawings Light Horizontal
  • │ U+2502 Box Drawings Light Vertical
  • ┌ U+250C Box Drawings Light Down and Right
  • ┐ U+2510 Box Drawings Light Down and Left
  • └ U+2514 Box Drawings Light Up and Right
  • ┘ U+2518 Box Drawings Light Up and Left
  • ├ U+251C Box Drawings Light Vertical and Right
  • ┤ U+2524 Box Drawings Light Vertical and Left
  • ┬ U+252C Box Drawings Light Down and Horizontal
  • ┴ U+2534 Box Drawings Light Up and Horizontal
  • ┼ U+253C Box Drawings Light Vertical and Horizontal
  • ∫ U+222B Integral (used to indicate toggle coil, from the mathematical operators block)

To find more symbols that might be useful, check out https://unicode-table.com/en/

A note on fonts

It is important to use a monospaced (means every character has the same width) font like Courier New so that all the text columns will line up. If your columns aren’t lining up properly, it is possible you have chosen a monospaced font that doesn’t implement the box drawing characters. In this case the unimplemented characters might be taken from a different font and will not be the proper size to line up with the other characters


If you find this site helpful, please consider supporting my efforts by clicking My Amazon Affiliate Link and buying whatever you would normally buy or maybe Try Amazon Prime 30-Day Free Trial.