en-us_products:mpino_studio2:box_functions:arithmetic
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| en-us_products:mpino_studio2:box_functions:arithmetic [2026/09/09 17:54] – 만듦 - 바깥 편집 127.0.0.1 | en-us_products:mpino_studio2:box_functions:arithmetic [2026/09/10 01:05] (current) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| Line 5: | Line 5: | ||
| {{ : | {{ : | ||
| - | This ladder screen adds two WORD values with ADD. | + | ===== Common Rules ===== |
| - | + | ||
| - | {{ : | + | |
| - | + | ||
| - | ===== 1. Common Rules ===== | + | |
| The first two values are sources and the final address stores the result. '' | The first two values are sources and the final address stores the result. '' | ||
| - | ===== 2. ADD, SUB, MUL, DIV, and MOD ===== | + | ===== Box Function List ===== |
| - | + | ||
| - | ==== ADD ==== | + | |
| - | + | ||
| - | **Add** | + | |
| - | + | ||
| - | Adds two values and stores the result in the destination. | + | |
| - | + | ||
| - | **Syntax:** '' | + | |
| - | + | ||
| - | ^ Run condition ^ Before ^ Command entered ^ Expected result ^ | + | |
| - | | Left condition ON | D0=12, D1=5 | '' | + | |
| - | + | ||
| - | ==== SUB ==== | + | |
| - | + | ||
| - | **Subtract** | + | |
| - | + | ||
| - | Subtracts the second value from the first and stores the result in the destination. | + | |
| - | + | ||
| - | **Syntax:** '' | + | |
| - | + | ||
| - | ^ Run condition ^ Before ^ Command entered ^ Expected result ^ | + | |
| - | | Left condition ON | D0=12, D1=5 | '' | + | |
| - | + | ||
| - | ==== MUL ==== | + | |
| - | + | ||
| - | **Multiply** | + | |
| - | + | ||
| - | Multiplies two values and stores the result in the destination. | + | |
| - | + | ||
| - | **Syntax:** '' | + | |
| - | + | ||
| - | ^ Run condition ^ Before ^ Command entered ^ Expected result ^ | + | |
| - | | Left condition ON | D0=12, D1=5 | '' | + | |
| - | + | ||
| - | ==== DIV ==== | + | |
| - | + | ||
| - | **Divide** | + | |
| - | + | ||
| - | Divides the first value by the second and stores the quotient. With integer operands, the fractional part is discarded. | + | |
| - | + | ||
| - | **Syntax:** '' | + | |
| - | + | ||
| - | ^ Run condition ^ Before ^ Command entered ^ Expected result ^ | + | |
| - | | Left condition ON | D0=12, D1=5 | '' | + | |
| - | + | ||
| - | ==== MOD ==== | + | |
| - | + | ||
| - | **Modulo** | + | |
| - | + | ||
| - | Divides the first value by the second and stores the remainder. | + | |
| - | + | ||
| - | **Syntax:** '' | + | |
| - | + | ||
| - | ^ Run condition ^ Before ^ Command entered ^ Expected result ^ | + | |
| - | | Left condition ON | D0=12, D1=5 | '' | + | |
| - | + | ||
| - | ===== 3. INC and DEC ===== | + | |
| - | + | ||
| - | ==== INC ==== | + | |
| - | + | ||
| - | **Increment** | + | |
| - | + | ||
| - | Increments the destination by one and stores it back at the same address. | + | |
| - | + | ||
| - | **Syntax:** '' | + | |
| - | + | ||
| - | **Arguments** | + | |
| - | + | ||
| - | * 1st = D: target address (stores the previous value +1 back to the same address) | + | |
| - | + | ||
| - | ^ Run condition ^ Before ^ Command entered ^ Expected result ^ | + | |
| - | | Left condition ON | D0=7 | '' | + | |
| - | + | ||
| - | ==== DEC ==== | + | |
| - | + | ||
| - | **Decrement** | + | |
| - | + | ||
| - | Decrements the destination by one and stores it back at the same address. | + | |
| - | + | ||
| - | **Syntax:** '' | + | |
| - | + | ||
| - | **Arguments** | + | |
| - | + | ||
| - | * 1st = D: target address (stores the previous value −1 back to the same address) | + | |
| - | + | ||
| - | ^ Run condition ^ Before ^ Command entered ^ Expected result ^ | + | |
| - | | Left condition ON | D0=7 | '' | + | |
| - | + | ||
| - | ===== 4. SCALE ===== | + | |
| - | + | ||
| - | **Scale (Linear Interpolation)** | + | |
| - | + | ||
| - | Linearly maps an integer from an input range to an integer output range. Values outside the input range are limited to the nearest boundary; equal IN_MIN and IN_MAX stores OUT_MIN. | + | |
| - | + | ||
| - | **Syntax:** '' | + | |
| - | + | ||
| - | **Arguments** | + | |
| - | + | ||
| - | * 1st = input: address or constant to convert | + | |
| - | * 2nd = input minimum | + | |
| - | * 3rd = input maximum | + | |
| - | * 4th = destination: | + | |
| - | * 5th = output minimum | + | |
| - | * 6th = output maximum | + | |
| - | + | ||
| - | ^ Run condition ^ Before ^ Command entered ^ Expected result ^ | + | |
| - | | Left condition ON | D0=1023 | '' | + | |
| - | + | ||
| - | ===== 5. FLOOR and SQRT ===== | + | |
| - | + | ||
| - | ==== FLOOR ==== | + | |
| - | + | ||
| - | **Floor** | + | |
| - | + | ||
| - | Stores the greatest integer that is not larger than the source. For example, 12.8 becomes 12 and -1.2 becomes -2. | + | |
| - | + | ||
| - | **Syntax:** '' | + | |
| - | + | ||
| - | **Arguments** | + | |
| - | + | ||
| - | * 1st = source: address or constant to round down | + | |
| - | * 2nd = destination: | + | |
| - | + | ||
| - | ^ Run condition ^ Before ^ Command entered ^ Expected result ^ | + | |
| - | | Left condition ON | R0=12.8 | '' | + | |
| - | + | ||
| - | ==== SQRT ==== | + | |
| - | + | ||
| - | **Square Root** | + | |
| - | + | ||
| - | Stores the square root of the source. Use R memory as the destination when the result must retain its fractional part. | + | |
| - | + | ||
| - | **Syntax:** '' | + | |
| - | + | ||
| - | **Arguments** | + | |
| - | + | ||
| - | * 1st = source: nonnegative address or constant | + | |
| - | * 2nd = destination: | + | |
| - | + | ||
| - | ^ Run condition ^ Before ^ Command entered ^ Expected result ^ | + | |
| - | | Left condition ON | D0=81 | '' | + | |
| - | + | ||
| - | ===== 6. Troubleshooting | + | |
| - | ^ Symptom | + | ^ Command |
| - | | DIV or MOD produces no result. | Check whether | + | | [[en-us_products: |
| - | | The SCALE result | + | | [[en-us_products: |
| + | | [[en-us_products: | ||
| + | | [[en-us_products: | ||
| + | | [[en-us_products: | ||
| + | | [[en-us_products: | ||
| + | | [[en-us_products: | ||
| + | | [[en-us_products: | ||
| + | | [[en-us_products: | ||
| + | | [[en-us_products: | ||
| ===== Related Documentation ===== | ===== Related Documentation ===== | ||
| * [[en-us_products: | * [[en-us_products: | ||
| - | * [[en-us_products: | ||
| - | * [[en-us_products: | ||
| * [[en-us_products: | * [[en-us_products: | ||
en-us_products/mpino_studio2/box_functions/arithmetic.1788944071.txt.gz · Last modified: by 127.0.0.1
