en-us_products:mpino_studio2:memory
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en-us_products:mpino_studio2:memory [2026/09/08 20:07] – 바깥 편집 127.0.0.1 | en-us_products:mpino_studio2:memory [2026/09/14 12:24] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== MPINO STUDIO 2 Phase 2 · Understand Memory ====== | ====== MPINO STUDIO 2 Phase 2 · Understand Memory ====== | ||
| - | This page explains the differences between **P, M, D, C, T, and R memory**, address notation, memory-region settings, | + | This page explains the differences between **P, M, D, C, T, and R memory**, address notation, memory-region settings, |
| - | ^ Reference board ^ Completion goal ^ | + | {{ : |
| - | | MPINO-8A4R(T)-S | Identify memory addresses and locate where they are used in a project | | + | |
| - | + | ||
| - | {{ : | + | |
| > **About screenshots: | > **About screenshots: | ||
| - | ===== 1. What Is Memory? ===== | + | ===== 1. PLC Memory |
| + | |||
| + | Unlike Arduino programs, PLC programs use P, M, D, C, T, and R memory. Arduino code can allocate variables from the remaining SRAM after the PLC memory regions have been allocated. | ||
| Memory holds input states, internal conditions, calculation results, timer values, and other data while the program runs. Ladder logic and Arduino C code in MPINO Studio 2 can share and use this memory. | Memory holds input states, internal conditions, calculation results, timer values, and other data while the program runs. Ladder logic and Arduino C code in MPINO Studio 2 can share and use this memory. | ||
| Line 25: | Line 24: | ||
| | '' | | '' | ||
| | '' | | '' | ||
| + | |||
| + | ==== Sharing Memory Between Arduino Code and Ladder Logic ==== | ||
| + | |||
| + | Ladder logic and Arduino code use the same storage for P, M, D, C, T, and R memory. A value written on one side can be read from the same address on the other side. | ||
| + | |||
| + | {{ : | ||
| + | |||
| + | In Arduino code, use the ladder address name directly or write it in array form. Both forms refer to the same memory. | ||
| + | |||
| + | * Ladder '' | ||
| + | * Ladder '' | ||
| + | * Ladder '' | ||
| + | |||
| + | <code cpp> | ||
| + | void loop() { | ||
| + | M0 = true; // Sets the M0 bit contact in the ladder to ON. | ||
| + | D0 = 120; // Shares the D0 integer between ladder and Arduino code. | ||
| + | R0 = 23.5f; | ||
| + | |||
| + | ladderLoop(); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | A value changed by ladder logic can be read in Arduino code after '' | ||
| + | |||
| + | > **I/O mapping caution:** The P region and C addresses mapped to board functions are synchronized with physical I/O during a ladder scan. Before sharing these regions with Arduino code, check the address and I/O direction under **Settings → Ladder Pin Map Settings**. | ||
| > **P address caution:** P addresses can be reviewed and changed in **Board Pin Editing**. Their I/O directions and physical terminals follow the definition of the board selected for the project. | > **P address caution:** P addresses can be reviewed and changed in **Board Pin Editing**. Their I/O directions and physical terminals follow the definition of the board selected for the project. | ||
| Line 30: | Line 55: | ||
| > **R value error caution:** Because of the limits of 32-bit floating-point arithmetic, '' | > **R value error caution:** Because of the limits of 32-bit floating-point arithmetic, '' | ||
| - | ===== 2. Memory Regions | + | ===== 2. Memory Regions ===== |
| The MPINO-8A4R(T)-S board uses these default memory counts: | The MPINO-8A4R(T)-S board uses these default memory counts: | ||
| - | You can change the number of addresses used under **Settings → Memory Region Settings**. | + | You can change the number of addresses used under **Settings → Memory Region Settings**. |
| - | {{ : | + | {{ : |
| ^ Region ^ Default count ^ Default address range ^ | ^ Region ^ Default count ^ Default address range ^ | ||
| Line 66: | Line 91: | ||
| | '' | | '' | ||
| - | > **Critical check:** If you choose '' | + | > **Critical check:** If you choose '' |
| Mapped addresses vary by board and can also be changed by the user. Check them under **Settings → Ladder Pin Map Settings**. | Mapped addresses vary by board and can also be changed by the user. Check them under **Settings → Ladder Pin Map Settings**. | ||
| - | ===== 3. Understand | + | ===== 3. Data Types ===== |
| Data width is the number of bits read or stored at one time. It determines the available value range and memory use. | Data width is the number of bits read or stored at one time. It determines the available value range and memory use. | ||
| Line 88: | Line 113: | ||
| ===== 4. Read Memory Addresses ===== | ===== 4. Read Memory Addresses ===== | ||
| - | Read a long address from left to right as a **data-width prefix**, **memory | + | Read memory |
| - | {{ : | + | {{ : |
| - | For example, | + | - '' |
| + | - '' | ||
| + | - '' | ||
| + | - '' | ||
| - | - '' | + | ==== Memory |
| - | - '' | + | |
| - | - '' | + | |
| - | - '' | + | |
| - | + | ||
| - | ==== How Memory | + | |
| This diagram shows the memory structure for bits, bytes, words, double words, and floating-point values. | This diagram shows the memory structure for bits, bytes, words, double words, and floating-point values. | ||
| Line 109: | Line 132: | ||
| Each D, C, or T address is one WORD. Two consecutive WORDs form a DWORD: '' | Each D, C, or T address is one WORD. Two consecutive WORDs form a DWORD: '' | ||
| - | ===== 5. Inspect | + | ===== 5. Find Memory |
| - | Select **Settings → Memory | + | Select **Settings → Used Memory**, or press '' |
| - | Check the dialog in this order: | + | {{ : |
| - | + | ||
| - | - Confirm that the current project board is **MPINO-8A4R(T)-S**. | + | |
| - | - Review the counts in the P, M, D, C, T, and R fields. | + | |
| - | - A field left blank uses the selected board' | + | |
| - | - Review the estimated SRAM use and total SRAM at the bottom. | + | |
| - | - If the total is exceeded, the indicator turns red and the settings cannot be saved. | + | |
| - | - If a change is required, enter the value and select **Save**. | + | |
| - | - Close the dialog and press '' | + | |
| - | + | ||
| - | Keep the board defaults unless the project has a clear reason to change them. Increasing a count provides more addresses but consumes more SRAM. Reducing a count can leave an existing ladder cell or Arduino C reference outside the valid range, so inspect the Used Memory Map before and after the change. | + | |
| - | + | ||
| - | ===== 6. Find Memory Used by the Project ===== | + | |
| - | + | ||
| - | Select **View → Used Memory Map**, or press '' | + | |
| - | + | ||
| - | {{ : | + | |
| - | + | ||
| - | Use the map as follows: | + | |
| - | + | ||
| - | - Select the '' | + | |
| - | - Narrow the results with the ladder and code source filters. | + | |
| - | - Enter an address in the search field and press '' | + | |
| - | - A colored address cell means that the current project uses that memory. | + | |
| - | - Select a used cell to display its references below the grid. | + | |
| - | - Select a reference to jump to the ladder cell or code location. | + | |
| - | - The selected tab and scroll position remain when the dialog is reopened. They reset when the application restarts. | + | |
| - | + | ||
| - | ==== Check the Phase 1 Project ==== | + | |
| - | + | ||
| - | - Open the project saved in Phase 1. | + | |
| - | - Press '' | + | |
| - | - Select the '' | + | |
| - | - Confirm that '' | + | |
| - | - Select '' | + | |
| - | - Select '' | + | |
| Inspecting this map before reassigning an address or reducing a memory-region size helps prevent duplicate use and out-of-range references. | Inspecting this map before reassigning an address or reducing a memory-region size helps prevent duplicate use and out-of-range references. | ||
| - | ===== 7. Time-Driven | + | ===== 6. Special-Bit Memory |
| - | A special contact | + | Special-bit memory |
| - | + | ||
| - | {{ : | + | |
| ^ Format ^ Operation ^ Example ^ | ^ Format ^ Operation ^ Example ^ | ||
| + | | '' | ||
| + | | '' | ||
| | '' | | '' | ||
| | '' | | '' | ||
| + | |||
| + | '' | ||
| + | |||
| + | {{ : | ||
| '' | '' | ||
| Line 166: | Line 158: | ||
| '' | '' | ||
| - | {{ : | + | {{ : |
| Follow these input rules: | Follow these input rules: | ||
| - | * The time unit is milliseconds (ms). | + | * The time unit for '' |
| * Do not use parentheses. Enter '' | * Do not use parentheses. Enter '' | ||
| - | * Use a special | + | * Use special-bit memory |
| * Do not enter it as an output-coil address. | * Do not enter it as an output-coil address. | ||
| - | * An arbitrary name such as '' | ||
| - | |||
| - | ===== 8. Exercise · Flash P32 Once Per Second ===== | ||
| - | |||
| - | Replace the '' | ||
| - | |||
| - | - Open the Phase 1 project and use **File → Save As** to save '' | ||
| - | - Confirm that output loads are disconnected. | ||
| - | - Select the '' | ||
| - | - Press '' | ||
| - | - Change the address to '' | ||
| - | - Keep '' | ||
| - | - Press '' | ||
| - | - Connect the MP download cable and select the port at the lower right. | ||
| - | - Press '' | ||
| - | - If you configured a monitoring port in Phase 1, press '' | ||
| - | - Confirm that the '' | ||
| - | |||
| - | To resume the physical-input test afterward, restore the contact address to '' | ||
| - | |||
| - | ===== 9. Choose Memory by Situation ===== | ||
| - | |||
| - | ^ Value to store ^ Region to check first ^ What to verify ^ | ||
| - | | Physical digital input or output | '' | ||
| - | | Internal ladder ON/OFF condition | '' | ||
| - | | General integer or calculation result | '' | ||
| - | | Current counter value | '' | ||
| - | | Elapsed timer value | '' | ||
| - | | Value with a decimal point | '' | ||
| - | | Periodic contact condition | '' | ||
| - | |||
| - | ===== 10. Completion Checklist ===== | ||
| - | |||
| - | You have completed Phase 2 when you can explain or verify every item below. | ||
| - | |||
| - | * Distinguish the purposes of '' | ||
| - | * Explain that '' | ||
| - | * Identify the size and signed range of BIT, BYTE, WORD, and DWORD. | ||
| - | * Read '' | ||
| - | * Open Memory Region Settings with '' | ||
| - | * Find the '' | ||
| - | * Explain the difference between '' | ||
| - | * Save the exercise as a separate project and verify the build result. | ||
| ===== Troubleshooting ===== | ===== Troubleshooting ===== | ||
| Line 223: | Line 172: | ||
| | An entered address is rejected. | Check the region letter, address range, B/W/D prefix support, and '' | | An entered address is rejected. | Check the region letter, address range, B/W/D prefix support, and '' | ||
| | Memory Region Settings cannot be saved. | Check whether estimated SRAM use exceeds total SRAM and is shown in red. | | | Memory Region Settings cannot be saved. | Check whether estimated SRAM use exceeds total SRAM and is shown in red. | | ||
| - | | An address does not appear in the Used Memory | + | | An address does not appear in Used Memory. | Select the correct region tab and ladder/code filters, enter the address, and press '' |
| | A C counter value is unexpected. | First check for overlap with the '' | | A C counter value is unexpected. | First check for overlap with the '' | ||
| - | | '' | + | | '' |
| - | | P32 does not flash. | Confirm that '' | + | |
| ===== Related Documentation ===== | ===== Related Documentation ===== | ||
| + | |||
| + | * [[en-us_products: | ||
| + | |||
| + | * [[en-us_products: | ||
| + | |||
| + | * [[en-us_products: | ||
| * [[: | * [[: | ||
en-us_products/mpino_studio2/memory.1788865627.txt.gz · Last modified: by 127.0.0.1
