User Tools

Site Tools


en-us_products:mp_studio:indexed_address

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
en-us_products:mp_studio:indexed_address [2026/11/12 14:41] – external edit 127.0.0.1en-us_products:mp_studio:indexed_address [2026/11/12 20:37] (current) – external edit 127.0.0.1
Line 75: Line 75:
 | MOVE | All cells of ''MOVE'', ''GMOVE'' and ''FMOVE'' | | MOVE | All cells of ''MOVE'', ''GMOVE'' and ''FMOVE'' |
 | Data Processing | All cells of ''MAX'', ''MIN'', ''SUM'', ''AVE'', ''MUX'', ''ENCO'' and ''DECO'' | | Data Processing | All cells of ''MAX'', ''MIN'', ''SUM'', ''AVE'', ''MUX'', ''ENCO'' and ''DECO'' |
-| Serialport | CHANNEL, DATA and LENGTH of ''PUT'' · CHANNEL, LENGTH and OUT of ''GET'' · ''PUT_LEN'' and ''GET_LEN'' · ''SERID'' and ''SERRATE'' · ''MNET'' and ''MNET_READ'' |+| Serial Port | CHANNEL, DATA and LENGTH of ''PUT'' · CHANNEL, LENGTH and OUT of ''GET'' · ''PUT_LEN'' and ''GET_LEN'' · ''SERID'' and ''SERRATE'' · ''MNET'' and ''MNET_READ'' |
 | I2C | ADDRESS of ''ISTA'' · ''IWR'' · OUT of ''IRD'' · ''ISR'' · ''IBR'' | | I2C | ADDRESS of ''ISTA'' · ''IWR'' · OUT of ''IRD'' · ''ISR'' · ''IBR'' |
 | CLCD (Character LCD) | ADR and the value cells of ''CINI'', ''CLOC'', ''CSTR'', ''CINT'', ''CREAL'', ''CHEX'', ''CCLS'', ''CCON'', ''CCOF'', ''CPUT'' and ''CGET'' (except the cells listed below) · PAGE of ''CSCR'' | | CLCD (Character LCD) | ADR and the value cells of ''CINI'', ''CLOC'', ''CSTR'', ''CINT'', ''CREAL'', ''CHEX'', ''CCLS'', ''CCON'', ''CCOF'', ''CPUT'' and ''CGET'' (except the cells listed below) · PAGE of ''CSCR'' |
-| 7Segment | IN, POSITION, LENGTH and DOT of ''FINT'' · ''FDATA'' · PAGE of ''FSCR'' |+| 7-Segment | IN, POSITION, LENGTH and DOT of ''FINT'' · ''FDATA'' · PAGE of ''FSCR'' |
 | DS3231 (RTC) | All cells of ''DS3231_WR'' and ''DS3231_RD'' | | DS3231 (RTC) | All cells of ''DS3231_WR'' and ''DS3231_RD'' |
  
Line 91: Line 91:
  
 ^ Type ^ Cells ^ Reason shown ^ ^ Type ^ Cells ^ Reason shown ^
-| Cells that take only a fixed address | Contact, coil and edge cells · TIMER of timers (''T0'') and COUNT of counters (''C0'') · RESET of ''CTU'', SET of ''CTD'', and CU, CD and RESET of ''CTUD'' · ''JMP'', ''JMPN'' and ''LABEL'' · READ of ''ISTA'' · ACK of ''IRD'' · TYPE of ''CINI'' · DEFINE of ''CPUT'' · STRING of ''CSTR'' · ZERO and SIGN of ''CINT'', ''CREAL'' and ''FINT'' · ZERO of ''CHEX'' · PORT of ''PID_PWM'' | "D100[D0] is an indexed address, which this cell cannot take, so the program does not compile. Indexed addresses are only for an instruction's value cells (e.g. IN and OUT of MOV) and compare contacts — write a fixed address such as D100 here." | +| Cells that take only a fixed address | Contact, coil and edge cells · TIMER of timers (''T0'') and COUNT of counters (''C0'') · RESET of ''CTU'', SET of ''CTD'', and CU, CD and RESET of ''CTUD'' · ''JMP'', ''JMPN'' and ''LABEL'' · READ of ''ISTA'' · ACK of ''IRD'' · TYPE of ''CINI'' · DEFINE of ''CPUT'' · STRING of ''CSTR'' · ZERO and SIGN of ''CINT'', ''CREAL'' and ''FINT'' · ZERO of ''CHEX'' · PORT of ''PID_PWM'' | "D100[D0] is an indexed address, which this cell cannot take, so the program does not compile. Indexed addresses are only for an instruction's value fields (e.g. IN and OUT of MOV) and comparison contacts — write a fixed address such as D100 here." | 
-| Cells that take only a constant | ADR of ''CSCR'' · DSP of ''FSCR'' · NUM of ''MCS'' and ''MCSCLR'' · CLK and DIO of ''FINI'' · NO of ''MBTRIG'' and ''UPTRIG'' · DIGIT of ''CREAL'' | "The ADR cell of CSCR takes only a constant, so it cannot take an indexed address (D100[D0]) and the program does not compile. Write a constant (a number) in this cell." |+| Cells that take only a constant | ADR of ''CSCR'' · DSP of ''FSCR'' · NUM of ''MCS'' and ''MCSCLR'' · CLK and DIO of ''FINI'' · NO of ''MBTRIG'' and ''UPTRIG'' · DIGIT of ''CREAL'' | "The ADR field of CSCR takes only a constant, so it cannot take an indexed address (D100[D0]) and the program does not compile. Write a constant (a number) in this field." |
  
 {{ :en-us_products:mp_studio:ix-red-reason.png?1000 |Figure 2. An indexed address written in the TIMER cell of a timer, shown in red, and the reason in the Inspector }} {{ :en-us_products:mp_studio:ix-red-reason.png?1000 |Figure 2. An indexed address written in the TIMER cell of a timer, shown in red, and the reason in the Inspector }}
Line 170: Line 170:
 In **Run → Used Data**, the base element and the index register are painted as used, and the cells from the base element to the end of the area are hatched as cells the index can reach. If the index is a ''##name'' user word, that index is not shown in this window. In **Run → Used Data**, the base element and the index register are painted as used, and the cells from the base element to the end of the area are hatched as cells the index can reach. If the index is a ''##name'' user word, that index is not shown in this window.
  
-{{ :en-us_products:mp_studio:ix-usedata-marked.svg?425 |Figure 9. Cells after D100 that the index can reach, in the Used Memory window (D Memory) }}+{{ :en-us_products:mp_studio:ix-usedata-marked.svg?425 |Figure 9. Cells after D100 that the index can reach, in the Used Data window (D Memory) }}
  
   * **① Used cells:** the base element (''D100'' in the figure) and the index register are painted.   * **① Used cells:** the base element (''D100'' in the figure) and the index register are painted.
-  * **② Hatching:** cells the index can reach. Hover over one to see "D100[D0] can reach this far · with a negative index it also reaches the cells before it".+  * **② Hatching:** cells the index can reach. Hover over one to see "D100[D0] can reach this far · with a negative index it also reaches the addresses before it".
   * **③ Legend:** **Reachable by index**   * **③ Legend:** **Reachable by index**
  
Line 184: Line 184:
 In this example, ''D100'' to ''D109'' hold the setpoints of 10 recipes, and each press of ''P0'' copies the value of the next recipe to ''D200''. In this example, ''D100'' to ''D109'' hold the setpoints of 10 recipes, and each press of ''P0'' copies the value of the next recipe to ''D200''.
  
-  - In **Setting → Symbol**, register RECIPE for ''D100'', IDX for ''D0'', NOW_SV for ''D200'', NEXT_BTN for ''P0'' and IXERR_LAMP for ''M0''.+  - In **Settings → Symbol**, register RECIPE for ''D100'', IDX for ''D0'', NOW_SV for ''D200'', NEXT_BTN for ''P0'' and IXERR_LAMP for ''M0''.
   - Write the rungs below.   - Write the rungs below.
  
Line 199: Line 199:
 In this example, the value of ''D10'' is logged every second into the 20 cells ''D150'' to ''D169'' in turn, and logging starts over from the first cell after the last one. In this example, the value of ''D10'' is logged every second into the 20 cells ''D150'' to ''D169'' in turn, and logging starts over from the first cell after the last one.
  
-  - In **Setting → Symbol**, register TEMP for ''D10'', POS for ''D1'' and LOG for ''D150''.+  - In **Settings → Symbol**, register TEMP for ''D10'', POS for ''D1'' and LOG for ''D150''.
   - Write the rungs below after the rungs of Example 1.   - Write the rungs below after the rungs of Example 1.
  
Line 211: Line 211:
 ===== Things to Check ===== ===== Things to Check =====
  
-  * Indexed addresses use the user memory (USER). Each different indexed address takes 6 bytes (an address used in several cells counts once), plus 2 bytes for the whole program. If there is not enough, "(of this, N indexed address(es) use M bytes of hidden cells)" is added to the end of the compile error, so increase **USER** in **Setting → Data Memory**.+  * Indexed addresses use the user memory (USER MEMORY). Each different indexed address takes 6 bytes (an address used in several cells counts once), plus 2 bytes for the whole program. If there is not enough, "(including M bytes of hidden area used by N indexed address(es))" is added to the end of the compile error, so increase **USER MEMORY** in **Settings → Data Memory**.
   * Each indexed cell adds a little to the execution time.   * Each indexed cell adds a little to the execution time.
   * Indexed addresses are used in ladder cells and in the Data Table. They cannot be used in the bindings of the Modbus device table or in the value fields of the CLCD Screen Editor.   * Indexed addresses are used in ladder cells and in the Data Table. They cannot be used in the bindings of the Modbus device table or in the value fields of the CLCD Screen Editor.
en-us_products/mp_studio/indexed_address.1794462077.txt.gz · Last modified: by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki