Table of Contents

MP STUDIO 2 · 7-Segment Display

MP STUDIO 2 offers two ways to show values and characters on a 7-segment display (FND): a 4-digit or 6-digit 7-segment LED module built on the TM1637 chip.

On the same glass, the editor shows a virtual 7-segment display during simulation and the characters the device sent to the chip during monitoring (V1.3.0 and later). For the module types you can use (clock type and decimal-point type) and photos of the modules, see the 7-Segment LED Guide.

Figure 1. The 7-Segment Screen Editor (fixed characters Er and an error code value field placed on screen 1)

Two Ways to Display

Figure 2. What the ladder, the device and the 7-segment display exchange in box mode and screen mode

Item Box mode (FINI·FINT·FDATA) Screen mode (FSCR)
What sets the content Function arguments in the ladder (digit, number of digits, dot) 7-Segment Screen Editor (fixed characters, value fields)
When the chip is written Every digit is rewritten on every scan while the rung is on. Only the changed digits are sent, one digit per scan. All digits and the brightness are re-sent about once a second.
When the rung turns off Nothing is sent, so the chip keeps showing its last characters. The last screen stays, and its value fields keep updating.
Values that can be shown Decimal integers (lower 4 digits), segment values Decimal (sign, decimal point), hex, bit text, fixed characters
Values with too many digits Only the lower digits are shown (12345 → 2345). The whole value field is shown as bars, so a cut-off number is never shown.
6-digit modules Written in chip address order only. Digit order matches the visible digits to the chip addresses.
Brightness Fixed at 7 (maximum) 0 to 7 for each display
7-segment response (ACK) Not read. No error occurs even if no module is connected. Read on some models; a missing response is reported through the FSCR output and as No response in the editor.

Each 7-segment display can use only one of the two modes. If you use box mode functions and FSCR on the same 7-segment display, the box mode cells turn red and the program cannot be compiled (see Checks and Warnings).

Supported Products and Connections

The terminals for the 7-segment display and the values to enter for the CLK and DIO arguments of FINI depend on the model. See the product pages in the table for the terminal locations and connector diagrams.

Model 7-segment terminals CLK·DIO of FINI / Pins in the editor 7-segment displays you can connect Cannot be used together
MPS-8A4R(T)-S · MPS-8A8R(T)-S · MPS-16A16R(T) FND / ENCO connector CLK(A), DIO(B) — MPS-8A4R-S · MPS-8A4T-S · MPS-8A8R-S · MPS-8A8T-S · MPS-16A16R The terminals are fixed. FINI accepts only 0 or 1, and the value is not used. 1 High-speed input channel 0 (encoder) on the same connector
MPA series UART (channel 3) terminals — connect CLK to RXD and DIO to TXD — MPA Series The terminals are fixed. The argument values of FINI are not used. 1 Serial 3 communication
MPS-8A8R PWM output terminals PWM0 to PWM5 — MPS-8A8R PWM terminal number 0 to 5 (0 = PWM0) 1 per CLK/DIO pair (up to 3) PWM output on the same terminals
MPS-16A8R8T PWM output terminals PWM0, PWM1, PWM3 and PWM4 — MPS-16A8R8T PWM terminal number 0, 1, 3 or 4 1 per CLK/DIO pair (up to 2) PWM output on the same terminals
MPS-16A8R(T) Analog input terminals AI0 to AI3 — MPS-16A8R AI terminal number 0 to 3 (0 = AI0) 1 in box mode · 2 in screen mode, with no shared pins Analog input on the same terminals
MPS-16A8R(T)-R2 7-segment displays cannot be used. — — —

On MPS-16A8R(T), the 7-segment display works from V1.3.0 (in earlier versions, the device did not output the 7-segment signals).

Box Mode (FINI·FINT·FDATA)

Box mode writes directly to the 7-segment display with FINI, FINT and FDATA in the 7Segment category of the Functions panel. The chip is written on every scan in which the rung containing the function is on, and nothing is sent while the rung is off. The chip holds the characters it received, so the last characters stay on the display after the rung turns off.

Function Arguments What it does
FINI CLK, DIO Switches on the 7-segment display (brightness 7) and clears digits 1 to 4. Digits 5 and 6 are not cleared.
FINT IN, POSITION, LENGTH, DOT, ZERO, SIGN Shows an integer in decimal.
FDATA DATA, POSITION Shows a one-byte segment value as is in one digit.

When FINT or FDATA runs normally, power continues to the right of the function. If an argument is invalid and nothing can be shown, the power to the right is cut.

Figure 3. Rungs that switch on the 7-segment display with FINI, show D0 with FINT and show fixed characters with FDATA

FINI

Digit Positions and Chip Addresses

POSITION (POS) is the chip address plus 1. On a 4-digit module, the chip addresses usually run from 0 to 3 starting at the left, so POS 1 is the leftmost digit and POS 4 is the rightmost. On 6-digit modules, the order of the digits and chip addresses varies by product, so in box mode, check that each character appears in the digit you want.

Figure 4. POS numbers and chip addresses in box mode

FINT

Argument Value Description
IN Byte, word or double word address, or a constant The value to show. Only the lower 4 digits are shown.
POSITION 1 to 6 The POS of the ones digit. The tens, hundreds and thousands digits continue to its left.
LENGTH 1 to 4 The number of digits to show. If it is 0, nothing is shown.
DOT 0 to 4 Where to put the dot. The dot goes after the 1st to 4th digit, counted from the left of a 4-digit frame (4 = the ones digit); 0 means no dot. It does not depend on POSITION or LENGTH.
ZERO TRUE, FALSE or a bit address When on, empty leading digits are filled with 0. When off, leading zeros are left blank.
SIGN TRUE, FALSE or a bit address When on, the value is read as a signed number, and the digit to the left of the number shows - for a negative value or a blank for a positive one.

Figure 5. What a 4-digit module shows with different FINT arguments

FDATA

FDATA writes the low byte of DATA as is to the digit at POSITION (1 to 4). Bits 0 to 6 are segments a to g, and bit 7 is the dot. Use it for shapes other than numbers and letters, or to switch individual segments on and off directly.

Figure 6. Segment names and DATA bits

Character 0 1 2 3 4 5 6 7 8 9 - Blank
DATA 16#3F 16#06 16#5B 16#4F 16#66 16#6D 16#7D 16#07 16#7F 16#6F 16#40 16#00

You can write DATA in any of these forms: 16#3F (hex), 63 (decimal) or 2#00111111 (binary). You can make the values for other characters in the Character table of the 7-Segment Screen Editor. To light the dot as well, add 16#80 to the value (for example, 1. = 16#86).

7-Segment Screen Editor

The 7-Segment Screen Editor is a window for laying out what the 7-segment display shows, on a glass shaped like the real module (V1.3.0 and later). Screens you make are shown with the FSCR function in the ladder.

Opening the Editor

Figure 7. Show 7-segment display in the right-click menu of an FINT cell

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). You can keep editing the ladder while the editor is open. Close the window with ✕ or Esc.

Editor Layout

Figure 8. Parts of the 7-Segment Screen Editor

Adding a 7-Segment Display

  1. Click + in 7-Segment Display on the left (or Add 7-segment display on the starting screen). A display is created with the lowest unused number, 4 digits, digit order 0,1,2,3, brightness 7 and screen 0.
  2. Set the properties in the table below to match the 7-segment module and its wiring.

Figure 9. Display properties

Property Description
① Display no. 1 to 8. The number you enter in DSP of FSCR. You can make up to 8 displays.
② Digits 4 digits or 6 digits
③ Digit order The chip address of each visible digit, from the left. Choose 0,1,2,3, 0,1,2,3,4,5 or 2,1,0,5,4,3 · common 6-digit module, or choose Custom and enter 0 to 5 in Chip addresses, separated by commas.
④ Pins Enter the CLK and DIO numbers here on MPS-8A8R, MPS-16A8R8T and MPS-16A8R(T). Usable pins are listed below the field. On models with fixed terminals, This model has fixed 7-segment pins, so only one display can be attached. is shown instead.
⑤ Brightness 0 to 7 (7 is the brightest)
⑥ Look Dot or Colon. Colon draws the dot of the second digit as a colon between two digits, as on a clock-type module. The values sent to the device are the same; only the drawing in the editor and in simulation changes.

Click Remove this 7-segment display to delete the selected display. Each entry in the display list also shows its number of digits and screens.

If characters appear scrambled on a 6-digit module, the digit order does not match the module. Many common 6-digit modules are wired with the chip addresses in the order 2,1,0,5,4,3. The digit order is shown below the editor glass as chip N.

Figure 10. Visible digits and chip addresses of a 6-digit module with digit order 2,1,0,5,4,3

Screen List

You can make several screens for one display. In Screens, + adds a screen, ⧉ duplicates it and − deletes it. Screens are identified by number (0 to 255), and you can change the number of the selected screen in Screen number above the glass. One display can have up to 255 screens. Press PgUp and PgDn to move to the previous and next screen.

Figure 11. A screen list with two screens

The small glass in the list shows each screen with its preview values. During simulation or monitoring, the number of the screen currently on the 7-segment display is shown in green.

Writing Fixed Characters

Click a digit on the glass and type a character to put a fixed character (fixed segments) in that digit. The cursor then moves one digit to the right.

The Segment painter tab edits the fixed segments of the selected digit segment by segment.

Figure 12. The Segment painter tab

You cannot write fixed characters in a digit that has a value field. In such a digit, only the dot of the fixed segments lights up along with the value. Use this to light the colon of a clock-type module, or a fixed decimal point, together with a value field.

Value Fields

A value field is a place on the display that shows a value from the device memory.

  1. Click the digit on the glass where the value should start.
  2. Click Dec, Hex or Bit text in Add value field above the glass. A value field of the default width (4 digits for decimal, 2 for hex and 3 for bit text, or fewer if fewer digits remain) is placed starting at the selected digit. Ctrl+Enter places a decimal value field.
  3. Enter an address or a symbol in Source on the Value field tab on the right. Dec and Hex take a byte, word or double word address (for example D10 or DD20), and Bit text takes a bit address (for example M5).
  4. Set the options you need.

Figure 13. Properties of a decimal value field

Property Description
① Display format Switches between Dec, Hex and Bit text.
② Source The address or symbol to show. When you type a symbol name, you can pick it from a list.
③ Start digit · Width The first digit of the value field (1 = leftmost) and its number of digits.
④ Sign (a - inside the width for negatives) Decimal. Reads the value as a signed number and, for a negative value, writes - in one digit within the width. The width must be 2 digits or more.
⑤ Fill leading digits with 0 Decimal and hex. If the value is shorter than the width, fills the front with 0. On by default for hex.
⑥ Decimal places Decimal. Puts a dot this many digits from the right (value 1234 with 2 decimal places → 12.34). The digit with the dot and the digits to its right are shown even when they are 0 (value 5 → 0.05).
On text · Off text Bit text. The characters shown when the bit is on or off. The defaults are the shapes On and OFF, which appear as 0n and 0FF in the text box (O and 0 look the same on a 7-segment display). You can also enter segment values in hex in the box on the right.
⑦ Preview values The values drawn on the editor glass. They are not saved in the project and do not affect the device.

Figure 14. What a 4-digit module shows for each value field type and option

Value fields on this screen below the glass lists the value fields on the screen with their type, source, digit and width. Click a row to select that value field. The bottom row, At most ≈ 60 µs per scan · N scans when the whole screen changes, shows the longest time screen mode adds to a scan and how many scans it takes to show the whole screen when every digit changes. With two or more displays, the displays take turns sending, so the number of scans grows accordingly.

Making Values in the Character Table

The Character table tab is a tool for making the value of one 7-segment digit by clicking segments. It does not change the screen you are editing. Use the buttons at the bottom to choose where the value goes.

Figure 15. The Character table tab

Ctrl+Enter puts the value into the DATA cell of FDATA if that cell is selected, and otherwise into the fixed segments of the selected digit. You can undo either with Ctrl+Z.

7-Segment Only View

Click 7-segment only at the top of the window to turn the editor into a small window with only the glass. Use it to watch the 7-segment display during simulation or monitoring while you look at the ladder. Click Full view to return to the full window.

Figure 16. The 7-segment only view

Showing a Screen from the Ladder (FSCR)

Screens are shown with the FSCR function (V1.3.0 and later). Choose FSCR: Show Screen in the 7Segment category of the Functions panel, or type FSCR 1 0 in the Insert Function window (Ctrl+E).

Argument Description
DSP The 7-segment display number (1 to 8). Only a constant can be used.
PAGE The number of the screen to show (0 to 255). A constant or a word address can be used.

Figure 17. The list for picking a screen, shown when you edit the PAGE cell of FSCR

Figure 18. Rungs that switch between screen 0 and screen 1 according to P0

Viewing in Simulation

If you open the 7-Segment Screen Editor during simulation, the glass shows the characters the simulator sent to the 7-segment display (V1.3.0 and later). Both screen mode and box mode are simulated. For how to start and stop simulation, see Phase 8 · Simulation.

Figure 19. The 7-Segment Screen Editor during simulation

At first, the editor follows the screen that is on the 7-segment display. If you select another screen, it stops following, and 7-segment display N is now showing screen M. It differs from screen K, which you are editing. appears below the glass along with Go to that screen. Click Go to that screen to follow the screen on the display again.

Figure 20. Editing a screen other than the one on the display

When simulation is off, a Start simulation button appears below the glass.

Simulating Box Mode

The 7-segment displays that FINI, FINT and FDATA write to are listed under Box mode (FINI·FINT·FDATA) in the list on the left. Select an entry to show that 7-segment display on the glass in the center (read only). Click a character on the glass to copy its shape to the Character table.

Figure 21. Simulating a box mode 7-segment display

Viewing the Device 7-Segment Display During Monitoring

If you open the 7-Segment Screen Editor while monitoring a real device, the glass shows the characters the device sent to the 7-segment display (V1.3.0 and later). The status chip shows PLC display · Screen N, and From the 7-segment shadow in device RAM — exactly what was sent to the chip appears below the glass.

Figure 22. The editor showing the device 7-segment display during monitoring

Figure 23. Value fields edited during monitoring

Display Status and Reasons

Figure 24. Status marks in the display list

Status Meaning
On The 7-segment display is on and showing a screen.
Off The 7-segment display has not been switched on yet.
No response The 7-segment display is not responding. The device looks for it again about once a second. Check the connection and wiring of the module.
Lines not ready The device has not set up the 7-segment signal lines yet.
Different program on PLC The program on the device is different from this project. Download the project to show the display.
PLC program unknown There is no record of downloading this project over the current connection. Download the project to show the display.
Checking device program MP STUDIO 2 is checking whether the program on the device is the same as this project.
TX buffer too small · not read The TX buffer of the active serial port is smaller than 10 bytes. Increase the SERIAL value in Setting → Data Memory to 10 or more.
Keeps changing · cannot read consistently The display keeps changing while it is being read, so the characters read in two parts cannot be matched up. Turn on Merge monitor reads in Setting → Communication Port, and increase the TX buffer of the serial port to 14 bytes or more.
PLC not answering · unknown The PLC is not responding to monitoring.
No new value · unknown Monitoring continues, but no new 7-segment values arrive.
Not switched on yet · display unknown The device program has started but has not switched on the 7-segment display yet.
Shadow values look wrong The values read from the device are not in the form of a 7-segment record. The device may contain a different program.
Several 7-segment pin pairs The box mode 7-segment display is not shown because there are two or more FINI with different pins.

MPS-8A8R and MPS-16A8R8T do not read the response from the 7-segment display, so No response is never shown. Instead, This model does not read the chip response (ACK), so a disconnected chip cannot be detected — the screen is re-sent every second. appears below the glass.

Checks and Warnings

Ladder Cells

If there is a problem with a 7-segment cell, the cell turns red (the program cannot be compiled) or its address turns orange (a warning; the program can still be compiled). Hover over the cell to see the reason. When you select the cell, the Inspector shows the same reason.

Figure 25. An FINT cell with LENGTH set to 0, and the warning in the Inspector

Case Shown in Reason shown on the cell (beginning)
LENGTH of FINT is 0 Orange FINT LEN 0 reads as 0, so FINT always takes its error path …
POSITION of FINT is outside 1 to 6, or POSITION of FDATA is outside 1 to 4 Orange FINT POS … / FDATA POS … is a value the device does not accept, so it takes the error path …
With the POSITION, LENGTH and SIGN of FINT, the number or sign goes past the left end Orange FINT POS … with LEN …: … / FINT SIGN is on, which needs one more cell to the left of the digits for the sign …
FINT or FDATA is used without FINI on a model that needs FINI Orange FINT is used but the program has no FINI. …
FINI and serial 3 communication are used together on the MPA series Orange When this FINI runs, serial 3 communication is switched off. …
CLK or DIO of FINI is a number that cannot be used on the model Red The numbers that can be used are shown with it.
FSCR is used when no 7-segment screens exist Red No 7-segment screens are defined, so FSCR has nothing to show.
DSP or PAGE of FSCR is not in the table Red The DSP value … of FSCR is not in the 7-segment table. … / The PAGE value … of FSCR is not in the screen list of 7-segment display ….
A second display is called on a model with fixed terminals Red This model can drive only one 7-segment display, so display … cannot be used. …
Box mode functions are used on a 7-segment display that FSCR draws Red This 7-segment display is drawn by a screen (FSCR) — remove FINI. … / … move the … value into a field of the screen.
The definition of the display that FSCR calls has a problem Red The same text as in the problem list of the editor

Figure 26. An FSCR cell with a PAGE that is not in the screen list, and the reason in the Inspector

Problem List in the Editor

If a 7-segment screen definition has a problem, it is listed in the problem list at the bottom of the editor, and the FSCR cells that use that table turn red and cannot be compiled. Click a row to go to that display, screen or value field. If there are no problems, No problems is shown.

Figure 27. The problem list reporting a value field with an empty source and overlapping value fields

Problem Text shown in the problem list
The source is empty No value to show has been chosen. Enter an address or a symbol.
The source cannot be read … cannot be read as an address or a symbol, so its value cannot be shown.
The display format does not match the data type of the source … cannot be read in this display format. …
The address does not exist on the model or with the memory settings … is not an address on this model with these memory settings.
Value fields overlap The value field overlaps an earlier one, so the two values would overwrite each other.
A value field goes past the last digit The value field goes off the display, so part of it would not be visible.
A signed value field has a width of 1 A signed value field must be at least 2 wide for the number to show.
Too many decimal places With decimal places …, the point would not show in this value field. …
The on or off text is longer than the width The on/off segments are longer than the value field and would be cut off.
Two displays or two screens have the same number Two 7-segment displays have the same number, so … / Two screens have the same number, so …
A pin that cannot be used, or a pin used twice … pin … cannot be used on this model. … / CLK and DIO are the same pin, so … / It uses the same pin as 7-segment display …, so the signals of the two displays mix. …
The model cannot use a 7-segment display This model has no 7-segment lines (CLK, DIO), so 7-segment screens cannot be used.

Examples

Example 1. Showing the Value of D0 in Box Mode

This example connects a 4-digit module to the FND / ENCO connector of MPS-8A8R(T)-S and shows the value of D0 with two decimal places. On this model, the 7-segment display switches on without FINI.

Rung Contents
0 @ON (NO) → FINT D0 4 4 2 TRUE FALSE
1 @ON (NO) → MOVE 1234 D0

Figure 28. Example 1 in simulation

Example 2. Switching Between a Run Value and an Error Code in Screen Mode

In this example on MPS-8A8R(T)-S, screen 0 shows the run value D10, screen 1 shows Er with the error code D11, and the display switches to screen 1 when P0 turns on.

  1. Open Setting → 7-Segment Screen Editor and click Add 7-segment display (display 1 · 4 digits · screen 0).
  2. Screen 0: Click digit 1, click Add value field → Dec, and enter D10 in Source (start digit 1 · width 4).
  3. Click + in Screens to make screen 1.
  4. Screen 1: Click digit 1 and type Er. Then click digit 3, click Add value field → Dec, set Source to D11 and the width to 2, and turn on Fill leading digits with 0.
  5. Write the rungs below.
Rung Contents
0 P0 (NC) → FSCR 1 0
1 P0 (NO) → FSCR 1 1
2 @ON (NO) → MOVE 1234 D10
3 @ON (NO) → MOVE 5 D11

In simulation, the display shows 1234 while P0 is off and Er05 when P0 is on. Instead of rungs 0 and 1, you can also write a single rung, @ON (NO) → FSCR 1 D20, and switch screens with the value of D20 (0 or 1).

Figure 29. Example 2 with P0 off (screen 0)

Figure 30. Example 2 with P0 on (screen 1)

Troubleshooting

Symptom What to check
Nothing appears on the 7-segment display of the device If the status in the display list of the editor is No response, check that the VCC, GND, CLK and DIO wiring of the module matches the connector diagram on the product page, and that CLK and DIO are not swapped. In box mode on a model that needs FINI, use simulation to check that the rung that runs FINI turns on.
The characters on a 6-digit module are out of order In screen mode, try changing Digit order to 2,1,0,5,4,3. If that does not help, enter the order of your module with Custom.
Bars (‾ or _) appear instead of numbers The value does not fit in the width of the value field. Make the field wider or check the value.
In box mode, only part of the number is shown and the rung to the right of the function is off The combination of POSITION, LENGTH and SIGN pushes the number or sign past the left end. Check the orange warning on the cell.
The box mode 7-segment display stays off after the module is plugged back in A module that is plugged back in starts in the off state. In box mode, run FINI again, or restart the device if the program has no FINI. In screen mode, the display comes back within about 1 second.
Serial 3 communication stops on the MPA series The 7-segment display uses the same UART terminals as serial 3, so the two cannot be used together. Running FINI switches off serial 3 communication. Move the serial communication to another channel.
The device 7-segment display does not appear in the editor during monitoring Look up the reason shown below the glass in Display Status and Reasons.

← Back to the MP STUDIO 2 User Manual