Appendix C
Sample Programs
121
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)
→
DM 0001 (Mean Value Result)
AVG
#101
#0064
DM0001
Execution condition
Conversion value
Number of samplings
Mean value
The number of samplings will be no more than 64 when the AVG instruction is used.
Sample Program 9: Peak Value Holding
This is a program for Analog Output Unit peak value holding. If the output value range is exceeded, the output
voltage or current is held when the Conversion Enable Bit turns OFF.
5 V (03E8)
0 V (0000)
Set value
Actual output value
When program is started
Unit Settings
Item
Setting contents
Actual settings
Unit
C200H-DA003
---
Unit number
#0
Unit number switch: 0
Operation mode
Normal mode
Back-panel DIP switch: All OFF
Output 1 used
---
DM 1000 = 0001
Output signal range
All output numbers, –10 to 10 V
DM 1001 = 0000
Output hold function
HOLD
DM 1002 = 0001
Program Example
ZCP(88)
101
DM0001
DM0002
10100
25506(=)
25503((ERR)
MOV(21)
DM0000
101
Execution condition
Set value
Lower limit
Upper limit
Conversion Enable Flag
for output 1
DM Area Settings
DM0001: 0000
DM0002: 03E8
Lower limit: 0 V
Upper limit: 5 V
Содержание 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...