LonWorks, launched by Echelon Systems in 1992, is a local operation network initially used for building automation but quickly expanded to industrial field networks. LonWorks technology provides a complete, open, and ready-made solution for designing and implementing interoperable control networks. I. LonWorks' Neuron Chip The core of LonWorks technology is the Neuron Chip. This chip contains three microprocessors: a MAC processor for media access control; a network processor for OSI layers 3-6; and an application processor for user field control applications. They exchange data via shared memory. The control unit requires data acquisition and control functions; therefore, the Neuron Chip has 11 I/O ports. These I/O ports can be flexibly configured to interface with peripheral devices, such as RS232, parallel ports, timers/counters, interval processing, and bit I/O. The Neuron Chip also has a time counter, enabling watchdog timer, multi-task scheduling, and timing functions. The Neuron Chip supports a power-saving mode, in which the system clock and counter are turned off, but the status information (including information in RAM) remains unchanged. The system activates upon changes in I/O status or network information. Internally, it also features a medium-independent transceiver with a maximum speed of 1.25 Mbps. Thus, this small neural network chip not only possesses powerful communication capabilities but also integrates data acquisition and control. Ideally, a neural network chip, along with a few discrete components, can become an independent control unit in a DCS system. II. A Comprehensive Development Platform LonWorks provides more than just a high-performance neural network chip; more importantly, it offers a complete development platform. Communication in industrial settings involves not only real-time data transmission and reception but also data packaging, depackaging, flow processing, and error handling. This forces control engineers to invest significant effort in data communication. LonWorks provides a user-friendly service in this regard, offering a complete network building tool—LonBuild. Firstly, it provides a C language compiler, significantly reducing development time. This compiler offers comprehensive library functions for 11 I/O operations. Regarding communication, it also introduces a new concept—network variables. Through network variables, communication on the network simply requires connecting the network variables on the relevant nodes. Network variables are special static variables defined by the application. They can be of various types defined by ANSI C, or custom types, and can also have specified priorities, response methods, etc. Network variables are defined as inputs or outputs. When a network variable defined as an output is assigned a new value, the input network variables connected to that output variable will immediately be assigned the same new value. In addition, LonBuild integrates the development environment and compilation, has a C debugger, can debug applications on multiple emulators, and has network protocol analysis and communication analysis capabilities. III. LonTalk: An Object-Oriented Network Communication Protocol. LonTalk is the communication protocol of LonWorks, embedded in the neural network chip. The LonTalk local operation network protocol is a framework for communication in LonWorks, supporting the 7-layer protocol of the OSI reference model defined by the ISO organization, and enabling highly reliable transmission of concise control information across various media. The LonTalk protocol is a directly object-oriented network protocol, specifically implemented using network variables. Furthermore, due to hardware chip support, it meets the real-time and intuitive, concise interface requirements of fieldbus applications. 1. Features of LonTalk MAC: The Media Access Control (MAC) sublayer is part of the data link layer of the OSI reference model. Currently, various media access control protocols exist in different networks, one of which is the familiar CSMA (Carrier Signal Multiple Listen). LonTalk uses this protocol but has its own unique features. For token bus networks, LonTalk adds the network address to the token, thus establishing a logical ring structure on the physical bus, allowing the token to poll around this logical ring. However, in low-speed networks, the token polling time becomes very long. Furthermore, network reconstruction occurs when a node joins or leaves the token bus. In battery-powered systems, frequent sleep and wake-up cycles lead to frequent network reconstructions during joining and leaving the network; in harsh environments, token loss often results in network reconstruction. These network reconstructions significantly reduce network efficiency. Additionally, due to network address limitations, each network can only have a maximum of 255 nodes. Commonly used CSMA/CD (such as Ethernet) performs well under light loads; however, under heavy loads, excessive collisions make the network efficiency extremely low. Currently, another very popular network in fieldbuses is CANbus. It adopts a masterless structure, which is far superior to Bitbus. Its MAC layer management is very distinctive. It also adopts the CSMA method, but divides the nodes on the network into different priorities, and uses the dominant bit (0) and the yield bit (1), as well as the bus readback method to achieve non-destructive bus arbitration. That is, when two nodes transmit information to the network at the same time, the node with lower priority actively stops transmitting, while the node with higher priority can continue to transmit without being affected, which can effectively avoid bus collisions. However, this requires the network to be synchronized, which is obviously not suitable for multi-media situations. In addition, for networks where each node does not need priority, since a priority must be defined, some low-priority nodes may not be able to send information for a long time when the network communication is busy. Therefore, Canbus is more suitable for small networks with a single medium and a small number of nodes. In summary, Lon's MAC sublayer has the following advantages: it supports multi-media communication, supports low-speed networks, can maintain network performance under heavy load, and supports large networks. 2. LonTalk's support for priority In LonWorks networks, an optional priority mechanism is provided to improve the response time of emergency events. This mechanism allows users to allocate a specific priority time slice to each node requiring priority, ensuring that exactly one node has such a priority time slice. During transmission, the priority datagram will be sent out within that time slice. Priority time slices range from 0 to 127, where 0 means immediate transmission without waiting, 1 means waiting for one time slice, 2 means waiting for two time slices, and so on. Lower priority nodes need to wait for more time slices, while higher priority nodes need to wait for less time slices; this time slice is added before the P-probability time slice. Non-priority nodes must wait for all priority time slices to complete before waiting for the P-probability time slice to send. Therefore, nodes with priority always have a faster response time than non-priority nodes. 3. LonTalk's Support for Multiple Media The LonTalk protocol supports various media independently. Lon's neural network chip can tolerate a wide range of communication media types, such as twisted pair, power line, radio, infrared, coaxial cable, and fiber optic. 4. LonTalk's Support for Multiple Channels A channel refers to a segment of media that can physically send messages independently (without forwarding). LonTalk specifies that a channel can have a maximum of 32,385 nodes, and a network can consist of one or more channels connected by routers. This not only enables multi-media connections on the same network but also alleviates network congestion on a single channel. The CSMA protocol requires a node to listen for network idle time before sending data. Different protocols act differently once idleness is detected. This can lead to varying outcomes under heavy load. For example, Ethernet uses the CSMA/CD protocol, employing an avoidance algorithm upon collision detection, which results in extremely low network transmission rates under heavy load. Other CSMA protocols use time-slice rules to access the medium, limiting node access time and significantly reducing the likelihood of collisions. P-persistent CSMA and LonTalk's CSMA both use time-slice access. LonTalk uses an improved CSMA media access control protocol called predictive P-persistent CSMA. While retaining the advantages of CSMA, LonTalk addresses its shortcomings in control. Current MAC protocols (such as IEEE 802.2, 802.3, 802.4, and 802.5) cannot effectively maintain network efficiency under heavy loads, support large network systems, and multiple communication media. If many network nodes are waiting for network idle time, they will immediately send messages once the network becomes available, causing collisions. After a collision, they will back off for a period of time; if this time is the same, repeated collisions will occur, significantly reducing network efficiency. In predictive P-persistent CSMA, all LonWorks nodes wait for random time slice intervals to access the medium, thus avoiding the above situation. In LonWorks, each node inserts 1 to 16 very small random time slices before sending. In an idle network, each node inserts an average of 8 random time slices before sending. In P-persistent CSMA, when a node has information to send, it does not send immediately but waits for a random time slice with probability P. The LonTalk protocol can dynamically adjust the value of P based on network load. The time slice is increased by a value N, with N×16 random time slices inserted. The value of N ranges from 1 to 63. LonTalk refers to N as an estimate of the network backlog, which is an estimate of how many nodes have messages to send in the current transmission cycle. The LonTalk protocol dynamically adjusts media access based on the network backlog, allowing the network to use shorter time slices under light load and longer response time slices under heavy load. Comparative experiments show that with 36 interconnected LonWorks nodes, using the general P-persistence algorithm, the collision rate increases from 10% to 54% when the number of packets to be transmitted per second reaches 500-1000; while using the predictive P-persistence algorithm, the collision rate is comparable to the general P-persistence algorithm below 500 packets, and stabilizes at 10% between 500 and 1000 packets. For all token ring networks, LonTalk supports multiple media, but these media must have a ring structure on the bus, with the token round-robin on this ring. This is clearly not feasible for networks using power lines and radio as media, because all nodes on the network can receive the token almost simultaneously. Meanwhile, token ring networks also require additional recovery mechanisms for lost tokens and fast token response mechanisms, which increase hardware overhead and network costs. 5. LonTalk's support for large networks: Network addresses can have the following three-layer structure: The first layer is the domain. The domain structure ensures that communication in different domains is independent. For example, different application nodes may coexist in the same communication medium (such as radio), and the distinction between different domains ensures their applications are completely independent and will not interfere with each other. The second layer is the subnet. Each domain can have a maximum of 255 subnets. A subnet can be a logical group of one or more channels. Some intelligent router products with a subnet layer can enable data exchange between subnets. The third layer is the node. Each subnet can have a maximum of 127 nodes, so a domain can have a maximum of 255 × 127 = 32385 nodes. Any node can belong to one or two domains, allowing a node to act as a gateway between two domains, and allowing a sensor node to send collected data to two different domains. Nodes can also be grouped, with a group spanning several subnets or channels within a domain. A domain can contain a maximum of 256 packets, each packet can have a maximum of 64 nodes requiring acknowledgment service, and the number of nodes without acknowledgment service is unlimited. A node can be assigned to 15 packets to receive data. The packet structure allows a message to be received by multiple nodes simultaneously. Additionally, each neuron chip has a unique 48-bit ID address. This address is defined by the manufacturer and is generally only used during network installation and configuration; it can serve as the product's serial number. Channels do not affect the network's address structure; domains, subnets, and packets can span multiple channels. 6. LonTalk Message Services The LonTalk protocol provides four types of message services: • Acknowledgment-based or end-to-end acknowledgment service: When a node sends a message to another node or packet, each receiving node acknowledges the sender. If the sender does not receive all acknowledgments within the acknowledgment time, it retransmits the message. The number of retransmissions and the acknowledgment time are optional. The message acknowledgment service is handled by the network processor and does not require application intervention. The message ID number ensures that nodes do not receive duplicate messages. • Request/Response Method: When a node sends a message to another node or packet, each receiving node responds to the sender individually. If the sender does not receive all responses within the response time, it retransmits the message. The number of retransmissions and the response time are optional. The message response service is handled by the application processor and can contain data. It is suitable for remote procedure calls and client/server applications. • Non-Apology Retransmission Method: When a node sends a message to another node or packet, it does not require each receiving node to respond to the sender. Instead, it retransmits the same message multiple times to ensure the message is received reliably by the receiver. This method is suitable for broadcasting packets with many nodes, thus avoiding network overload due to node responses. • Non-Apology Method: When a node sends a message to another node or packet, it does not require each receiving node to respond to the sender, nor does it need to retransmit the same message multiple times. It only needs to be sent once. This method is suitable for messages with low reliability requirements but long message lengths and high speed requirements. 7. LonTalk Network Authentication: LonTalk supports message authentication. During network setup, both sender and receiver agree on a 6-byte authentication word. The receiver checks if the message has been authenticated by the sender; only messages authenticated by the sender are accepted. 8. Collision Detection: LonTalk supports hardware collision detection on the communication medium (e.g., twisted pair). LonTalk can automatically cancel and retransmit a colliding message in progress. Without collision detection, if a collision occurs, the message will only be retransmitted after a response or acknowledgment timeout. IV. LonWorks and Fieldbus According to the International Electrotechnical Commission (IEC), low-level or bottom-level industrial data buses are called fieldbuses. Their basic requirements include: replacing traditional 4-20mA signal transmission with serial communication; a single fieldbus can provide multi-point connections for numerous addressable field devices; supporting the exchange of information between low-level intelligent field devices and high-level systems using a common medium; and the fieldbus protocol having the same meaning as the OSI model at the physical and data link layers. Currently, the basic requirements of fieldbus products launched by some companies and manufacturers are largely similar to those mentioned above. As can be seen from the preceding analysis of LonWorks, LonWorks' performance covers the IEC recommended specifications for fieldbuses, and its application is more flexible. ① The neuron chip is an excellent low-cost fieldbus processor. It handles all field interconnection tasks, as well as the actions of field sensors and actuators, and simple digital logic operations. ② Taking the fieldbus functional requirements defined by IEEE P1118 (ver 3.0) as an example, a comparison is made with the performance of LonWorks: the comparison at the physical layer is shown in Table 2, the comparison at the link layer is shown in Table 3, and the comparison at the application layer is shown in Table 4. ③ LonTalk is a subset of the OSI reference model for field object applications. It has a wider functional coverage than the traditionally recommended fieldbus, such as supporting multiple media and large networks. This provides a global solution for the integrated measurement, control, and management of factory manufacturing automation, and all of this can be achieved through a neuron chip with the LonTalk protocol embedded. A bridge consisting of a neuron connected to a dedicated controller of a certain network is needed for interconnection with production management and plant levels. Furthermore, it offers more user-friendly and convenient application services than previous fieldbus solutions, allowing users to define and connect network variables simply by object. ④ LonWorks supports various topologies, not limited to buses; different transceivers can be selected to construct star, ring, tree, or hybrid structures. Addressing is handled by protocols, making field interconnection more flexible. In summary, LonWorks is a completely new fieldbus. It provides an interoperable control network for fully distributed field devices and has been recognized by over 140 companies and organizations worldwide, forming the LonMark Association. Currently, 1500 organizations have chosen it, successfully implementing application systems across various industries.