ADAM-4577 1 Port Universal Serial Device Gateway User's Manual
Copyright Notice This document is copyrighted, 2001, by Advantech Co., Ltd. All rights are reserved. Advantech Co., Ltd., reserves the right to make improvements to the products described in this manual at any time without notice. No part of this manual may be reproduced, copied, translated or transmitted in any form or by any means without the prior written permission of Advantech Co., Ltd. Information provided in this manual is intended to be accurate and reliable. However, Advantech Co., Ltd.
Advantech Customer Services Each and every Advantech product is built to the most exacting specifications to ensure reliable performance in the unusual and demanding conditions typical of industrial environments. Whether your new Advantech equipment is destined for the laboratory or the factory floor, you can be assured that your product will provide the reliability and ease of operation for which the name Advantech has come to be known. Your satisfaction is our number one concern.
Product Warranty Advantech warrants to you, the original purchaser, that each of its products will be free from defects in materials and workmanship for two years from the date of purchase. This warranty does not apply to any products which have been repaired or altered by other than repair personnel authorized by Advantech, or which have been subject to misuse, abuse, accident or improper installation. Advantech assumes no liability as a consequence of such events under the terms of this Warranty.
product returned without dated proof of purchase is not eligible for warranty service. 5. Write the RMA number visibly on the outside of the package and ship it prepaid to your dealer.
Contents Chapter 1: Overview ........................................ 1 1.1 Introduction ..................................................................... 2 1.2 Features .......................................................................... 3 1.3 Specifications ................................................................. 3 1.4 Package Checklist .......................................................... 4 Chapter 2: Getting Started .............................. 5 2.1 Understanding ADAM-4577 ..
3.2.4.1 3.2.4.2 3.2.4.3 3.2.4.4 3.2.4.5 3.2.4.6 TCP(UDP) Port number ........................................... 32 Only configure the authorized IP .............................. 33 Allow any IP to access .............................................. 33 The specified IP which can access ......................... 33 Port Mode .................................................................. 34 Protocol for Communication .................................... 35 3.3 Testing Utility ........................
Figures Figure 2-1 Figure 2-2 Figure 2-3 Figure 2-4 Figure 2-5 Figure 2-6 Figure 2-7 Figure 2-8 Figure 2-9 Figure 2-10 Figure 2-11 Figure 2-12 Network architecture: Polling ................................................... 7 Network architecture: Event-handling ..................................... 7 Network architecture: Peer-to-peer ......................................... 8 ADAM-4577—Top Panel ........................................................... 10 ADAM-4577—Front Panel .......................
Figure 4-1 Figure 4-2 Figure 4-3 Figure 4-4 Figure 4-5 Figure 4-6 Figure 4-7 Figure 4-8 Figure 4-9 Figure 4-10 Figure 4-11 Figure 4-12 Figure 4-13 Figure 4-14 Figure 4-15 Figure 4-16 Network architecture-Polling .................................................. 52 Flow chart-Polling network ..................................................... 53 Polling Setting Windows .......................................................... 53 Network architecture-Event handling ....................................
Tables Table 2-1 ADAM-4577 LED Definition .........................................................
Chapter 1 Overview
1.1 Introduction The ADAM-4577 is a peer-to-peer data gateway between RS-232/422/485 and Ethernet interfaces. This unit immediately upgrades your existing device for integration into the Internet world. The ADAM-4577 makes your serial devices behave just like networking devices. You can issue commands or transmit data from one serial device, which connected to ADAM-4577, to any devices that are connected to the Internet. This provides greater flexibility.
adjust all settings easily. In addition,the utility provides a security option that protects all configuration settings from being changed inadvertently.The download & testing utility helps you to diagnose the communication condition between devices. 1.
Network: RJ-45 Serial: DB-9 • Transmission speed: 300 bps to 230 Kbps • Parity bit: odd, even, none, space, mark • Data bit: 5, 6, 7, 8 • Stop bit: 1, 1.5, 2 • Diagnostic LEDs: Network: • Utility Software: Auto-detecting configuration utility Easy-to-diagnostic download & testing utility • Power Requirements: unregulated 10 to 30 Vdc with surge protection • Power Consumption: 1.
Chapter 2 Getting Started
This chapter includes an overview of the ADAM-4577 hardware installation procedures. As mentioned in the previous chapter, the ADAM-4577 comes ready for all network connections, including Ethernet, and RS-232/422/485 port connections. 2.1 Understanding ADAM-4577 The ADAM-4577 is an advanced peer-to-peer data gateway unit. It extends traditional RS-232/422/485 interfaces to Ethernet network. Through networking, you can control and monitor remote serial devices either over a LAN or over the WAN.
The following illustration shows the network architecture as below: PC Data or Command Internet Eth ernet ADAM ADAM-4577 RS-232/422/485 Port 2 Port 1 +Vs GND RS-485 RS-232 ADAM-5000 ADAM-4000 Bar code Reader Figure 2-1 Network architecture:Polling PC Data or Command Event Internet Eth ernet ADAM ADAM-4577 RS-232/422/485 Port 2 Port 1 +Vs GND RS-485 RS-485 ADAM-5000 ADAM-4000 PLC Figure 2-2 Network architecture:Event-handling Chapter 2 Getting Started 7
Internet Data or command Et he rn et Et he rn et ADAM ADAM-4577 RS-232/422/485 Port2 Port1 ADAM ADAM-4577 RS-232/422/485 +Vs GND Port2 Port1 +Vs GND RS-485 RS-485 ADAM-5510 ADAM-5510 Figure 2-3 Network architecture:Peer-to-peer 2.1.2 Serial Architecture The ADAM-4577 provides data modes to meet your needs. The Data mode provides a certain amount of transparence and flexibility in transmitting data between two devices.
2.1.3 Top / Front / Rear View There are three network status LEDs located on the top panel of ADAM-4577, each with its own specific function.
Figure 2-4 ADAM-4577—Top Panel Status/Power Speed/Link TX/RX (Ethernet) TX/RX (Port1) TX/RX (Port2) RS-232/422/485 Port1 +Vs GND Figure 2-5 ADAM-4577—Front Panel Figure 2-6 ADAM-4577—Back Panel 10 ADAM-4577 User’s Manual
2.1.4 Stickers If you forget the IP addresses of specific ADAM-4577 or which specific networking device you connect to, we have provided five stickers for you to note the IP addresses and place in a secure location. For example, 172.20.20.
2.2 Connecting the Hardware Next, we will explain how to find a proper location for your EDG series and explain how to connect to the network, hook up the power cable, and connect to the ADAM-4577 serial port. 2.2.1 Choosing a Location Due to its versatility and innovative design, the ADAM-4577 can be: • fixed to a panel mount • fixed to a DIN Rail. • Piggyback Stack Panel Mounting The ADAM-4577 can be attached to a wall using the included metal brackets.
Figure 2-7 Panel Mounting Chapter 2 Getting Started 13
DIN Rail Mounting You can mount the ADAM-4577 on a standard DIN Rail. First, using two screws, attach the metal plate to the DIN Rail bracket. Because the screw heads are beveled, the tops of the screws will be flush with the metal plate. Din Rail Mounting Brackets—Orientation of Metal Plates You can now screw the metal plate with the DIN rail bracket assembly to the bottom of the server is a more convenient way. Next, use the remaining screws to put the metal plate on the bottom of the ADAM4577.
Piggyback Stack ADAM-4577 can be stacked as seen in the figure below.
2.2.2 Network Connection There are two ways to use the 10 Base-T Ethernet connector located on the ADAM-4577 : 1.For Local Area Network (LAN) applications using the ADAM-4577, you will simply plug one end of your Ethernetcable into the 10 Base-T connector, and the other end into the hub connected to your network. 2.When installing and configuring, you will find it convenient to hook the ADAM-4577 directly to your computer’s Ethernet card.
Figure 2-11 Power Connection for ADAM-4577 up , indicating that the ADAM-4577 is receiving power. Furthermore, the ADAM-4577 provides surge protection to protect it from being damaged by over-voltage, a 34V surge protection is added to the power end and an 18V surge protection is for the RS-422/485 end. 2.2.4 Serial Connection 2.2.4.1 Connecting to Serial device The model of the ADAM-4577 that you purchased has DB-9 serial ports on the bottom of module.
DB-9 (male) RS-232 RS-485 RS-422 18 ADAM-4577 User’s Manual
2.2.4.2 Connecting to PC Sometimes, you want ADAM-4577 to connect to PC. You have to plug crossed null modem connector (female) that we provided to the cable. Refer to the following picture for details on the pinouts.
20 ADAM-4577 User’s Manual
Chapter 3 Installation and Configuration
3.1 Windows utility Installation The ADAM-4577 provides two window-based utilities. One is configuration utility; the other is testing utility. You can configure ADAM4577 in any operating system by using configuration utility via Ethernet . If you want to test the communication situation or download firmware remotely, you can use “testing utility”. The following are the installation instructions for setting up the ADAM-4577. 1.
3.2 Configuring the ADAM-4577 The ADAM-4577 provides easy Windows configuration through Ethernet connection. You can configure various parameters for TCP/IP or UDP configuration easily. For secure administration, it can also restrict the access rights for configuration to only one host PC to enhance network security. With this secure function enabled, other PCs will not have permission for configuration.
3.2.1 Search for Specific ADAM-4577 If you want to locate specific ADAM-4577s, the configuration utility provides a “Locate” function to assist you. You can select all the ADAM-4570/4571/4572/4577/4577/EDG-4504 devices (see Figure 3-2) or just select one ADAM-4577 (see Figure 3-3). When you select a specific device, the LED that stands for “Status” will flash . When you select another device, the original “Status” LED will be red. Please follow these steps: 1. Select “All Devices” and click “Locate” 2.
Figure 3-3 Locate specific ADAM-4577s Configuration utility can only search the ADAM-4570/4571/4572/4577/ 4577/EDG-4504 devices on the local network segment and cannot search beyond a router or gateway. Make sure that all the ADAM4570/4571/4572/4577/4577/EDG-4504 devices that you want to monitor must reside on the same system to identify and locate each Ethernet data gateway device.
Firmware version In this field, the configuration utility represents the firmware version of the ADAM-4577. You might need to refer to the firmware version to determine functions available on the ADAM-4577 device. In case of problems that might concern the firmware version, please provide the firmware version number to our Customer Service. Besides, you can download upgraded ADAM-4577 firmware to meet your requirements.
3.2.2 Network Configuration This section will show network configuration of ADAM-4577’s configuration utility. We will introduce their function and operation by item. Figure 3-4 Network Configuration Window Ethernet: MAC Address This does not need configuration. Link Speed This function will show the current linking speed to be 10Mbps.
TCP/IP: IP address, Subnet Mask, Default Gateway The IP address identifies your ADAM-4577 device on the global network. Each ADAM-4577 has same default IP address 10.0.0.1. Obtain a specific IP address from your network administrator and then configure each ADAM-4577 with the individual IP address. Note: The ADAM-4577 does not support auto IP address configured by DHCP server.
3.2.3 Port Configuration Figure 3-5 Port Configuration Window Name ADAM-4577 provide one port to connected to the serial device. The name default is port1, it goes without your further efforts Description You can give more detailed description of the function of the port for easy management and maintenance. Descriptions longer than 128 characters cannot be used. Type Each ADAM-4577 offers three kinds of serial interfaces: RS-232, RS485 and RS-422.
Flow Control The ADAM-4577 provides one option: None Data Bits The ADAM-4577 provides four options: 5, 6, 7 or 8. Stop Bits The ADAM-4577 provides three options: 1, 1.5 or 2. Baud Rate The ADAM-4577 supports baud rates from 300 to 230,000 bps.
3.2.4 Setting Configuration ADAM-4577 provides TCP/IP and UDP two protocol. In settings, you can choose either TCP mode (see Figure 3-6) or UDP mode(see Figure 3-7) according to your application. In this section, we will show setting configuration in either TCP or UDP mode. As to detailed networking architecture for TCP/UDP application, please refer to Chapter 4.
3.2.4.1 TCP(UDP) Port number The TCP(UDP) port number represents the source port number , and the number is used to identify the channel for remote initiating connections. Range: 1024-65533. If an unknown caller wants to connect to the system and asks for some services, they need to define the TCP(UDP) port to carry a long-term conversation. Each node on a TCP/IP network has an IP address, and each IP address can allow connections on one or more TCP port.
3.2.4.2 Only configure the authorized IP This option is enabled in order to protect all configuration settings from being changed inadvertently. 3.2.4.3 Allow any IP to access If this option is enabled, any PC can access data from this ADAM-4577. 3.2.4.4 The specified IP which can access If this option is disabled, only the specified PC can access data from this ADAM-4577. Due to the difference of TCP and UDP, we will discuss them individually.
3.2.4.5 Port Mode 1. Selected Port The default is Port1, DAM-4577 provide one port to connected to the serial device. 2. Port Mode The default is Data Mode, The ADAM-4577 provide one mode: Data mode. Serial devices that connect to the ADAM-4577 can transmit data to another networking device 3. Data Idle Timeout It only appears in TCP mode, The default is 60 seconds. If you want to keep connection continuously, you can key-in “0”. Data idle Time is the time period in which the device waits for data.
3.2.4.6 Protocol for Communication In this option, you can choose either TCP or UDP mode according to your application. Due to your TCP or UDP mode choice, it will show different setting frame of configuration utility. We’ll illustrate the setting base on TCP or UDP mode. TCP Mode Peer for Receiving Data The option is the setting of another networking device which you want to connect , including IP address and TCP port. It applies to two network architectures: Peer-to-peer and Event-handling.
TCP port of ADAM-4577: &&&& TCP port of ADAM-4577’s port1: &&&& +1 For example: TCP port of ADAM-4577 that you want to connect: 5220 TCP port of Port 1: 5220 +1=5221 If you want to connect to a PC or any system, you have to key-in the TCP port of that PC or system. UDP Mode UDP Timeout Setting (ms) The UDP mode is only applied to Polling network architecture. When you choose UDP mode , Data Idle Timeout option is disable. 1.
A Host PC B G C E F D Device Figure 3-8 ADAM-4577 transmits data and response timeout diagram A: Time for Host PC transmits the data to ADAM-4577 B: Time for ADAM-4577 processes the data C: Time for ADAM-4577 transmits the data to Device D: Time for Device processes the data E: Time for Device transmits the data back to ADAM-4577 F: Time for ADAM-4577 processes the transmitted data G: Time for ADAM-4577 transmits the data back to Host PC Response timeout = D+E Host PC total waiting time = A+B+C+D+
2. Inter Frame Break ADAM-4577 provides one smart way to reduce inefficient waiting time.Through Inter Frame Break,ADAM-4577 transmits data more fficiently. Inter Frame Break is a good control machine, ADAM-4577 will distinguish whether it transmits back data to host PC by the function. As to set Inter Frame Break 30 ms, ADAM-4577 won't wait response timeout 1000ms over to transmit data As long as the idle time is longer than 30 ms, ADAM-4577 starts to transmit back data to host PC.
Case2 : Assume the transmitted data spends 600 ms As Setting: Response timeout = 1000 ms Inter Frame Break = 30 ms Time over (Response timeout) 1000 ms Start to transmit Real data time Time over Saving time 600 ms 370 ms 30 ms Host PC Inter Frame Break Figure 3-10 Case2 data time diagram Comparing the difference of the two case, case 2 only wastes 30 ms but saves 370 ms comparing to case1. We see clearly that if we set Inter Frame Break, we could save waiting time.
3.3 Testing Utility The purpose of testing utility is to help you diagnose the communication between devices and download firmware remotely.
3.3.1 Self Test Function The purpose of this test is to confirm the communication from host PC to the ADAM-4577. If there is still an error, you can check the communication from the ADAM-4577 to the serial devices. If the test is selected, an external test will be done to check that the connection signals for each port are working properly. For the test, you will need to connect each port to a loopback tester (provided in the package). The loopback test only applies to RS-232 mode. 1.
3. If the connection is ok, click “Test” button Communication Parameters Test • Baud rate: From 50 bps to 230 Kbps • Data bit: 5,6, 7, 8 • Stop bit: 1, 1.
3.3.2 Upgrading ADAM-4577 (tm) s Firmware Download Advantech continually upgrades its firmware to keep pace with the ever-expanding world of computing. You can use the Download function located on Testing utility to carry out the upgrade procedure. Please access Advantech’s Web site at http://www.advantech.com to download the required computer file and then follow these instructions. 1.Click “Download” button. 2.Locate and select the filename of the firmware that you downloaded.
3.3.3 UDP Testing Utility The utility is for testing the status of ADAM-4577 UDP mode. By the utility, you can set Command Timeout to test the status of UDP network architecture. Figure 3-12 UDP Testing utility Windows In this section, we will describe the function by item in the UDP Testing Utility.
Target Device & UDP Port You can set Target Device IP Address according to Network IP Address in Configuration Utility. And UDP Port is depended on Setting Listen on UDP Port in Configuration Utility. “UDP Port” value is equal to “Listen on UDP Port” value plus one. For Example: If your Listen on UDP Port is setting 5500, UDP Port in UDP Testing Utility must set 5501. Command Format This option have two choices, one is ASCII and another is HEX. This will decide Command blank what to display.
The command edit control can be inputted in ASCII code ast choose ASCII Command Forma, and the command edit control can be inputted in HEX format as choose HEX Coomand. Command Mode Single Mode means command is running only one time to test UDP Mode. Command is running repeatedly to test UDP Mode as you choose Repeat Mode.
Send Command to the [IP Address : UDP Port] Timeout Figure 3-13 Timeout Frame Following Frame is UDP Testing Utility is running test as UDP responses well.
Figure 3-15 Command HEX Testing Windows 48 ADAM-4577 User’s Manual
3.4 Status Messages The status message shown at the bottom of the utility window reflects the current status of ADAM-4577. “Read” The configuration utility has found the ADAM-4577 and it is ready for use. “Searching EDG Devices” The configuration utility is searching the ADAM-4570/4571/4572/4577/ 4577/EDG-4504 “Querying DATA from EDG Devices” The configuration utility is getting data from the ADAM-4570/4571/ 4572/4577/4577/EDG-4504. “Device Ready” The ADAM-4570/4571/4572/4577/4577/EDG-4504.
50 ADAM-4577 User’s Manual
Chapter 4 Network Architecture and Example Code
ADAM-4577 is one port universal series device which supprots TCP/ UDP protocol. TCP mode applies to Polling, Event-handling, and Peerto-peer network architecture. UDP mode only applies to Peer-to-peer. ADAM-4577 provides the flexible network environment , you can use it according to your application. As following, we will demonstrate the network architecture and example code base on TCP and UDP mode. 4.1 TCP Mode 4.1.
Host PC creates TCP socket Connect to ADAM-4577 Send data to ADAM-4577 Receive data from ADAM-4577 Disconnect Figure 4-2 Flow chart-Polling network You need not fill out in IP Addr & TCP Port option Figure 4-3 Polling Setting Windows Chapter 4 Network Architecture and Example Code 53
Example: SOCKADDR_IN Dst4577Addr; SOCKET Dst4577Sock; char RxData[10]; memset(&Dst4577Addr, 0, sizeof(SOCKADDR_IN)); Dst4577Addr..sin_family = AF_INET; Dst4577Addr..sin_addr.s_addr = inet_addr(“10.0.0.1”); //Indicate the IP Address of ADAM-4577 that you want to connect.// Dst4577Addr..sin_port = htons(5201); // Indicate which port of ADAM-4577 you want to access// // TCP port no. of Port1 = TCP port +1// // TCP port no.
4.1.2 Event-handling Network Architecture If an event occurs from serial devices connected to the ADAM-4577, the host PC can get the data via the Ethernet. You can use an eventhandling network architecture.
Define the TCP port of Host PC Host PC creates socket Accept connection from ADAM-4577 Receive data from ADAM-4577 Disconnect Figure 4-5 Flow chart-Event handling network Figure 4-6 Event handling Setting Windows 56 ADAM-4577 User’s Manual
Example: SOCKADDR_IN HostAddr; SOCKET HostSock; SOCKADDR_IN ClntAddr; SOCKET ClntSock; int ClntAddrLen; char RxData[256]; memset(&HostAddr, 0, sizeof(SOCKADDR_IN)); HostAddr..sin_family = AF_INET; HostAddr..sin_addr.s_addr = INADDR_ANY; HostAddr.sin_port = htons (5201); //Define the TCP port of host PC.
4.1.3 Peer-to-peer Network Architecture If you want to transmit data from one serial device to another serial device via the Ethernet, you can add ADAM-4577s at both sides and use peer-to-peer network architecture.
Complete the settings of #1 ADAM-4577 Key-in information of #2 ADAM-4577 in configuration utility utilityAccept connection from ADAM-4579 Complete the settings of #2 ADAM-4577 Key-in information of #2 ADAM-4577 in configuration utility Disconnect Figure 4-9 Flow chart- Peer-to-peer network Chapter 4 Network Architecture and Example Code 59
Example: 1. Complete the settings of #1 ADAM-4577 #1 ADAM-4577 Module name: Office IP address: 172.18.1.
2. Find out the IP address and TCP port of #2 ADAM-4577 that you want to connect. #2 ADAM-4577 Module name: Factory IP address: 172.18.0.
3. Key-in the IP address & TCP port of #2 ADAM-4577 in #1 ADAM4577 configuration utility. IP address of #2 ADAM-4577 TCP port of #2 ADAM-4577’s port1 Figure 4-12 Key-in the information of #2 ADAM-4577 4. Follow the above procedure and complete the settings of #2 ADAM-4577 in the configuration utility.
4.2 UDP Mode 4.2.1 Polling Network Architecture In UDP Mode, If you want to use host PC to poll the serial devices, you can use polling network architecture.
Figure 4-16 UDP Polling Setting Windows Example: WSADATA wsd; SOCKADDR_IN Dst4577Addr; SOCKADDR_IN RecvedAddr; SOCKET Dst4577Sock; int iRecvedAddrLen; int i; char RxData[10]; WSAStartup((MAKEWORD(1, 1)), &wsd); memset(&Dst4577Addr, 0, sizeof(SOCKADDR_IN)); Dst4577Addr.sin_family = AF_INET; Dst4577Addr.sin_addr.s_addr = inet_addr("172.18.1.
//| //+--Indicate the IP Address of ADAM4577 which you want to access Dst4577Addr.
66 ADAM-4577 User’s Manual