4 arithmetic operators, Arithmetic operators -34 – IDEC High Performance Series User Manual
Page 998
![background image](/manuals/350385/998/background.png)
5 Script Coding Examples
20-34
WindO/I-NV2 User’s Manual
5.4 Arithmetic Operators
Script
Operation description
The values of LDR100 and LDR200 are added together and the result is stored in LDR300.
Script
Operation description
The value of LDR200 is subtracted from the value of LDR100 and the result is stored in LDR300.
Script
Operation description
The values of LDR100 and LDR200 are multiplied together and the result is stored in LDR300.
Script
Operation description
The value of LDR100 is divided into the value of LDR200 and the result is stored in LDR300.
Script
Operation description
The value of LDR100 is divided into the value of LDR200 and the remainder is stored in LDR300.
■
Example 5.4.1
Addition
[LDR 300] = [LDR 100] + [LDR 200];
■
Example 5.4.2
Subtraction
[LDR 300] = [LDR 100] - [LDR 200];
■
Example 5.4.3
Multiplication
[LDR 300] = [LDR 100] * [LDR 200];
■
Example 5.4.4
Division
[LDR 300] = [LDR 100] / [LDR 200];
■
Example 5.4.5
Modulo
[LDR 300] = [LDR 100] % [LDR 200];