Remote Serial over IP
Introduction to serial connections via IP/Ethernet
INTRODUCTION The Ethernet has become a de-facto standard in many industries such as process control, building and plant automation. The DGH A3000 allows any device with a serial port to be networked together using Ethernet networking technology. The A3000 can be configured over WEB Browser, serial Port, Driver Panels, Telnet, SNMP and serves as a transparent serial channel without platform and distance limitation. SERIAL COMMUNICATION Most industrial instrumentation from sensors to systems uses a serial interface to exchange data with supervisory control systems. The RS-232 was the most commonly used asynchronous communication standard. RS-232 is a very simple and well understood interface.
Figure 1.0 Serial communication structure.
When the installations grew more complex, the cabling became more difficult and RS-232 communications became too slow. The limitations of RS-232 no longer fit in many system requirements. The RS-485 communication standard was developed to overcome many of the shortcomings of RS-232. Today there is a wide variety of installed RS-485 hardware, including DGH data acquisition modules. Every installed system and every new product has its own cabling and protocol requirements. If a new device has to be installed, it is necessary to find a suitable connection to adapt with the installed data communication system. Today, that common connection is Ethernet. ETHERNET AND INTERNET TECHNOLOGY In buildings and plants around the world, data transmission via Ethernet is now the de-facto standard. Ethernet is a local area network architecture that is fast and cost effective. It is available in speed ranges beginning at 2 Mbit/s up to 10 Gbit/s. Single cables connect locations together, while many devices can use this connection at the same time. The Internet is a network of networks that uses specific protocols for communication. Using the Internet devices can send data to virtually anywhere in the world. The Ethernet is a link layer that connects a local network to the Internet CONNECT EXISTING DEVICES TO ETHERNET With the movement to Ethernet the question becomes how to connect existing equipment to Ethernet. A direct connection to the network requires modifications to the device. Modifications could include installation of additional hardware, more processing power or special drivers. This can be a difficult, costly process and this solution is specific to this device. The A3000 Serial over IP offers a better approach. The addition of an A3000 server brings the controlling serial port to the device remote from the computer. The network software in the server and in the operating system of the controlling serial port is transparent to the application programs. This server may be controlled from virtually anywhere. Using Internet technology in an existing installation allows a common programming interface between all devices and stations/servers operating in this environment.
Figure 2.0 Network communication structure. SERIAL OVER IP Connecting serial devices over IP-networks is always done in the same way, in terms of hardware installation. The device has a serial port and it is connected to the A3000. The A3000 is then connected to an Ethernet network. After the A3000 is configured it will be accessible via an IP address. Applications can connect to it and to the serial device. Depending on the type of control application the installation can be Driver mode or Raw-IP mode. Both modes are described below. DRIVER MODE In a classic installation for remote computers, the computer has a built-in serial port (often named Com1). This port is attached to the system bus (ISA, PCI ) of the computer. The serial connector (DB-25 or DB-9) is available in the rear of the computer. For long-range data transmission some special cabling and even transceivers are attached to the port of the computer and the remote serial device. For each controlled serial device the computer may also have another serial port (Com2, Com3 ) and more cables to the serial devices.
Serial over IP reduces this equipment drastically. An additional virtual serial port is installed in the computer, often as Com3. Think of this Com3 as a serial port attached to a special kind of system bus. This bus is available over network from the computer. It can reach to every location accessible via IP. On one end of this system bus near the serial device, there is a serial port. This is the serial port installed as Com3.
Figure 3.0 Driver Mode structure. In the classic installation the control application typically communicates via Com1. In reality this means the computer calls software driver functions to perform the communication tasks. The driver is responsible to perform the required operations via the system bus. The serial data is sent through the long cabling to the device. An installation with A3000s behaves quite similar. The application calls some driver functions to perform the communication tasks. The driver is responsible to perform the required operations only this time over the Ethernet. The driver will use the network drivers, but this is invisible to the application. The data is transferred via IP-Network to the serial port of the A3000. There the data appears as normal serial data to the device. As a result the only change for the application is using Com3 instead of Com1. Since applications are normally user configurable this should not be a problem. The A3000 may also be installed as Com1 when necessary. The computer is not restricted to one serial port or one A3000 device. The only limit for virtual serial ports is the limit in the operating system. In Windows 95 to ME this is a maximum of 128 serial ports, in Windows NT and 2000 it is 256. Since there is no
expensive hardware installed in the computer, it is easy to have a backup or redundant system, and run it in parallel.
Figure 4.0 DGH D1311 thermocouple to RS-232 module connected to an A3000 in driver mode. Figure 4.0 shows a DGH D1311 thermocouple to RS-232 module connected to an A3000 in driver mode. A3000 is an industrial-strength network-based serial device server for connecting one RS-232/422/485 device like a DGH sensor to computer module and other devices directly to the 10/100Mbps Ethernet network running TCP/IP. Any host computer can also access remote serial devices by adding A3000 devices to the existing serial port.
Figure 5.0 RS-485 application using DGH D5000 4-Channel Modules Figure 5.0 shows the benefits of combining RS-485 with the network. RS-485 allows communication distances up to 4000 feet and is true multidrop (modules are connected in parallel). This application uses three DGH D5000 four channel J Thermocouple Modules. RS-485 allows the D5000s to be remote from each other. The A3000 allows all twelve channels of thermocouple data to be linked directly to the 10/100Mbps Ethernet network running TCP/IP. TCP RAW MODE In the TCP Raw mode the applications build a direct connection to other applications. The applications communicate using network functions by themselves and not via a virtual serial driver. They communicate using a data structure that is typically referred to as a socket. Therefore the TCP Raw mode is often called the socket mode. In the TCP Raw mode the A3000 acts as a server waiting for incoming connections. When a connection comes in, all data received is sent to the device on the serial port. All data received into the serial port is transferred to the connected system via network. The serial device is now considered IP enabled.
Figure 6.0 Driver Mode connection (left) and TCP Raw Mode connection (right). Control applications profit from network features. Connections to devices are opened on demand. The device is accessed via its IP-Address or a symbolic name available via a DNS database. Different applications on different computers can access the device and it is not necessary to install a driver on the system.
VARIATIONS OF THE BASIC MODES A3000 can be configured to fit in nearly every communication environment. There are variations within Driver mode and TCP Raw mode and these submodes are described below. TCP RAW CLIENT MODE In the TCP Raw Client mode the controlling computer is in Listening state waiting for incoming connections. The A3000 is configured to establish and terminate this connection on special circumstances. In most installations the A3000 is configured to open the connection when data has arrived on the serial port. The data is transferred to the server computer. When no new data has arrived for a specified time, the connection is closed.
Figure 7.0 TCP Client Mode. This is useful for monitoring sensors that send data once every several minutes. The connection is opened by A3000 and closed if no more data is received for e.g. 2 seconds. The controlling computer only needs to collect the sensor data, which arrives in real time. UDP COMMUNICATION UDP is an option when sending small packages of serial data (e.g. temperature sensor). In TCP Raw Client mode, the amount of overhead may be more then the data. However, UDP is not secure. The data is stored in an IP frame as UDP data and sent out. There is no guarantee of delivery but the data is sent faster. UDP can be used if the network that transports the data is reliable or some packet loss tolerated. Since the A3000 does not wait for the computer to accept the data, it is immediately free for other operations.
Figure 8.0 UDP Communication. There is no difference between a Server and a Client in UDP mode. These phrases may be used on the application level, one station offers data and another consumes that data. But on the IP level they operate in the same way. NULL MODEM TUNNEL Null Modem Tunnel mode (also called serial tunnel mode) is a variation of the driver mode where two A3000 modules communicate with each other. The data received on the serial port of one A3000 is transmitted to another A3000 via network or the Internet. The second A3000 receives the Ethernet message and transfers it to the serial port. The data is sent to the serial device using the A3000 serial port settings (Baud Rate, Parity, etc.). This is similar to a pair of A3000 in TCP Raw Server and TCP Raw Client mode. However, when connected as a Null Modem tunnel, the status and control signals (RTS/CTS, DTR/DSR) are also transferred between the two A3000 modules to operate as a serial Null Modem cable.
Because each A3000 has a serial port, the serial devices connect to the A3000 do not need to communicate at the same Baud Rate and Parity type. In rare cases it may be necessary for one device to operate at a different Baud Rate than the other serial device. The A3000 will support different baud rates at each end of the Null Modem Tunnel.
Figure 9.0 Null Modem Tunnel. This mode is recommended when it is necessary to connect two serial devices that cannot communicate using the same serial communications parameters.
Figure 10.0 Continuous Analog Input/Analog Output Using Serial Tunneling The DGH D4000 series are complete computer-to-analog output modules. They contain a 12-bit DAC (Digital-to-Analog Converter) which is scaled to provide commonly used current and voltage output ranges. D4000 units may be configured to operate in a special mode called Continuous Input Mode. The mode allows the D4000 to be slaved directly to a DGH D1000 or D2000 sensor interface module. In figure 10.0, a DGH D1251C sensor module is used to convert a 4-20mA process signal to ASCII data. The D1251C is operated in continuous output mode to produce data without a host. The D1251C will produce an ASCII output data string after every analog-to-digital conversion, approximately eight times a second. The data output is connected to the Ethernet via an A3000 operating in serial tunneling mode which allows the data to be transmitted to another A3000 module which may be located thousands of miles away. The receive A3000 feeds the data to the D4261 module. The D4261 is configured in continuous input mode which allows it to accept the data string as an analog output command. The D4261 will respond by producing an output of 20mA. The net result of this connection is that the process variable sensed by the D1251C may be accurately reproduced by the D4261 over an Ethernet or intranet. The D4261 output will follow the input signal applied to the D1251C. No host is necessary on either end to provide a continuous signal.
10
Figure 11.0 Continuous Digital Input/Digital Output Using Serial Tunneling In this configuration two D1711 digital input/output modules are set to a special mode called Continuous Input Mode which allows the module to respond to data transmitted by another module. A module in Continuous Input Mode may be paired with a module in Continuous Output Mode to provide digital data transfer without a supervisory host. Module #1 on the left is setup in Continuous Output Timer Mode to output data every 10 seconds. Module #1 will read the state of the digital inputs and produce data messages on the communications bus. Module #2 on the right is setup for Continuous Input Mode. The digital I/O lines of module #2 are assigned as outputs. In continuous input mode, module #2 will use the data from module #1 as a command to control the digital outputs. The net effect is that the outputs of module #2 are controlled directly by the inputs of module #1. As a result, the state of the digital inputs on module #1 is recreated at the digital outputs of module #2. Since module #1 is continually outputting data on the communications lines, any changes in the state of the digital inputs on module #1 will be transmitted to module #2 and the output lines will change to reflect the new state. The A3000 modules used in serial tunneling mode provide the connection to the Ethernet or in Internet.
11
Figure 12.0 Bidirectional Continuous Digital Input/Digital Output Using Serial Tunneling To provide bidirectional data transfer from one location to another, simply use two pairs of D1711 modules setup as previously and two A3000 modules in serial tunneling mode. Figure 12.0 shows the bidirectional capability of the A3000.
GLOSSARY OF TERMS DNS: Domain Name System An Internet service that translates domain names into IP addresses. IP: Internet Protocol The basic definitions for data packages, these Internet frames are stored and transported embedded in data frames of the local network. IP-Address: Internet Address The Internet address is noted as a group of 4 decimal numbers. Each station on the Internet has a unique address. Some ranges are reserved for private networks, not connected to the Internet. RS-232/V.24: common serial transmission Characters are sent as separate bits, timing is well defined. The medium is copper cable, using typical 12V. Each signal is defined related to a 12
common ground; one wire per signal plus GND. RS-232 is a point-to-point connection. RS-422: Industrial serial transmission with multidrop capability. Allows higher speed, longer cables and is resistive against electrical noise.RS-422 allows for up to 16 receivers. The transmission is via a twisted pair copper cable using differential signals. Sender and receivers must share a common voltage range (max. 7V difference). Two lines per signal, plus common GND. RS-422 is a point-to-multipoint connection. RS-485: Industrial serial transmission (multipoint) The signals and cables are the same as RS-422. The transmitters can go tri-state. Several stations can send data on the same lines at different times. RS-485 is a multipoint-to-multipoint connection. TCP/IP: Transmission Control Program/Internet Protocol TCP establishes connections between two partners via the Internet. The data is sent in IP-frames, each frame is acknowledged be the recipient. Lost packages are repeated. Software using TCP has a secured transmission; the delivery of the data is guaranteed. UDP: User Datagram Protocol Similar to TCP the data is sent in IP-frames. But in opposite there is no connection or acknowledge by the recipient. The transmission is faster for small data, but data can get lost. Software using UDP must handle the related problems.
13