Table of Contents
MP STUDIO 2 · LCD Screen Editor
The LCD Screen Editor lets you lay out the screens shown on an I²C character LCD (20×4 or 16×2) directly on the character display (V1.1.0 and later). A single CSCR function in the ladder shows a screen you made, and the value fields on the screen change automatically with the values in the device memory. You do not need to write the cursor position and the characters one by one in the ladder, as you do with the existing LCD functions (CINI, CLOC, CSTR and so on).
Opening the Editor
- Select Setting → LCD Screen Editor.
- Press
Enteron aCSCRcell in the ladder, or double-click it, to open the editor with that screen open. - Click Open screen editor on the
CSCRcard in the Inspector. - If you add a
CSCRwhen there is no LCD yet, the editor opens automatically.
The editor has no OK or Cancel button. Your changes are applied to the project right away, and you can undo or redo them with Ctrl+Z and Ctrl+Y. To keep them in the file, save the project (Ctrl+S). Close the window with ✕ or Esc.
Adding an LCD
- Click + in the LCD list on the left (or Add LCD on the starting screen). An LCD is created with the first unused I²C address (from 0x27), 20×4 and screen 0.
- Enter the address of the LCD module in I²C address. You can write it as
0x27,$27,27hor39. It must be 1 to 127 and must not be the same as another LCD. - Choose the size, 20×4 or 16×2. If you make the size smaller, you are first asked to confirm that the characters and value fields that no longer fit will be deleted.
To delete an LCD, click Remove this LCD. Use the color buttons at the top of the window to change the glass color shown in the editor (green, blue or amber), and click LCD only to show only the large glass.
Screen List
You can make several screens for one LCD. In Screens, + adds a screen, ⧉ duplicates it and − deletes it. Screens have no names and are identified by number (0 to 255). You can change the number of the selected screen in Screen number at the top. Press PageUp and PageDown to move to the previous and next screen.
Writing Text
- Click the glass (the character display) and type to put fixed text at that position.
Entermoves to the next line; text does not continue past the end of a line onto the next line. - Delete with
BackspaceandDelete, and select several positions withShift+←→. - You can use English letters, numbers and symbols (ASCII), half-width katakana, and some symbols in the LCD font (°, Ω, μ and so on).
\is shown as ¥ and~as →. - Korean characters are not in the LCD font. Draw them with 5×8 dots in the User characters tab, then insert them with Insert into screen. One LCD can have up to 8 user characters, and all screens share them.
- You can also click a character in the Character table tab to insert it.
Value Fields
A value field is a place on the screen that shows a value from the device memory.
- On one line, drag across the positions where the value should appear, then click one of Integer, Real, Hex or Bit in Add value field at the top. If you click without selecting, a field of the default width is placed at the cursor.
Ctrl+Enterplaces an integer field. - Enter an address or a symbol in Source on the right. Integer and hex fields take a byte, word or double word address (for example
D0orDD2), real fields take anRaddress, and bit fields take a bit address. - Set the display options you need.
| Item | Description |
|---|---|
| Fill unused places with 0 | If the value is shorter than the width, fills the front with 0 (not for bit fields). |
| Read as signed (+/− uses one place) | Reads an integer field as a signed number. The sign uses one place. |
| Integer digits · Decimal places | The number of digits of a real field. Decimal places are 0 to 5, and extra digits are cut off, not rounded. |
| ON text · OFF text | The text shown in a bit field when it is on or off (default ON and OFF). |
If a value does not fit in the width, the whole field is shown as #. Drag a value field to move it, and drag its right end to change the width (Alt+arrow keys to move, Alt+Shift+←→ to change the width). Delete it with Delete value field. In the editor, value fields are shown as placeholders filled with 0.
Figure 1 is a screen made for the ladder of the bundled example (D0 seconds, D1 minutes, D2 hours, motor output P32). D2, D1 and D0 are placed on the second line as zero-filled integer fields, and P32 on the third line as a bit field.
Showing a Screen from the Ladder (CSCR)
Screens are shown with the CSCR function. Choose CSCR: Show Screen in the CLCD (Character LCD) category of the Functions panel, or type CSCR 39 0 in the Insert Function window (Ctrl+E).
| Argument | Description |
|---|---|
| ADR | The I²C address of the LCD as a decimal constant (39 for 0x27). |
| PAGE | The number of the screen to show. A constant or a word address can be used. |
- The screen is shown while the rung is on. When the rung turns off, the last screen stays and its values keep changing. You do not need to call it with a pulse, and
CINIis not needed either. - The output of
CSCRturns on when the LCD responds. - If you use a word address (for example
D20) for PAGE, you can change screens by changing that value. - When you add a
CSCR, ADR and PAGE are filled in with the first LCD and the first screen. If there is no LCD, an LCD with 0x27 (39), 20×4 and screen 0 is created along with it. - If you change the address of an LCD in the editor, each
CSCRwhose ADR is that address (as a constant) changes with it. ACSCRwhose ADR is a variable is left as it is. - If you use the existing LCD functions (
CINI,CLOC,CSTR,CINT,CREAL,CHEX,CPUT,CGET,CCLS,CCON,CCOF) with the same address on an LCD thatCSCRuses, the cursor gets out of step and the text is garbled, so the cell turns red and the program cannot be compiled. The backlight functionsCLONandCLOFcan be used together withCSCR, and the existing functions can be used as before on LCDs at other addresses.
Simulation
If you open the editor during simulation, the screen that CSCR shows appears on a virtual LCD, and the value fields show the values the simulator reads (Simulating · Screen N at the top). Turn off LCD responding — CSCR output is on at the bottom to test what happens when the LCD module is unplugged.
The existing LCD functions are not simulated.
Viewing the Device LCD During Monitoring
If you open the editor while monitoring a real device, a small glass shows the text the device is currently writing to the LCD (PLC display · Screen N, read only). Click Go to that screen to switch the editor to that screen.
- It is shown only when the program on the device is confirmed to be the same as this project. Otherwise the reason is shown in gray, such as “Different program on PLC”.
- Choose the read interval in Refresh: Low (1000 ms), Medium (500 ms, default) or High (100 ms). The actual interval (“Actual N s”) is shown next to it. Depending on the connection, High does not reach 0.1 seconds (about 0.2 seconds on a real device), and while the window is open, other values may update more slowly.
- If you edit a screen during monitoring and the device has the same screen, the large glass shows the device's actual values in the new display format. Your changes reach the device only after you download them.
Things to Check
- If the ADR of a
CSCRis not in the LCD list, or its PAGE is not in the screen list, the cell turns red and the program cannot be compiled. - Problems are listed at the bottom of the editor. Click one to go to that place. If there are no problems, No problems is shown.
- If the device does not have enough RAM, the program cannot be compiled. Check the remaining RAM in “N bytes of RAM free” at the bottom of the editor.
- LCD screens are saved in the project file (
.mpx).



