EasyManuals Logo

IDEC OpenNet series User Manual

IDEC OpenNet series
427 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #383 background imageLoading...
Page #383 background image
26: LONWORKS INTERFACE MODULE
26-22 OPENNET CONTROLLER USERS MANUAL
Reading Transmit Data from Data Registers in the LONWORKS Interface Module
The following diagram is a typical example of reading transmit data from the data registers in the LONWORKS interface
module.
Application Program Example for Data Read
The following program is an example to substitute transmit data of data register C008h for an 8-bit output network vari-
able (nv_o8). When you modify or create an application program, make sure that the application program includes the fol-
lowing codes in italics.
1. /* Output Network Variables */
2. network output unsigned char nv_o8;
3. /* define */
4. #define GA_BCTL 0xC01A
5. #define GA_FCDR_TX 0xC008
6. #define BCTL_NWR_REQ 0x04
7. #define HIGH 1
8. /* Define IO_4 RUN */
9. IO_4 input bit PI_RUN;
10.
11. when(TRUE){
12. unsigned char *pGA;
13. unsigned char dat;
14. unsigned char tx_dat;
15. while(TRUE){
16. if (io_in(PI_RUN) == HIGH){
17. pGA = (unsigned char *)GA_BCTL; /* Preparation for data read */
18. *pGA |= BCTL_NWR_REQ;
19. dat = *pGA;
20. if (dat & BCTL_NWR_REQ){ /* Preparation for data read complete */
21. pGA = (unsigned char *)GA_FCDR_TX;
22. tx_dat = *pGA; /* Read data from register C008h */
23. pGA = (unsigned char *)GA_BCTL;
24. pGA &= ~BCTL_NWR_REQ; /* End data read */
25. nv_o8 = tx_dat; /* Substitute the value for output network variable (nv_o8) */
26. break;
27. }
28. }
29. }
30. }
NO
YES
Is preparation for data
read complete?
Preparation for data read
Read data
End data read
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: info@clrwtr.com

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IDEC OpenNet series and is the answer not in the manual?

IDEC OpenNet series Specifications

General IconGeneral
BrandIDEC
ModelOpenNet series
CategoryController
LanguageEnglish

Related product manuals