====== 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. * **Box mode** — The ''FINI'', ''FINT'' and ''FDATA'' functions write directly to the chip from the ladder. These are the same functions as in the earlier MP STUDIO. * **Screen mode** (V1.3.0 and later) — Lay out screens in advance in the **7-Segment Screen Editor** and show each one with a single ''FSCR'' function. The value fields on a screen follow the values in the device memory automatically, and only the digits that change are sent to the 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 [[:en-us_guide:seven_segment|7-Segment LED Guide]]. {{ :en-us_products:mp_studio:fnd-editor.png?1000 |Figure 1. The 7-Segment Screen Editor (fixed characters Er and an error code value field placed on screen 1) }} ===== Two Ways to Display ===== {{ :en-us_products:mp_studio:fnd-methods.svg?1000 |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|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) — [[:en-us_products:mps_8a4r_s|MPS-8A4R-S]] · [[:en-us_products:mps_8a4t_s|MPS-8A4T-S]] · [[:en-us_products:mps_8a8r_s|MPS-8A8R-S]] · [[:en-us_products:mps_8a8t_s|MPS-8A8T-S]] · [[:en-us_products:mps_16a16r|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** — [[:en-us_products:mpa|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 — [[:en-us_products:mps_8a8r|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 — [[:en-us_products:mps_16a8r8t|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 — [[:en-us_products:mps_16a8r|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). * In box mode on ''MPS-8A8R'' and ''MPS-16A8R8T'', each CLK/DIO pair of an executed ''FINI'' gets its own 7-segment display, and ''FINT'' and ''FDATA'' write to the display of the ''FINI'' executed last. ''MPS-16A8R(T)'' uses only the one pin pair of the ''FINI'' placed last in the program. * On the MPA series, executing ''FINI'' switches off serial 3 communication, and serial 3 cannot send or receive until the device is restarted. * Connect VCC, GND, CLK and DIO of the 7-segment module as shown in the connector diagram on the product page. * On the standard ''MPS-8A4T-S'', the FND / ENCO connector has 4.7 kΩ pull-down resistors, so a 7-segment display does not work correctly. To use a 7-segment display, choose the 7-segment control option when you order (see [[:en-us_products:mps_8a4t_s|MPS-8A4T-S]]). ===== 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. {{ :en-us_products:mp_studio:fnd-box-rungs.png?1000 |Figure 3. Rungs that switch on the 7-segment display with FINI, show D0 with FINT and show fixed characters with FDATA }} ==== FINI ==== * On ''MPS-8A4R(T)-S'', ''MPS-8A8R(T)-S'' and ''MPS-16A16R(T)'', the 7-segment display switches on by itself when the device starts if the program has ''FINT'' or ''FDATA'', so ''FINI'' is not required. * On other models, the 7-segment display switches on only when ''FINI'' runs. If there is no ''FINI'', the ''FINT'' and ''FDATA'' cells show an orange warning. * ''FINI'' clears digits 1 to 4 every time it runs. If its rung is always on, the digits are cleared and rewritten on every scan, so use a rising edge or a similar condition so that ''FINI'' runs only once, when needed. ==== 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. {{ :en-us_products:mp_studio:fnd-pos-address.svg?900 |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. | {{ :en-us_products:mp_studio:fnd-fint-options.svg?1000 |Figure 5. What a 4-digit module shows with different FINT arguments }} * With SIGN off, negative values are shown as unsigned numbers. For example, the byte ''-5'' is shown as ''251''. * With SIGN on, the sign needs one more digit to the left of the number. POSITION must be greater than LENGTH to show the sign. * If the value has more digits than are shown, only the lower digits appear (''12345'' → ''2345'' with LENGTH 4). * Double word values and negative values with SIGN on are shown correctly from V1.3.0. ==== 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. {{ :en-us_products:mp_studio:fnd-seg-bits.svg?700 |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 [[#making_values_in_the_character_table|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 ==== * Select **Setting → 7-Segment Screen Editor**. * Press ''Enter'' on an ''FSCR'' cell in the ladder, or double-click it, to open the editor with that display and screen selected. * When you edit an argument cell of ''FSCR'', click **Open screen editor** below the input box. * If you add an ''FSCR'' when there are no 7-segment displays yet, display 1 is created and the editor opens automatically. * Right-click an ''FINI'', ''FINT'' or ''FDATA'' cell and select **Show 7-segment display**. The editor opens, and the glass follows what the 7-segment display is currently showing. {{ :en-us_products:mp_studio:fnd-cell-menu.png?400 |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 ==== {{ :en-us_products:mp_studio:fnd-editor-marked.svg?1000 |Figure 8. Parts of the 7-Segment Screen Editor }} * **① Status chip:** During simulation or monitoring, shows what the glass is showing (**Simulation · Running · Screen N** or **PLC display · Screen N**). * **② LED color · 7-segment only:** Choose the LED color of the editor glass (red, green, blue, amber or white). The color is remembered only on this PC and does not affect the device. **7-segment only** shrinks the window. * **③ 7-Segment Display list:** Add and select 7-segment displays here. * **④ Display properties:** The number, digits, digit order, pins, brightness and look of the selected display. * **⑤ Screens:** The screens of the selected display. * **⑥ Screen number · Add value field:** Change the number of the selected screen, or place a value field at the digit selected on the glass. * **⑦ Field band:** Value fields appear as colored bars. Drag a bar to move it, and drag its right end to change the width. * **⑧ Glass:** Shows the characters the device will draw. The digit numbers and chip addresses are shown below the glass. * **⑨ Value fields on this screen:** The list of value fields on the screen and the cost per scan. * **⑩ Tabs on the right:** **Value field** (properties of the selected value field), **Segment painter** (fixed segments of the selected digit) and **Character table** (making segment values). * **⑪ Problem list:** Lists any problems in the 7-segment screen definitions. ==== Adding a 7-Segment Display ==== - 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. - Set the properties in the table below to match the 7-segment module and its wiring. {{ :en-us_products:mp_studio:fnd-display-props-marked.svg?420 |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**. {{ :en-us_products:mp_studio:fnd-order-6digit.svg?900 |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. {{ :en-us_products:mp_studio:fnd-screen-list.png?420 |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. * You can use ''0'' to ''9'', ''A b C c d E F G H h I J L n o P q r S t U u y'', ''-'' ''_'' ''°'' ''='' and a space. A letter that can be drawn in only one case is entered in that shape (''a'' → ''A'', ''O'' → ''0''). * Typing ''.'' switches the dot of the previous character on or off. * Delete with ''Backspace'' and ''Delete'', and move between digits with ''←'', ''→'', ''Home'' and ''End''. * Characters that a 7-segment display cannot draw (''K'', ''M'', ''V'', ''W'', ''X'', ''Z'', Korean characters and so on) are not entered, and the reason is shown below the glass. Draw such shapes one segment at a time in the **Segment painter** tab. The **Segment painter** tab edits the fixed segments of the selected digit segment by segment. {{ :en-us_products:mp_studio:fnd-digit-painter-marked.svg?420 |Figure 12. The Segment painter tab }} * **① Fixed segments of digit N:** The selected digit and its current value (hex). * **② Segments:** Click a segment to switch it on or off. * **③ Quick characters:** Click a character to apply its shape. **Dot** switches the dot on or off, and **Clear** empties the digit. 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. - Click the digit on the glass where the value should start. - 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. - 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''). - Set the options you need. {{ :en-us_products:mp_studio:fnd-field-props-marked.svg?420 |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. | {{ :en-us_products:mp_studio:fnd-field-examples.svg?1000 |Figure 14. What a 4-digit module shows for each value field type and option }} * If a value does not fit in the width, the whole value field is shown as top bars (‾). In a signed decimal field, a negative value that does not fit is shown as bottom bars (_). If a preview value overflows, the **Value field** tab shows **Overflow — the whole width shows top bars (a cut-off number is never shown)**. * Hex values are shown with ''0'' to ''9'' and ''A b C d E F''. * Drag a bar on the field band to move a value field, and drag its right end to change the width. You can also move it with ''Alt+←→'' and change the width with ''Alt+Shift+←→''. * To delete a value field, click **Remove this value field**, or select the value field and press ''Delete''. **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. {{ :en-us_products:mp_studio:fnd-chars-tab-marked.svg?420 |Figure 15. The Character table tab }} * **① Take digit N from the glass:** Takes the shape of the digit selected on the glass. During simulation or monitoring, it takes the actual character shown on the glass. * **② Painter:** Click a segment to switch it on or off. * **③ Value:** The **Hex** (in the form ''16#3F''), **Dec** and **Binary** values of the shape. Click the ⧉ button to copy a value. * **④ Bits:** Switch bits 7 (dot) to 0 (a) on and off one by one. * **⑤ Quick characters:** Click a character to apply its shape. You can also press a character key to pick it directly (''.'' dot · ''Del'' clear · ''Ctrl+C'' copy hex). * **⑥ Put in cell:** With the DATA cell of an ''FDATA'' selected in the ladder, click this to put the hex value in that cell. **Load into the painter** loads the current value of that cell into the painter. * **⑦ Put as fixed segments:** Puts the shape into the fixed segments of the digit selected on the glass. ''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. {{ :en-us_products:mp_studio:fnd-compact.png?600 |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. | {{ :en-us_products:mp_studio:fnd-fscr-param.png?600 |Figure 17. The list for picking a screen, shown when you edit the PAGE cell of FSCR }} * The screen is shown while the rung is on. When the rung turns off, the last screen stays and its value fields keep updating. You do not need to call it with a pulse, and ''FINI'' is not needed either. * The output of ''FSCR'' turns on when the screen is in the screen list and the 7-segment display responds. ''MPS-8A8R'' and ''MPS-16A8R8T'' do not read the response from the 7-segment display, so on these models the output turns on whenever the screen exists. * If you use a word address (for example ''D20'') for PAGE, you can switch screens by changing that value. If the number is not in the screen list, the last screen stays on the display and the output turns off. * If two or more ''FSCR'' for the same display are on in the same scan, the screen chosen by the later ''FSCR'' is shown. * When you add an ''FSCR'', DSP and PAGE are filled in with the first display and the first screen. When you edit the DSP or PAGE cell, the displays and screens appear as small pictures below the input box, so you can pick one. * If you unplug the 7-segment module and plug it back in, the whole screen is sent again within about 1 second. {{ :en-us_products:mp_studio:fnd-fscr-rungs.png?1000 |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 [[:en-us_products:mp_studio:simulation|Phase 8 · Simulation]]. {{ :en-us_products:mp_studio:fnd-sim-marked.svg?1000 |Figure 19. The 7-Segment Screen Editor during simulation }} * **① Status chip:** Shows the run state and the screen currently showing, as in **Simulation · Running · Screen N**. * **② Display status:** Each display in the display list shows **On**, **Off**, **No response** or **Lines not ready**. * **③ Glass:** The value field digits show the actual values from the simulator, and the border of the glass turns green. Fixed characters are shown exactly as set in the editor. * **④ Status line:** One line below the glass shows the screen currently showing and facts about the 7-segment display. * **⑤ Values:** **Value fields on this screen** shows the characters each value field is currently showing. 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. {{ :en-us_products:mp_studio:fnd-sim-other-screen.png?1000 |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**. {{ :en-us_products:mp_studio:fnd-sim-legacy.png?1000 |Figure 21. Simulating a box mode 7-segment display }} * In box mode, MP STUDIO 2 cannot tell how many digits the module has. When you select the display, choose the number of digits of the glass with **Digits** (**4 digits** or **6 digits**) on the left. This setting is remembered only on this PC. * Facts about that 7-segment display are shown below the glass, for example **The number is longer than the digits to show (LEN), so only the lower digits appear — the device does the same.** or **FINI has not run yet, so the 7-segment lines are not set up — FINT and FDATA before that do not reach the chip.** ===== 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. {{ :en-us_products:mp_studio:fnd-device-marked.svg?1000 |Figure 22. The editor showing the device 7-segment display during monitoring }} * The device also keeps the characters it sent to the 7-segment display in its memory. MP STUDIO 2 reads and shows those values, so they may differ from what the 7-segment module actually shows (a faulty module or a wiring error cannot be detected). * The display is shown only when the program on the device is confirmed to be the same as this project. If it is different or cannot be confirmed, the glass is not drawn and the reason is shown. * The values are read only while the editor is open. With two or more displays, they are read one display at a time in turn, so the more displays there are, the slower the updates. * If you edit value fields during monitoring, only the value fields you did not edit show the actual values from the device, the border of the glass becomes dashed, and **The value fields you edited are not on the device yet, so they are drawn with preview values.** is shown. Your changes reach the device only after you download them. * Box mode 7-segment displays are shown too. However, they are not shown for a program that has two or more ''FINI'' with different pins. {{ :en-us_products:mp_studio:fnd-device-edited.png?1000 |Figure 23. Value fields edited during monitoring }} ==== Display Status and Reasons ==== {{ :en-us_products:mp_studio:fnd-status-marks.svg?800 |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. {{ :en-us_products:mp_studio:fnd-cell-warning.png?700 |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 | {{ :en-us_products:mp_studio:fnd-cell-red.png?700 |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. {{ :en-us_products:mp_studio:fnd-issues.png?1000 |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'' | * ''FINT D0 4 4 2 TRUE FALSE'' writes the ones digit of ''D0'' to POS 4 (the rightmost digit), shows 4 digits, puts a dot after the second digit and fills the leading digits with 0. * In simulation, open the 7-Segment Screen Editor and select the entry under **Box mode (FINI·FINT·FDATA)** to see ''12.34''. If you change ''1234'' in rung 1 to ''5'', ''00.05'' is shown. {{ :en-us_products:mp_studio:fnd-example1.png?1000 |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. - Open **Setting → 7-Segment Screen Editor** and click **Add 7-segment display** (display 1 · 4 digits · screen 0). - Screen 0: Click digit 1, click **Add value field → Dec**, and enter ''D10'' in **Source** (start digit 1 · width 4). - Click **+** in **Screens** to make screen 1. - 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**. - 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). {{ :en-us_products:mp_studio:fnd-example2-screen0.png?1000 |Figure 29. Example 2 with P0 off (screen 0) }} {{ :en-us_products:mp_studio:fnd-example2-screen1.png?1000 |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|Display Status and Reasons]]. | ===== Related Pages ===== * [[:en-us_products:mp_studio:functions|Phase 4 · Functions]] * [[:en-us_products:mp_studio:simulation|Phase 8 · Simulation]] * [[:en-us_products:mp_studio:monitoring|Phase 7 · Monitoring and the Data Table]] * [[:en-us_products:mp_studio:lcd_screen_editor|LCD Screen Editor]] * [[:en-us_guide:seven_segment|7-Segment LED Guide]] [[:en-us_products:mp_studio|← Back to the MP STUDIO 2 User Manual]]