LonWorks Introduction Hwayoung Chae
Contents Introduction Neuron Chip LonTalk Protocol Addressing SNVT LonTalk Communication Method Neuron C Application Installation Step LonMark Object
Introduction LON – Local Operating Network by ECHELON Open Control System BA, FA, HA Configuration LonWorks Device - Neuron Chip & Transceiver LonTalk protocol LNS(LonWorks Network Services) User Application
Neuron Chip
Characteristic Three 8-bit processor On-chip memory Two 16-bit timer/counter 11 Programmable I/O port Network communication port
LonTalk Protocol Variable transmission media – TP, RF, PL, Optical Fiber, IR Priority based transmission Suitable Message – NV, Explicit Message Hierarchical addressing – 2 48 domain, node Authentication service Interoperability – LonMark (SNVT)
LonTalk Protocol OSI 7 Layer Physical Layer – TP, PL, RF MAC Sublayer – CSMA Link Layer – connectionless, frame encoding, error detection Network Layer – packet transmission, routing Transport & Session Layer – process order, message processing, authentication Presentation & Application - Node Service
Addressing Addressing Method – 3, 4 layer (domain, subnet, node) (domain, subnet, neuron id) (domain, group, member) Domain – 0,1,3,6 byte Subnet, group – 8 bit Node – 7 bit Member – 6 bit
SNVT Application parameters LonMark NV Type for Interoperability Network input/output [class] type identifier [=initial value] Network input byte nviInputData
LonTalk Communication Method
Explicit Message transmit addressing information & data directly 228 bytes Network Variable : Using SNVT Message Service ACKD, Request/Response service Repeated service, Unacknowledged
TASK
Neuron C Network Variable Input/Output Object, Binding network input byte nviInputData network output bit nvoOutData Event-driven way – priority based When(Event_1) { // Event_1 content } Software Time – ms timer, sec timer
Application Installation Step Addressing Assign each node to the address Binding Connect between nodes logically Configuration Configure the communication environment between nodes
Application Installation Installation tool Configure the network with the network manager which send the network message to neuron chip Neuron Chip Base PC Base LonManager LonMaker for MS-DOS LonWork Network Service(LNS) for Windows
LonMark Object Basis of interoperability Describe standard formats how information is input to and output from a node how information is shared with another nodes on the network Define set of one or more network variable input and output(SNVT)
Neuron-based Device
Host-based Device
LonWorks Host Application Hwayoung Chae
Contents Overview Host application architecture Application buffer Network Interface Configuration Options Sending Messages Receiving Messages Binding to a Host Node Network Driver Sample host application
Overview of the host application architecture Host application are application programs running on hosts other than NEURON CHIPs that use the LONTALK protocol to communicate with nodes on a LONWORKS network Host applications can be used for any type of application, but the most typical uses are network management, network control, and network monitoring.
Host application architecture
Overview of the host application architecture Network driver The software that interface the host application to the host interface hardware. Host interface The hardware interface between the host processor and the network interface. Network interface A device that provides an interface between a host and a LONWORKS network.
Host Application Architecture Application Layer Send and receive LONTALK messages Link Layer Ensure reliable delivery of packets between the host and the network interface Control the network interface Physical Layer Physical interface between the host interface and the network interface
Application buffer Network Interface Command Application buffer type and size Message Header LONTALK messages type Network Address Destination address for downlink and source address for uplink Data Transferring data
Network Interface Configuration Options Network variable processing option When network interface selection the host can declare up to 62 network variables When host selection the host can declare up to 4096 network variables When a network variable update occurs. 1. Target address decoding. 2. Network variable selection. 3. Network variable modification.
Network Interface Configuration Options Network variable configuration table size option When network interface selection is specified, this option defines the size of the network variable configuration table on the network interface. Explicit addressing option Specifying “explicit addressing on” adds an 11byte explicit address field to every application buffer.
Sending Messages 1. Building the message within the application buffer data structures 2. Write the application buffer to the network driver 3. Repeat step 2 if the driver returns the LDV_NO_BUFF_AVAIL or LDV_DEVICE_BUSY error codes 4. If necessary, process an response message from the network interface 5. Process the completion event message from the network interface
Receiving Messages Application Messages Network variable updates Poll request Response to a poll Explicit messages Network management or Network diagnostic messages is processed by the Neuron Chip within the network interface with following exceptions Set Node Mode, Wink Update Net Variable Config Query Net Variable Config, etc.
Differences between host selection and network interface selection
Binding to a Host Node SNVT Import Import the network variable descriptions over the network Using SNVT network management command External Interface File Import Copy or create an external interface file Add the network variable and message tag entries. Import this new external interface file to the network management tool
Network Driver Provides a device-independent interface between the host application and the network interface Standard Network Driver ldv_open(char *device_name) ldv_read(LNI handle, void *msg_p, unsigned length) ldv_write(LNI handle, void *msg_p, unsigned length) ldv_close(LNI handle) Driver Direct Functions ldv_write_direct(), ldv_read_direct(), ldv_register()
Sample host application
Further Work Host application code EasyLon linux device driver code Simple demonstration with above two etc…