Appendix E Sample programs
6F8C1583
82
E
E.2 Data receiving program for type1 light / S2
This chapter describes a sample program of data receiving using CH1 (RS-232C).
This program can operate in following environment.
Controller Module
mode
Remarks
type1 light
normal mode
CF611 mode
Receive data size restricted to 160W.
S2
CF611 mode
Receive data size restricted to 160W.
■
Variable
I/O variable
Name Type
Description
IOStatus
WORD
Direct input I/O variable corresponding CF622 DPRAM Status. (I/O WORD No.0)
IOCmd
WORD
Direct output I/O variable corresponding CF622 DPRAM Status. (I/O WORD No.2)
Local variable
Name Type
Description
Count_recv DINT
Receiving counter
Count_err DINT
Error
counter
RcvReq BOOL
Receiving
Request
Done BOOL
Receiving Complete
Error BOOL
Receiving
Error
ErrData UINT
Error
Information
RcvData
ARRAY[0..511] OF WORD
Sending data Buffer
Target WORD
Bus/Unit/Slot
■
Operation
(1) If receiving request is set (RcvReq = 1), this application waits for CF622 to set RX_CMP. If
RX_CMP is set, RX_ST is set.
(2) If RX_RDY is set, user function block (UFUN_MWREAD) reads 1024 byte data from CF622
buffer memory. RX_ST is reset and "Done" is set after reading data is completed.
(3) If a receiving error is detected (RX_ERR is set), an error factor is stored to "ErrData" using the
MREAD instruction, RX_ST is reset and "Error" is set.
■
Operation
(1) If receiving request is set (RcvReq = 1), this application waits for CF622 to set RX_CMP. If
RX_CMP is set, RX_ST is set.
(2) If RX_RDY is set, user function block (UFUN_MWREAD) reads 1024 byte data from CF622
buffer memory. RX_ST is reset and "Done" is set after reading data is completed.
Содержание CF622
Страница 20: ...Chapter 1 Introducing CF622 6F8C1583 1 6 ...
Страница 26: ...Chapter 2 Names and Functions of the Parts 6F8C1583 12 ...
Страница 38: ...Chapter 4 Installation and wiring 6F8C1583 24 ...
Страница 70: ...Chapter 6 Maintenance and Inspection 6F8C1583 56 6 ...
Страница 74: ...Chapter 7 Troubleshooting 6F8C1583 60 7 ...
Страница 78: ...Chapter 8 Usage Constraints 6F8C1583 64 8 ...
Страница 83: ...69 Appendix B Outside Dimensions B 1 CF622 module 70 B 2 CF622 implemented in the base unit 71 ...
Страница 86: ...Appendix B Outside Dimensions 6F8C1583 72 ...
Страница 87: ...73 73 Appendix C Related Products C 1 Accessories 74 C 2 Recommended communication cables 74 ...
Страница 89: ...75 75 Appendix D ASCII code chart ...
Страница 106: ...Appendix E Sample programs 6F8C1583 92 E ...
Страница 108: ...1583 1 1605 ...