User Tools

Site Tools


en-us_products:mp_studio:lcd_screen_editor

MP STUDIO 2 · Displays

MP STUDIO 2 · CLCD Screen Editor

The CLCD Screen Editor lets you lay out the screens shown on an I²C character LCD (CLCD, 20×4 or 16×2) directly on the display in the editor (V1.1.0 and later).

Add a CLCD Show it with CSCR

Figure 1. The CLCD Screen Editor (a screen that shows the motor run time of the bundled example)

Supported LCD Ladder function Version
I²C character LCD, 20×4 or 16×2 CSCR V1.1.0 and later
  • One CSCR function
    A single CSCR function in the ladder shows a screen you made.
  • Automatic value updates
    The value fields on the screen change automatically with the values in the PLC memory.
  • No cursor handling in the ladder
    You do not need to write the cursor position and the characters one by one in the ladder, as you do with the existing CLCD functions (CINI, CLOC, CSTR and so on).

On this page

Opening the Editor

  • Select Settings → CLCD Screen Editor.
  • Press Enter on a CSCR cell in the ladder, or double-click it, to open the editor with that screen open.
  • Click Open screen editor on the CSCR card in the Inspector.
  • If you add a CSCR when there is no CLCD 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 a CLCD

  1. Click + in the CLCD list on the left (or Add CLCD on the starting screen). A CLCD is created with the first unused I²C address (from 0x27), 20×4 and screen 0.
  2. Enter the address of the LCD module in I²C address. You can write it as 0x27, $27, 27h or 39. It must be 1 to 127 and must not be the same as another CLCD.
  3. 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 a CLCD, click Remove this CLCD. Use the color buttons at the top of the window to change the backlight color shown in the editor (green, blue or amber). Click CLCD only to shrink the editor to a small window that shows only the CLCD, so you can see the ladder behind it, and click Full view to return to the full window.

Screen List

You can make several screens for one CLCD. 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 display and type to put fixed text at that position. Enter moves to the next line; text does not continue past the end of a line onto the next line.
  • Delete with Backspace and Delete, and select several positions with Shift+←→.
  • You can use English letters, numbers and symbols (ASCII), half-width katakana, and some symbols in the CLCD font (°, Ω, μ and so on). \ is shown as ¥ and ~ as →.
  • Korean characters are not in the CLCD font. Draw them with 5×8 dots in the Custom characters tab, then insert them with Insert into screen. One CLCD can have up to 8 custom characters, and all screens share them.
  • You can also click a character in the Characters tab to insert it.

Value Fields

A value field is a place on the screen that shows a value from the PLC memory.

  1. 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+Enter places an integer field.
  2. Enter an address or a symbol in Address on the right. Integer and hex fields take a byte, word or double word address (for example D0 or DD2), real fields take an R address, and bit fields take a bit address.
  3. Set the display options you need.
Item Description
Pad with leading zeros If the value is shorter than the width, fills the front with 0 (not for bit fields).
Signed (sign takes one place) Reads an integer field as a signed number. The sign uses one place.
Integer digits · Decimals The number of digits of a real field. Decimals 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 CLCD as a decimal constant (39 for 0x27).
PAGE The number of the screen to show. A constant or a word address can be used.

Figure 2. A rung that shows screen 0 with the always-on contact @ON

  • 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 CINI is not needed either.
  • The output of CSCR turns on when the CLCD 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 CLCD and the first screen. If there is no CLCD, a CLCD with 0x27 (39), 20×4 and screen 0 is created along with it.
  • If you change the address of a CLCD in the editor, each CSCR whose ADR is that address (as a constant) changes with it. A CSCR whose ADR is a variable is left as it is.
  • If you use the existing CLCD functions (CINI, CLOC, CSTR, CINT, CREAL, CHEX, CPUT, CGET, CCLS, CCON, CCOF) with the same address on a CLCD that CSCR uses, the cursor gets out of step and the text is garbled, so the cell turns red and the program cannot be compiled. The backlight functions CLON and CLOF can be used together with CSCR, and the existing functions can be used as before on CLCDs at other addresses.

Simulation

If you open the editor during simulation, the screen that CSCR shows appears on a virtual CLCD, and the value fields show the values the simulator reads (Simulating · screen N at the top). Turn off CLCD responding — CSCR output is on at the bottom to test what happens when the LCD module is unplugged.

Figure 3. The run time counting up after the motor is turned on with P0 in simulation

The existing CLCD functions are not simulated.

Viewing the CLCD on the PLC During Monitoring

If you open the editor while monitoring a real PLC, a small display shows the text the PLC is currently writing to the CLCD (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 PLC 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 from Low (1000 ms), Medium (500 ms) or High (100 ms) (default Medium). 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 PLC), and while the window is open, other values may update more slowly.
  • If you edit a screen during monitoring and the PLC has the same screen, the large display shows the PLC's actual values in the new display format. Your changes reach the PLC only after you download them.

Things to Check

  • If the ADR of a CSCR is not in the CLCD 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 PLC 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.
  • CLCD screens are saved in the project file (.mpx).
en-us_products/mp_studio/lcd_screen_editor.txt · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki