![Omron SYSMAC C200H-AD003 Скачать руководство пользователя страница 131](http://html1.mh-extra.com/html/omron/sysmac-c200h-ad003/sysmac-c200h-ad003_operation-manual_743080131.webp)
Appendix C
Sample Programs
120
Program Example
The following program can be executed only with the C200HS, C200HX/HG/HE CPU Units.
•
Data Flow (Unit Number 0): Word 101 (AD Conversion Value)
→
Word 200 (Calculation Result)
ADB(50)
101
DM0000
DM0001
ROOT(72)
DM0006
200
SCL(––)
DM0001
DM0002
DM0006
MUL(32)
DM0006
#4400
DM0006
Execution condition
Conversion value +
Negative number
Scaling is executed using
augmented value. Result is
output to word DM 0006.
Result of step #2 (above)
is multiplied by 4400.
Square root is calculated, and
result is output to word 200.
(1)
(2)
(3)
(4)
1, 2, 3...
1. The negative number portion is added to the conversion value (word 101).
2. The binary data is scaled to a range of 0 to 4400.
3. The scaling results are multiplied by 4400.
4. The square root is calculated, and the result is output to word 200.
DM Area Settings
Input signal range: 0 to 10 V / 1 to 5 V / 4 to 20 mA
DM0000: 00C8
DM0001: (Used for calculation)
DM0002: 0000
DM0003: 0000
DM0004: 4400
DM0005: 1130
DM0006: (Used for calculation)
Digital value for -5%
Conversion value +C8 (-5% portion)
Lower limit: BCD
Lower limit +C8 (-5% portion): BIN
Upper limit: BCD
Upper limit +C8 (-5% portion): BIN
Used with SCL instruction
If the result of the binary-to-BCD conversion is negative, an error will be generated by the ROOT(72) instruction.
With a signal range of –10 to 10 V, scaling is executed by augmenting the negative portion (–10 V–5%). In this
program example, the value of DM 0000 is converted to 0898. Refer to page 116.
Sample Program 8: Mean Value Processing
Data is taken for the set number of samplings and the mean value is calculated.
Unit Settings
Item
Setting contents
Actual settings
Unit
C200H-AD003
---
Unit number
#0
Unit number switch: 0
Operation mode
Normal mode
Back-panel DIP switch: All OFF
Input 1 used
---
DM 1000 = 0001
Input signal range
Input number 1, 0 to 10 V
DM 1001 = 0001
Содержание SYSMAC C200H-AD003
Страница 1: ...Cat No W325 E1 04 Analog I O Units SYSMAC C200H AD003 DA003 DA004 MAD01...
Страница 2: ...C200H AD003 DA003 DA004 MAD01 Analog I O Units Operation Manual Revised June 2003...
Страница 3: ...iv...
Страница 5: ...vi...
Страница 145: ...Cat No W325 E1 04 Note Specifications subject to change without notice Printed in Japan Authorized Distributor...