background image

L

ON

W

ORKS

 I

NTERFACE

 M

ODULE

O

PEN

N

ET

 C

ONTROLLER

 L

ON

W

ORKS

 I

NTERFACE

 M

ODULE

 U

SER

S

 M

ANUAL

19

27. Main Program

28. *********************************************************/

29. when(reset){

30.     initialize();

31. /* Insert other commands here to execute within when(reset), if required. */

32. }

Header File (fc3asx5l.h)

1.

//Header File: fc3asx5l.h

2.

/*************************************/

3.

/* Common Definition                 */

4.

/*************************************/

5.

#define     LED_OFF     1

6.

#define     LED_ON      0

7.

#define OK              1

8.

#define NG              0

9.

#define HIGH            1

10. #define LOW             0

11. /* Timer Value */

12. #define DTm_5sec        5000

13. /*************************************/

14. /*  Memory Mapped I/O Definition     */

15. /*************************************/

16. #define IO_GA_BASE          0xc000          // I/O Base Address

17. /*************************************/

18. /*  Digital I/O Register Address     */

19. /*************************************/

20. #define GA_FCDR    (IO_G 0x00)      // Data Register

21. #define GA_CSR_ERR (IO_G 0x12)      // Error Register

22. #define GA_FVER    (IO_G 0x18)      // I/O Version Register

23. #define GA_EMID    (IO_G 0x19)      // Expansion Module ID Register

24. #define GA_BCTL    (IO_G 0x1a)

25. /*************************************/

26. /*  I/O Register Bit Definition      */

27. /*************************************/

28. #define BCTL_CENABLE        0x10

29. #define BCTL_NWR_REQ        0x04

30. #define BCTL_NENABLE        0x01

31. #define MAX_FCDR_DATA_LEN   16

32. /* Define Neuron Chip IO pins as follows. */

33. IO_0    output  bit  PO_RUN_LED = HIGH;

34. IO_1    output  bit  PO_ERR_LED = HIGH;

35. IO_2    output  bit  PO_IO_LED = HIGH;

36. IO_3    input   bit  PI_ODE;

37. IO_4    input   bit  PI_RUN;

38. IO_6    output  bit  PO_F_ERR = LOW;

39. /*************************************/

40. /*      Prototype                    */

41. /*************************************/

42. void    initialize(void);

43. void    init_internal_io(void);

44. void    init_external_io(void);

45. void    init_gate_array(void);

46.

47. /*************************************/

48. /*   Global Variable                 */

49. /*************************************/

50. mtimer  io_check_timer;

51. unsigned char csr_error_data;           // CSR_ERROR Reg. data save area

52.

53. void initialize(void){

Summary of Contents for LonWorks FC3A-SX5LS1

Page 1: ...amming Transmit Receive Data Using WindLDR 11 Starting Operation 12 Network Management 12 Precautions for Modifying Application Program 13 LONWORKS Interface Module Internal Structure 14 Data Exchange between LONWORKS Interface Module and CPU Module 16 Application Program Examples 18 Initialization 18 Writing Receive Data to Data Registers in the LONWORKS Interface Module 21 Reading Transmit Data ...

Page 2: ...or modify production lines with reduced cost The transmit receive data quantity can be selected from 0 through 8 bytes 64 bits in 1 byte increments One LONWORKS interface module enables the OpenNet Controller CPU module to transmit 64 bits and receive 64 bits at the maximum to and from the LONWORKS network The network can be configured either in bus or free topology The total transmission distance...

Page 3: ...C before shipment Users do not have to create and install application programs although programmers familiar with Neuron C can also create or modify the application pro gram using a special tool such as LonBuilder Developer s Kit When a user creates or modifies the application program the user must keep a backup file For application program examples see pages 18 through 22 Network Variables The Lo...

Page 4: ...interface module to the right of the OpenNet Controller CPU module A maximum of seven OpenNet interface modules and analog I O modules can be mounted with one OpenNet Controller CPU module A B G RS485 COM A B Z HSC OUT 24V 0V POWER RUN ERROR HSC OUT idec SERVICE REQUEST LON POW RUN ERR I O SER 0 1 2 3 4 5 6 7 10 11 12 13 14 15 16 17 IDEC OpenNet Controller CPU Module I O Module LONWORKS Interface ...

Page 5: ...mmunication cable 5 Status LED Indicates operating status Module Name LONWORKS Interface Module Type No FC3A SX5LS1 Indicator Status Description POW POWER OFF Module power OFF Green ON Module power ON RUN Green ON Normal operation ERR COM_ERROR OFF Normal operation Red ON Communication error I O I O_ERROR OFF Normal operation Red ON Access error to the CPU through I O bus SER SERVICE Yellow ON App...

Page 6: ... 3 shocks each in 3 axes IEC1131 Dielectric Strength Between power terminal on CPU module and FG 500V AC 1 minute Insulation Resistance Between power terminal on CPU module and FG 10 MΩ 500V DC megger Current Draw Approx 30 mA Ground Terminal M3 sems Grounding Resistance 100Ω maximum Grounding Wire UL1015 AWG22 UL1007 AWG18 Weight Approx 180g Communication System LON system Transceiver FTT 10A Fre...

Page 7: ...ules Crimping Tool and Screwdriver for Phoenix Terminal Blocks The screw terminal block of the network interface connector can be wired with or without using ferrules on the end of the cable Applicable ferrules for the terminal block and crimping tool for the ferrules are listed below Use a screwdriver to tighten the screw terminals on the LONWORKS interface module Ferrules crimping tool and screw...

Page 8: ... one resistor and two capacitors as illustrated below Bus Topology Connect terminators to the both ends of the bus topology network Free Topology Connect a terminator to any position on the free topology network R 105Ω 1 1 8W C1 and C2 100 µF 50V note the polarity R 52 3Ω 1 1 8W C1 and C2 100 µF 50V note the polarity R C1 C2 Network Terminator Configuration Terminator Terminator Node Node Node Nod...

Page 9: ...interface module through the CPU bus When this bit goes on the I O LED also goes on b12 transaction timeout This bit goes on when the CPU module fails to receive an acknowledge reply during communication through the LON WORKS network with the acknowledge ACKD service enabled When this bit goes on the ERR LED also goes on The transaction timeout is enabled only when the ACKD service is selected b11...

Page 10: ... within 15 msec the preceding data is not transmitted to the interface module Data communication between the CPU module and the interface module through link registers is not in synchronism with the user program scanning When the CPU is powered up the transmit data in the link registers are cleared to 0 Consequently 0 cannot be transmitted in the first cycle immediately after the CPU is powered up...

Page 11: ...s The Function Area Setting dialog box appears 2 Select the Open Bus tab 3 Select transmit and receive data bytes for module position 1 through 7 where the LONWORKS interface module is mounted 4 Click the OK button and download the user program to the OpenNet Controller Configure Communication Master Module Check Box Check this box only when the remote I O master module is used Quantity of Nodes C...

Page 12: ...When a LONWORKS interface module is mounted in the first slot of all functional modules Transmit Data Receive Data I0 REP 4 S1 65535 D1 R L104 MOV W 65535 L104 through L107 When input I0 is on constant 65535 FFFFh designated by source oper and S1 is moved to four link registers L104 through L107 designated by destination operand D1 All 64 bits 8 bytes in link registers L104 through L107 are turned...

Page 13: ...from other manufacturers such as LonMaker for Windows Integration Tool to install network configuration information An external interface file XIF extension unique to each product series is needed to install the network configuration information The external interface file for the LONWORKS interface module is available from IDEC Find an XIF No printed on the side of the LONWORKS interface module o...

Page 14: ...ram installed in the LONWORKS interface module defines network variables for transmit and receive data listed on page 23 When you modify or create an application program do not use these variable names otherwise ver ification of the application program will be difficult Precautions for writing and reading registers Make a program to write and read data to and from registers in the LONWORKS interfa...

Page 15: ...h 3FFFh is allocated to the Neuron Chip firmware and the remaining 16KB area of 4000h through 7FFFh is allocated to the application program Link Register Flash Memory Status LED Service Request Button Neuron Chip 3150 Transceiver FTT 10A Failure SERVICE RUN IO 0 ERR IO 1 I O IO 2 CPU Module LED LED LED LONWORKS Interface Module RUN IO 6 IO 4 LONWORKS Network Register SER LED Neuron Chip 3150 6KB F...

Page 16: ...uron Chip cannot write data to registers When modifying the appli cation program make sure to turn this pin to 0 when an unrecoverable critical error occurs 1 Normal operation 7 10 unused Address Name Data Flow Direction Description CPU Module Interface Module C000h C007h Data register 8 bytes Allocate network variables to these addresses to exchange data between the CPU and interface modules C008...

Page 17: ...er L 04 When transmit data is stored to link register L 04 in the CPU module the data is transferred to registers in the LONWORKS interface module as illustrated below Register Address in LONWORKS Interface Module Link Register in CPU Module Function Area C000h C001h L 00 Receive Data Communication Data Area C002h C003h L 01 C004h C005h L 02 C006h C007h L 03 C008h C009h L 04 Transmit Data C00Ah C0...

Page 18: ...ion number is stored to register C018h in the LONWORKS interface module or when an expansion module ID is stored to register C019h in the LONWORKS interface module the data is transferred to a link register in the CPU module as illustrated below Register in the LONWORKS Interface Module C012h 8 bits b7 b6 b5 b4 b3 b2 b1 b0 MSB 1 0 0 0 0 0 1 LSB 0 Link Register L 12 in the CPU Module b15 b14 b13 b1...

Page 19: ...LONWORKS 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 ...

Page 20: ...12 Error Register 22 define GA_FVER IO_GA_BASE 0x18 I O Version Register 23 define GA_EMID IO_GA_BASE 0x19 Expansion Module ID Register 24 define GA_BCTL IO_GA_BASE 0x1a 25 26 I O Register Bit Definition 27 28 define BCTL_CENABLE 0x10 29 define BCTL_NWR_REQ 0x04 30 define BCTL_NENABLE 0x01 31 define MAX_FCDR_DATA_LEN 16 32 Define Neuron Chip IO pins as follows 33 IO_0 output bit PO_RUN_LED HIGH 34...

Page 21: ...84 pGA FC3ASX5L_VERSION 85 pGA unsigned char GA_EMID 86 pGA EMID_CODE 87 pGA unsigned char GA_BCTL 88 pGA BCTL_NENABLE 89 dat pGA 90 if dat BCTL_NENABLE 91 pGA BCTL_NWR_REQ 92 break 93 else 94 pGA BCTL_NWR_REQ 95 96 97 The following program turns on the I O LED when initialization fails within 5 seconds and can be modified by the user 98 if timer_expires io_check_timer 99 io_out PO_IO_LED LOW I O ...

Page 22: ...at the application program includes the following codes in italics 1 Input Network Variables 2 network input unsigned char nv_i8 3 define 4 define GA_BCTL 0xC01A 5 define BCTL_NWR_REQ 0x04 6 define GA_FCDR_RX 0xC000 7 8 when nv_update_occurs nv_i8 Acknowledge input network variable update 9 unsigned char pGA 10 unsigned char dat 11 while TRUE 12 pGA unsigned char GA_BCTL Preparation for data write...

Page 23: ...utput 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...

Page 24: ...point inputs 8 bits nv_i8 7 unsigned char 8 point inputs 8 bits nv_i16 BIT16_DAT 16 point inputs 8 bits 2 nv_i24 BIT24_DAT 24 point inputs 8 bits 3 nv_i32 BIT32_DAT 32 point inputs 8 bits 4 nv_i40 BIT40_DAT 40 point inputs 8 bits 5 nv_i48 BIT48_DAT 48 point inputs 8 bits 6 nv_i56 BIT56_DAT 56 point inputs 8 bits 7 nv_i64 BIT64_DAT 64 point inputs 8 bits 8 Output Network Variable Data Type and Stru...

Page 25: ...nsigned char dat 2 BIT16_DAT 16 point outputs 8 bits 2 BIT24_DAT typedef struct unsigned char dat 3 BIT24_DAT 24 point outputs 8 bits 3 BIT32_DAT typedef struct unsigned char dat 4 BIT32_DAT 32 point outputs 8 bits 4 BIT40_DAT typedef struct unsigned char dat 5 BIT40_DAT 40 point outputs 8 bits 5 BIT48_DAT typedef struct unsigned char dat 6 BIT48_DAT 48 point outputs 8 bits 6 BIT56_DAT typedef str...

Page 26: ...voltage at least momentarily Use of a faulty communication line cable other than twisted pair cables or transmission beyond the rated distance Improper terminator Troubleshooting Diagram 1 Are modules installed correctly END Call IDEC for assistance NO NO YES NO NO YES YES Is the POWER LED on the CPU module on Supply power to the power supply terminals on the CPU module Is the POWER LED on the CPU...

Page 27: ... NO YES Is the POW LED on the interface module on Supply power to the power supply terminals on the CPU module See Troubleshooting Diagram 1 The POW LED on the interface module does not go on Is the POW LED on the interface module on Is the RUN LED on the interface module on YES NO YES The RUN LED on the LONWORKS interface module does not go on ...

Page 28: ...WORKS network correctly Connect the interface module to the LONWORKS network correctly Is installation of the network information completed NO Is the ERR LED on the interface module on YES Install the network information YES YES Is the target node operating normally NO Make sure the target node oper ates normally Is the ERR LED on the interface module on YES YES Is the network affected by surround...

Page 29: ...ctly See page 10 See Troubleshooting in the OpenNet Controller user s manual EM333 The SER LED goes on when the Neuron Chip fails to recognize an application program no application program exists or an on chip failure occurs The LONWORKS interface module is shipped with an application program installed in the memory so a problem in the LONWORKS interface module is suspected Call IDEC for assistanc...

Page 30: ...alk protocol 2 LonWorks 1 network system setup 3 M memory map 14 message service 13 modifying application program 13 N network configuration information 2 management 2 12 variables 2 9 23 Neuron chip 2 I O pins 13 15 NV 2 O open system interconnection 2 opennet interface module 1 4 OSI 2 output network variables 23 P programming transmit receive data using WindLDR 11 R reading transmit data 22 rec...

Page 31: ...Mouser Electronics Authorized Distributor Click to View Pricing Inventory Delivery Lifecycle Information IDEC FC3A SX5LS1 ...

Reviews: