uLan Communication Protocol for Laboratory Instruments, Home Automation and Field Applications
P. Pisa, P. Smolik
Karlovo namesti 13
121 35 Praha 2
tel : +420 2 24357554 fax : +420 2 24357330
e-mail : email@example.com, firstname.lastname@example.org
AbstractThe uLan protocol is message oriented multi-master communication protocol for microcontrollers. It uses 9-bit character format for addressing and link control and RS-485 physical layer. The protocol is used in HPLC instruments and analyzers for instruments control and data acquisition. The protocol has potential to be used in the home automation applications and some other industrial field applications for its open nature design and proven implementation. The software support is provided for more RS-485 cards, converters for PC RS-232 ports and embedded microcontrollers. One of applications utilizing uLan communication is CHROMuLAN HPLC system software, which provides affordable solution for HPLC assay mathematical data processing and complex HPLC instruments sets control over uLan communication network. Other successful field example utilizing uLan communication is agriculture automatic feeding system. Keywords: communication, protocol, RS-485, multi-master, HPLC
1 IntroductionuLan is multi-master message oriented communication protocol which utilizes RS-485 signal levels. Characters are transferred same way as for RS-232 asynchronous transfer except parity bit, which is used to distinguish between data characters and protocol control information and addressing. A physical layer consists of one twisted pair of leads and RS-485 transceivers. Use of 9-bit character simplifies transfer of binary data and for intelligent controllers can lower the CPU load, because of the CPU need not to care about data characters send to other node. One of the problems of 9-bit communications is missing standardization of message protocol. Drivers and formats of one possible implementation of uLan message protocol fills this open area. uLan protocol is used for long time in the modern HPLC systems produced by INGOS company already and its proven design and features made it to extend to the other areas as well. It has been used in medical instruments (infusion pumps), engine control units, automatic feeding system in agriculture and its finding its way into home automation systems now.
2 Little about uLan HistoryThe design of the protocol has been sketched first in 1992 during development of new modular HPLC system for Laboratory Instruments company. The system has been designed as set of autonomous instruments (spectrophotometer and pump at beginning) which could operate separately with local gradient program and classical detector analog output. But mutual digital communication and digital interconnection with a PC computer for data acquisition and chromatographic assay control has been bear in mind from beginning. The pump design has been build upon digital feedback control of DC motor. The spectrophotometric detector has employed high resolution in house made AD converter and fully digital signal processing for absorbance computation which was revolutionary at that time. The main design criteria of communication protocol have been multi master capability, simple physical layer, deterministic media access control, cheap connection to PC computer and low processing power requirements for already fairly loaded microcontrollers in the instruments. The RS-485 physical layer has been selected for its good noise immunity, bus topology, minimal wires count (only 2 wires) and possibility to be galvanically isolated. The selection proved as good choice which win even for other industrial communication technologies, Profibus for example. Use of 9-bit character format simplifies transfer of binary data and for intelligent controllers can lower the CPU load, because of the CPU need not to care about data characters send to other node. Many of todays microcontrollers implement 9-bit extension in their UART (all Intel 8051 and 8096 based MCUs with UART, members of Motorola 683xx family - 68376, Hitachi H8 microcontrollers, TI msp430 to name some of them). Intel has developed a multi-protocol UART i82510, which is very well suited for implementing 9-bit communication interface for PC computers. The second example of the chip, which is well suited for 9-bit communication, is OX16C954-PCI produced by Oxford Semiconductors. A converter and some software workaround for classical PC serial port controllers has been designed from the first uLan day as well. The protocol design has been so capable that base frame format and data exchange pattern has not require revision over last decade. Even object oriented higher layer has been planned from beginning but it has been implemented little later in 1995 when the uLan protocol finds it way into natural gas combustion engine control unit. It has been used there for data acquisition and the engine parameters tuning. The PC side of the software has evolved and changed over the time. The first DOS based implementation of the protocol has been used in the Turbo Visions based development software. Than it has been used for infusion systems monitoring and batch parameters transfers. The uLan has replaced discrete I/O control in amino-acids analyzers control software for DOS called Micro. The protocol implementation has been rewritten as independent full featured driver. It has been developed on Linux system then it has been extended by OS independence layer to support Windows NT kernel mode driver (KMD). The Windows 2000/XP WMD driver model has been added later. The USB to uLan converter support is in development now.
3 uLan Message Protocol
3.1 Message Frames FormatThe data frame is a basic communication unit of the uLan protocol. The frame has its destination ( node address, general address or not addressed reply start ), source node, frame type or command, end mark and integrity check xor_sum. The frame consists of sequence of 9-bit characters. Characters are transferred asynchronously, so every character has one start bit, nine data bits and one stop bit, see fig 1. Total transfer time of one character is equal to transfer of 11 bits. Control characters are transferred with bit D8 equal to one. These control characters appears only on begin and end of the data frame.
- frame should be transferred into the input queue
- frame should be transferred into an input queue, but the sending node is waiting for the acknowledge about successful receiving of the frame. The frame in acknowledged by sending of the character (uL_ACK). In case of xor_sum error or other undefined problem negative acknowledge should be sent (uL_NAK). Delay equivalent to transfer time of more than three characters is considered by the sender as negative acknowledge or missing node with specified address too. The input queue full condition can be signaled to the sender by "wait please" negative acknowledge (uL_WAK). It solves the problem of overloading of the network by repeating attempts to deliver a message to the node, which has no room to receive messages at the moment. The sender node can wait or process other messages before next attempts. uL_Arq cannot be specified for frames with general destination address and reply frames, because of it can lead to parallel sending of uL_ACK from more nodes, which leads to line collision.
- proceed request marks frame that needs immediate processing after reception. Next activity is fully defined by command of the frame (Com). Numerical values of these command should be greater than 80h. Processing of such frame can lead to sending or receiving of next frame (for example memory read and write commands implied to use next frame for data).
- same as uL_Prq, but acknowledge should be sent before a start of the frame processing. uL_NAK should be sent in case, that the command is unknown to the receiver node.
3.2 Access Arbitration and TimingThe RS-485 line has no standard instruments to distinguish an access collision. The collision can be found only by receiving of corrupted message with bad xor_sum. Because the uLan protocol is relatively slow and it is designed to be used for real-time control, it would be bad to rely on such late collision detection. On the other side, usage of centralized arbiter or token passing behaves badly when some node dies and takes piece of bandwidth. That is why deterministic distributed arbitration scheme has been used.
4 End User Applications
4.1 CHROMuLAN SystemThe CHROMuLAN project offers free software for controlling of chromatographic devices and subsequent evaluation of the acquired data. The project has been initiated and is sponsored by the PiKRON company as response for its needs to have affordable control system for its fully digital HPLC instruments. The available commercial HPLC systems software porting would mean non-affordable investments that decision has been made to build open-source system witch basic functionalities together with academic users. For incorporation of other devices (mainly detectors with analog output), an adaptor with 20-bit AD converters and TTL inputs and outputs has been developed. Due to open-source nature of the project, it is possible to create software modules (MS Windows DLLs) for communication with devices of other manufacturers.
CHROMuLAN System Features
- Chromatographic assay quantitative and qualitative evaluation (retention time, area, height, half-width computation, theoretical plates) and protocols printing
- Manual and automatic peaks and baseline detection, component names assignment
- Support for multi-level calibration selectable for each component by means of composed calibration files (*.ULC). Calibration defined as set of line segments or approximated by analytical functions (linear, quadratic, etc. using of least squares method)
- Digital data acquisition through uLan communication bus or plug-in DLL modules
- Instruments control control, the time and gradient program preparation. Delivering of precompiled gradient sequences to the HPLC pump. Interpretation of more complex commands and Pascal language scripts on the PC side
- Support for sequences of samples evaluation and the autosampler control
- Number of the parallel running channels is limited only by computer speed memory, storage and communication interfaces
- All instruments setup parameters and time programs used for chromatographic assay control are archived together with acquired chromatogram data and evaluation method parameters into (*.ULF) file. This enables to fully audit even archival data and use any known good analysis as template for new one. Concept of set of templates describing all conditions coexist with ability to export and import standalone methods and instruments setup files as well.
4.2 Automatic Feeding SystemAgriculture is an another application area where the uLan communication protocol is used in some distributed applications. The Czech company Agrosoft Tábor is producer of FASTOP and FASTOS systems for automatic batch distribution of feed to pigs and cows. The structure of each system consists of an control computer and units for feeding measure and livestock identification. The computer is common PC running Windows operating system and set of communication and user application programs. The communication program receives requests for feeding from the feeding units over uLan communication driver together. The animal RF identification is part of the request. The communication program sends replays back on the base of per animal information stored in Firebird database. Up to 62 units can be connected to one uLan bus. The system takes advantage of uLan multi-master architecture. The control system is not required to periodically poll all units. Each feeding unit contains sensor for measure of remaining feed in a scuttle. When the scuttle is empty the control unit send request directly to unit which is responsible for transport of feed. No information exchange with server is required. The structure of FASTOP system is shown in Figure 6.
4.3 Home AutomationThe multi-master capability of uLan, very low cost interconnection with use of an phone line grade cable, free bus topology, non problematic interfacing to the most low cost microcontrollers and stable drivers for PC operating systems are features which speaks for spreading of uLan into other areas as well. uLan has is not intended for high speed communication or hard real-time data exchange but these features are not required for most task of home automation systems. uLan can be used for heating monitoring and control, lights switching and ring-bells in this area.
5 ConclusionThis paper provides basic facts about uLan protocol and documents its usability on two application which profits from its capabilities. The design and specification have been intended to be open from the beginning. The protocol software implementation for Linux, Windows and embedded microcontrollers is available under open source license on SourceForge site. The authors would invite others partners to use the protocol to solve their communication problems and join uLan protocol adopters group.
File translated from TEX by TTH, version 3.60.
On 16 Oct 2005, 11:34.