RS485 TO ETH (B) RS485 TO ETH (B) User Manual Figure 1 RS485 TO ETH (B) 5/22/19 www.waveshare.
RS485 TO ETH (B) 1. OVERVIEW This is a RS485 device data collector/IoT gateway specially designed for industrial environments. It combines multiple functions such as serial server, Modbus gateway, MQTT gateway, RS485 to JSON and so on. It has an RS485 interface and an Ethernet interface. It adopts a guide rail type installation method, compact and easy to install. Adopt terminal type power connection, 9~24V wide voltage input.
RS485 TO ETH (B) Electricity, smart meters and energy consumption monitoring; Remote monitoring and program downloading of various automated PLCs; Various configuration software and equipment communication interfaces; Equipment networking in the field of access control and security; A typical application connection is shown in Figure 2.
RS485 TO ETH (B) Support TCP server, TCP client, UDP mode, UDP multicast. As a TCP client, it also supports TCP server functions. As a TCP server, it supports 30 TCP connections, and as a TCP client, it supports 7 destination IPs. The baud rate supports 1200~115200bps, the data bit supports 5-9 digits, and the parity bit can be five modes: no parity, odd parity, even parity, mark, and space.
RS485 TO ETH (B) Supports the http method of data submission and distribution. The cloud can directly use the http GET command to interact with the device's serial port data. 3. TECHNICAL PARAMETER 5/22/19 www.waveshare.
RS485 TO ETH (B) Table 1 Technical parameters Appearance Communication interface RS485, wiring terminal mode Power supply terminal mode Dimensions L x W x H =8.7cm×3.6cm×5.
RS485 TO ETH (B) 目录 1. Overview.................................................................................................................................2 2. Features.................................................................................................................................. 3 2.1.Hardware features............................................................................................................ 3 2.2.Software features....................................................
RS485 TO ETH (B) 7.5. Multi-host parameters...................................................................................................41 7.6. Modbus under multi-destination IP..............................................................................43 8. Registration package and heartbeat package....................................................................43 8.1. Registration package.....................................................................................................
RS485 TO ETH (B) 4. INSTRUCTIONS FOR USE The RS485 TO ETH (B) module is used to realize the two-way transparent transmission of data from the serial port to the Ethernet port. The user does not need to care about the specific details, and the module completes the protocol conversion inside. The serial port side is the serial port level data, and the Ethernet port side is the network data packet. You can specify the work details through simple settings.
RS485 TO ETH (B) 1 Power input: Wiring terminal: 5.08mm terminal. The input voltage is 9~24V. Figure 4 Power supply, network port 2 RS485: Use RS485 to connect to 485B and 485A. Among them, 485B means 485 negative line, 485A means 485 positive line; 485 can carry 32 sets of load. The longest communication distance is 1200 meters. Generally, the terminal resistance is only necessary when the RS485 line exceeds 300 meters. The 485 terminal resistance is 120 ohms.
RS485 TO ETH (B) LINK (1) Link is green when the network cable is connected. (2) When the TCP connection is established (or in UDP mode), Link is blue (actually with a faint green light). It can be used to judge whether the serial port server has established a communication link with the host computer software. ACT (1) When the network port sends data to the serial port, the indicator light is green.
RS485 TO ETH (B) Figure 5 The back of the device 4.2. HARDWARE CONNECTION Generally speaking, the serial server only needs to be connected to the power supply, serial port, and network cable. The power supply can be a 2-wire power supply on site, which can be directly connected to the positive and negative terminals of the power supply. The serial port needs to be connected according to the user's serial device. Connect 485 positive to 485A and 485 negative to 485B.
RS485 TO ETH (B) as long as the device and the computer running Vircom are under the same switch. Figure 6 Vircom main interface Figure 7 Device list See all currently online devices from the device list. Click "Edit Device" to configure the parameters. 5/22/19 www.waveshare.
RS485 TO ETH (B) Figure 8 Device parameters In this interface, the user can set the parameters of the device, and then click "Modify Setting", the parameters will be set to the flash of the device, and they will not be lost after power failure. At the same time, the device will automatically restart.
RS485 TO ETH (B) functions IP mode device static, DHCP users can choose static or DHCP (dynamically obtain IP) IP address The IP address of the serial server Port 0~65535 The listening port when the serial port server is in TCP Server or UDP mode. As a client, it is best to specify the port as port 0, which helps to increase the connection speed. When port 0 is used, the system will randomly allocate a local port.
RS485 TO ETH (B) Data bits 5、6、7、8、9 Check Digit None, Even, Odd, Mark, Space Stop bit 1、2 Flow control No flow control, Hard flow control CTS/RTS, hard flow control DTR/DCR, soft flow control XON/XOFF DNS server only valid for RS232 serial port When the destination IP is described by a domain name, this DNS server needs to be filled in. Server IP. When the IP mode is DHCP, there is no need to specify DNS Server, it will be automatically obtained from the DHCP server.
RS485 TO ETH (B) computer every keep-alive time. When it is set to 255, there will be no parameter sending function, which can realize remote device management. Disconnection reconnection time Web access port 0~255 0~255 When in TCP client mode, when the connection is not successful, each "disconnection reconnection time" will re-initiate TCP connection to the computer. It can be 0~254 seconds. If you set 255, it means that you will never reconnect.
RS485 TO ETH (B) circumstances, it can not be used. Modbus TCP to RTU can be converted from Modbus TCP to RTU. It also supports multi-host function. Serial port modification parameters Support serial port AT commands to configure and read device parameters. Obtain IP automatically support DHCP client protocol Storage expansion EX function Subsequent expansion Multiple TCP connections When acting as a TCP server, it supports more than 1 TCP connection.
RS485 TO ETH (B) Figure 10 SSCOM1: USB TO RS485 transceiver interface In addition, open one more serial port debugging assistant window and use it as a TCP client mode. Fill in the destination IP as the IP of the serial server (currently 192.168.1.
RS485 TO ETH (B) 4.6. VIRTUAL SERIAL PORT TEST The SSCOM2 in the figure communicates directly with the serial server through TCP. In order to allow the user to communicate with the serial server as well as the serial software that has been developed by the user, a virtual serial port needs to be added between the user program and the serial server.
RS485 TO ETH (B) The virtual serial port has been connected Open SSCOM to simulate the user's serial port program, open COM2 (the virtual serial port above), open another SSCOM to simulate a serial device, and open COM3 (hardware serial port). At this time, the COM2 sending data link is as follows: COM2 —"Vircom —"Serial server network 5/22/19 www.waveshare.
RS485 TO ETH (B) port —"Serial server serial port —"COM3. Conversely, COM3 to COM2 can also transmit data: COM3 —"Serial server serial port —"Serial server network port —"Vircom —" COM2. Figure shows the situation of both parties sending and receiving data. If COM4 is replaced by a user serial port device, COM5 can communicate with the user device. Communication via virtual serial port 4.7. MODBUS TCP TEST By default, serial and network port data is transparently transmitted.
RS485 TO ETH (B) Enable Modbus TCP function If the user's Modbus TCP software is used as a slave (Slave), you need to change the working mode to client based on the selection of the conversion protocol, and change the destination IP to the IP of the computer where the Modbus TCP software is located, and the destination port is 502, as shown in the figure blow. 5/22/19 www.waveshare.
RS485 TO ETH (B) Modbus TCP as client 4.8. WEB CONFIGURATION Using Vircom, you can search and configure device parameters in different network segments. Web configuration requires that the computer and serial server are in the same IP segment, and the IP address of the serial server must be known in advance. But the Web configuration can be done on any computer without Vircom. 1. Enter the IP address of the serial port server in the browser, for example http://192.168.1.
RS485 TO ETH (B) Web configuration interface 3. In the web page that appears, you can modify the serial server parameters. For related parameters, please refer to Table 4 for the meaning of the parameters. 4. After modifying the parameters, click the "Submit" button. 5.
RS485 TO ETH (B) need to select Modbus TCP to RTU mode; Realcom protocol is currently only used in a multi-serial server as a TCP client to connect to a server, and the virtual serial port is used on the server. Time to use. The usage is summarized as follows: Table 6 Network configuration mode NO. Virtual serial port Device working mode Conversion protocol Description 1 Use TCP server None Suitable for occasions where user software opens the COM port to actively collect data.
RS485 TO ETH (B) Look at whether the monitoring computer and equipment are in the local network: a) If the computer is a public IP server leased on the Internet, the device must use the TCP client method to connect the device to the server. At this time, you can choose ② and ⑤ in Table 6, if it is a multi-serial server, you must choose ⑤. b) If they are all on the local network (can ping each other), it depends on whether the host computer actively inquires or the device actively sends data.
RS485 TO ETH (B) the computer where the network tool is located, (3) Port correspondence: The destination port of the serial server must be the local port of the network tool. After this setting, the serial server can automatically connect to the network tool, and data can be sent and received after the connection is established. Serial server as a client 5.2.2.
RS485 TO ETH (B) Figure 14 The first destination IP and port Figure 15 The remaining 2~7 IPs and ports The first IP is set in the device setting interface as shown in Figure 14. The first IP can be a domain name. For the remaining 2~7 destination IPs, click the "More Advanced Setting..." button in the device setting interface to open More Advanced Settings for setting. After all 7 destination IPs are set up, they can be connected automatically.
RS485 TO ETH (B) When the serial port server is used as the server, there are also three corresponding relationships, as shown in Figure 16, which will not be explained here. After setting, click the open button of the network tool to establish a TCP connection with the serial server, and then you can send and receive data after the connection is established. Figure 16 Serial port server as TCP server When the serial port server is used as a server, it can accept 30 TCP connections at the same time.
RS485 TO ETH (B) Figure 17 Acting as both a client and a server By default, when using Vircom for configuration, if you change the working mode to "TCP client", the port (that is, the local port) will automatically become 0 (0 means a free port is randomly selected). In order to be able to support the TCP server mode, the computer software must know the local port of the device, so a value needs to be specified here. As shown in Figure 17, the computer software can now connect to the 1024 port of 192.168.
RS485 TO ETH (B) Figure 18 UDP mode parameter configuration 5.3. DEVICE COUPLET WAY If the host computer is not an SSCOM program or a virtual serial port, but two devices are connected through a network port, the configuration method is similar. First, the user needs to connect two devices and computers to the same local area network. Vircom is running on this computer. The purpose of connecting to the computer is only for configuration.
RS485 TO ETH (B) established. Figure 19 TCP device pairing parameter configuration Figure 20 TCP device pairing parameter configuration If it is couplets in UDP mode, the configuration parameters are shown in Figure 21, and the parameters corresponding to the arrows must be one-to-one correspondence. UDP couplet does not need to check the connection status as long as the parameter configuration is correct, the sent data will be automatically sent to the designated device. 5/22/19 www.waveshare.
RS485 TO ETH (B) Figure 21 UDP device pairing parameter configuration Finally, I need to remind that if the device is connected, in addition to the network port parameters set according to the above, the correct serial port parameters must also be set. Mainly, the baud rate of the serial server needs to be consistent with the baud rate of the user's device. After this setting, the user equipment can send data to each other through the serial ports of the two serial port servers. 6. EQUIPMENT DEBUGGING 6.
RS485 TO ETH (B) Configured in the same network segment Whether it is directly connected or through a switch, when configured as a static IP, the device and the computer need to be in the same network segment (unless it is cross-gateway communication), as shown in Figure above. Since Vircom supports searching and configuration across network segments, the IP address that can be searched but cannot be communicated is generally not configured properly.
RS485 TO ETH (B) In order to facilitate remote debugging, Vircom also supports remote viewing of data sent and received. As shown in Figure 22, TXD is the amount of data sent by the serial port server serial port. When the device list is refreshed, if this value changes, it indicates that there is data sent. The Active light will also be green; if you see the value of RXD changing, it indicates that the serial device has returned data, and Active is blue. 6.4.
RS485 TO ETH (B) Figure 32 Open Virocm monitoring From the opened dialog box, you can see the instructions issued by the host computer and the instructions returned by the device, as shown in Figure 25. This function can facilitate on-site communication debugging. Figure 33 Monitor sending and receiving data 7. MODBUS ADVANCED FUNCTIONS The serial port server with Modbus gateway function does not have station address and registers. It is a communication bridge.
RS485 TO ETH (B) By default, the serial server is in normal transparent transmission mode. If you need to switch to Modbus gateway mode, please select the option "Modbus TCP Protocol" in "Conversion Protocol". After that, the device automatically changes the "port" parameter to 502 (the port of the Modbus server). Then the Modbus gateway is enabled. If the serial port RTU device is used as a slave station, the host computer Modbus TCP software connects to port 502 of the Modbus gateway.
RS485 TO ETH (B) As shown in Figure 26: The general Modbus TCP data flow direction is (1) (2) (3) (4). That is, the Modbus TCP command is first converted into the corresponding command of Modbus RTU, and then the device responds to the Modbus RTU command to the Modbus gateway, and then the Modbus gateway is converted to Modbus TCP again and sent to the monitoring host computer. We know that Modbus TCP is network communication, and the transmission speed is very fast.
RS485 TO ETH (B) 2. If a specific command is no longer inquired by the host computer on the network side within 5 seconds, this command will be automatically deleted and no longer sent to the RTU device from the serial port. 3. At present, it can store 10K Modbus cache. For ordinary single-register query, about 500 instructions can be stored at the same time. 4. When multiple commands are being queried at the same time, they are sent in order.
RS485 TO ETH (B) None, generally the user-defined RS485 protocol can also have serial devices accessed by multiple hosts at the same time This function cannot be achieved in a pure RS485 network, because multiple master stations sending at the same time will cause conflicts on the RS485 bus. The multiple hosts of this serial server can "coordinate" the RS485 bus to achieve the purpose of multi-host access.
RS485 TO ETH (B) The meanings of "Enable RS485 Multi-Host" and "Enable RS485 bus conflict detection" are introduced as follows. Figure 37 RS485 multi-host support The RS485 command response timeout time is: the maximum time interval from the beginning of sending this command to receiving the response from the serial server serial port. The time to fill in should be greater than the actual maximum time interval. Because once it is determined to be timed out, the next command will be sent.
RS485 TO ETH (B) When the user uses Vircom to select the conversion protocol as "Modbus_TCP Protocol", Vricom will automatically check the above two enabling boxes (unless the user manually enters the advanced option to remove it), and the above two times will also be automatically configured according to the baud rate . However, if the user's Modus command is relatively long or the conversion protocol is "None", these two parameters need to be configured manually.
RS485 TO ETH (B) The registration package and the heartbeat package are a function suitable for communication between the device and the cloud software. 8.1. REGISTRATION PACKAGE The definition of the registration package is that when the computer software and the serial server module (hereinafter referred to as the module) establish a TCP connection, the module will first send a string of codes to the software, so that the software can know which module is communicating with itself.
RS485 TO ETH (B) The Realcom protocol is a mature protocol containing a registration package and a heartbeat package. Users can use this protocol to realize the functions of the registration package and heartbeat package. The method to enable the Realcom protocol is: in the "Device Settings" dialog box, select "Conversion Protocol" to "REAL_COM Protocol", and note that the part of enabling the registration package needs to be blank and unchecked.
RS485 TO ETH (B) The custom registration package method is that the user can fill in an arbitrary registration package format. The method is: in the device setting interface, the configuration is as follows: Figure 33 Set registration package The difference with the REAL_COM protocol is that the registration package is enabled here, and the registration package information such as 31 32 33 34 is filled in. Note that this is hexadecimal, that is, the actual data sent is the string 1234.
RS485 TO ETH (B) Support serial server to write a configuration file, so as to realize user-defined registration package, and can use MAC address wildcard, which can solve the trouble of writing custom registration package for each device, and there is no limit to the length of registration package. 8.2. HEARTBEAT PACKAGE The heartbeat packet is mainly used to detect whether the communication link is disconnected.
RS485 TO ETH (B) data. Therefore, it cannot play the first function of the heartbeat packet, that is, the server detects whether the device is active or not; but because the device actually sends data, it can play the second function of the heartbeat packet, that is, the device detects the TCP connection Whether the function is normal, once the disconnection is detected, the TCP connection can still be automatically re-established. 8.2.2. REALCOM PROTOCOL As described in 8.1.
RS485 TO ETH (B) 1. Automatic search: The device and the computer are on the same switch. At this time, no matter whether they are in the same network segment or not, the Vircom search method on the computer is: Vircom sends a broadcast query. After receiving the query, all devices will reply with their own parameters. Vircom tools. This method searches all devices at once. 2.
RS485 TO ETH (B) Figure 39 Timing sending parameters In order to facilitate the identification of the device, if you need to perform remote management, please give the device a name that is easy to remember. 10. FIRMWARE UPGRADE METHOD RS485 TO ETH (B) can upgrade their respective programs, but not mutually upgrade programs. Whether it is automatic search, manual addition or P2P search and other methods found in the device list, you can use this method to upgrade the firmware.
RS485 TO ETH (B) Figure 40 Restart the device After the device restarts, use the same method to search for the device again, and enter this dialog box again. Click the "Firmware/Config" button in the lower right corner of the dialog box. Figure 41 Upgrade firmware 5/22/19 www.waveshare.
RS485 TO ETH (B) 3 As shown in Figure 42, select the "Program File Download" option. In the program file, select the firmware file. The IP address part of the serial server has been filled in automatically, and there is no need to write it again. The module type/model has been automatically selected. Then click download. Figure 42 RS485 TO ETH (B) firmware upgrade method 4 At this time, the download progress bar starts to move, and the download time is about 30 seconds.
RS485 TO ETH (B) page if there is no need for web configuration. The way to download the Web is: as shown in Figure 43, change the "program file" download mode to "web directory download". And select the root directory where the local webpage is located as the directory where the webpage file to be downloaded is located (the directory can be obtained from Weixue), click download, and download all the files in the local webpage directory to the internal file system of the device.
RS485 TO ETH (B) Figure 50 Check the firmware version after the level is completed 5/22/19 www.waveshare.