![IDEC OpenNet series User Manual Download Page 379](http://html.mh-extra.com/html/idec/opennet-series/opennet-series_user-manual_617384379.webp)
26: L
ON
W
ORKS
I
NTERFACE
M
ODULE
26-18
O
PEN
N
ET
C
ONTROLLER
U
SER
’
S
M
ANUAL
Application Program Examples
This section describes application program examples for initializing the registers in the L
ON
W
ORKS
interface module,
writing receive data to data registers, and reading transmit data from data registers.
Initialization
Before starting L
ON
W
ORKS
communication through the network, the data registers in the L
ON
W
ORKS
interface module
have to be initialized. The initialization sequence is illustrated in the chart below:
The following program is an example of an application program in Neuron C to initialize the L
ON
W
ORKS
interface mod-
ule, consisting of initialization codes and a header file. When you modify or create an application program, make sure that
the application program includes the following codes in italics.
Initialization Codes
1.
///////////////////////////////
2.
/// PRAGMA ///
3.
///////////////////////////////
4.
#pragma scheduler_reset
5.
/********************************************************
6.
Network Variable
7.
********************************************************/
8.
/* Define network variables */
9.
/********************************************************
10. Write the software version number to C018h
11. *********************************************************/
12. #define FC3ASX5L_VERSION 0x10
13. /********************************************************
14. Write the expansion module ID to C019h
15. *********************************************************/
16. #define EMID_CODE 0x50
17. /********************************************************
18. include file
19. *********************************************************/
20. #include <access.h>
21. #include <msg_addr.h>
22. #include <control.h>
23. #include <status.h>
24. #include <snvt_lev.h>
25. #include “fc3asx5l.h” /* Refer to the header file shown below */
26. /********************************************************
NO
YES
Is the register initial-
ization complete?
Power up
when(reset) Initialization
Star t to execute a user program.
Initialization is not complete.
I/O LED goes on.
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: [email protected]