Reading Transmit Data From Data Registers In The Lon Works Interface Module - IDEC LonWorks FC3A-SX5LS1 User Manual

Interface module
Table of Contents

Advertisement

L
W
I
ON
ORKS
NTERFACE
Reading Transmit Data from Data Registers in the L
The following diagram is a typical example of reading transmit data from the data registers in the L
module.
Preparation for data read
Is preparation for data
read complete?
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
5.
#define GA_FCDR_TX
6.
#define BCTL_NWR_REQ
7.
#define HIGH
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;
18.
*pGA |= BCTL_NWR_REQ;
19.
dat = *pGA;
20.
if (dat & BCTL_NWR_REQ){
21.
22.
23.
24.
25.
nv_o8 = tx_dat;
26.
27.
}
28.
}
29.
}
30. }
22
M
ODULE
NO
YES
Read data
End data read
0xC01A
0xC008
0x04
1
pGA = (unsigned char *)GA_FCDR_TX;
tx_dat = *pGA;
pGA = (unsigned char *)GA_BCTL;
pGA &= ~BCTL_NWR_REQ;
/* Substitute the value for output network variable (nv_o8) */
break;
O
N
C
PEN
ET
ONTROLLER
W
Interface Module
ON
ORKS
/* Preparation for data read */
/* Preparation for data read complete */
/* Read data from register C008h */
/* End data read */
L
W
I
M
ON
ORKS
NTERFACE
ODULE
W
ON
U
'
M
SER
S
ANUAL
interface
ORKS

Advertisement

Table of Contents
loading

Table of Contents