Modbus test Tools Modbuspoll and Modbus slave use method

Source: Internet
Author: User

Thanks to 77979114 original, because csdn often adjust, so edit the collection, and modified some bugs.

First, Introduction

Modbus Poll:modbus host emulator for testing and commissioning of Modbus slave devices. The software supports Modbusrtu, ASCII, TCP/IP. Used to help developers test Modbus from the device, or other Modbus protocol testing and simulation. It supports multi-document interfaces, i.e., multiple slave/data domains can be monitored at the same time. Each window is simply set from the device ID, function, address, size and polling interval. You can read and write registers and coils from any window. If you want to change a separate register, simply double-click the value. Or you can change multiple register/coil values. Provides data in a variety of formats, such as floating-point, double-precision, long-integer (which can be byte-sequence switched).

Modbus Slave:modbus from the Device Emulator, can simulate 32 slave/address domains. Each interface provides OLE Automation support for Excel reports. It is mainly used to simulate the Modbus slave device, receive the command packet of the master station, and echo the packet. Help Modbus communication equipment developers to simulate and test Modbus communication protocol for simulating, testing and debugging Modbus communication equipment. Up to 32 Modbus sub-devices can be simulated in 32 windows. The user interface is the same as the Modbus poll, with support for functions 01, 02, 03, 04, 05, 06, 15, 16, 22 and 23 to monitor serial data.

Second, Modbus poll use

1), Installation registration:

After installation, the desktop can see the Modbuspoll shortcut, double-click the shortcut, open the software, open the interface as shown.

Click Connection->connect, pop Up the registration window, open the compressed package decompression of the Readme file, copy the Modbuspoll serial number 5A5742575C5D10, paste into the registration window of the registration box, as shown, click OK, registration is complete.

Modbus Poll 4.3.4 Program main window Introduction

Where: Tx = 4 Indicates the number of data frames sent to the master, the figure is 4 times, error = 0 is the number of communication errors, 0 times in the figure, ID = 1 indicates the device address of the analog Modbus sub-device, the address in the figure is 1;f = 03 means the Modbus function code used, the figure is 03 function code; SR = 1000ms indicates the scan cycle. The Scarlet Letter section, which indicates the current error state, "No Connection" indicates the disconnected state.

3), Parameter settings:

In the menu "Setup", click "Read/write Definition. F8 "parameter setting, the parameter Settings dialog will pop up.

Where: A.  Slave is the address of the Modbus slave (slave) to be accessed, corresponding to the ID value in the main window (main screen), which defaults to 1. B. function for the selection of functional code registers, a total of four, respectively, the corresponding relationship is as follows:

Code

Name

Register PLC Address

Bit manipulation/word manipulation

Number of operations

01

Read/write bit Status

00001-09999

Bit bits

Single or multiple

02

Read (input) bit

10001-19999

Bit bits

Single or multiple

03

Read/write (Save) word

40001-49999

Word Word

Single or multiple

04

Read (input) word

30001-39999

Character Wrod

Single or multiple

05

Write a single coil

00001-09999

Bit bits

Single

06

Write a single hold register

40001-49999

Word Word

Single

15

Write multiple coils

00001-09999

Bit bits

Multiple

16

Write multiple hold Registers

40001-49999

Word Word

Multiple

C. Address is the start of the register, starting from 0 by default.

D. Length is a sequential number of registers, the default is 10, corresponding to the configuration software channel number.

E. Scan rate is the read data period, in milliseconds, and defaults to 1000ms.

Settings Complete Click the OK button, and the simulation window will display a list of the defined registers.

4), display settings:

Data display Mode settings:

By default, the register data is displayed in signed mode (16 binary signed binary) with a data range of -32768~32767. If the user wants to be displayed in a different numeric format, the menu "display" can be used to select settings, as shown in:

Address format settings: Modbus slave default to use the PLC address, "Display" Menu "PLC Addresses (Base 1)" is the default check state, the default register start address 1 starts, This point is identical to the configuration software's Modbus serial port and TCP data forwarding driver. Select Protocol Addresses (Base 0) If you need to set the start address to 0 for testing. In general, the default PLC address can be used.

Using the Communication Traffic button on the toolbar, you can display the currently sent command and the accepted data.

5), Serial connection:

Click "Connect" in the Menu "Connection". F3 "Serial connection, such as:

Which: Port3, the use of the serial port (COM3), according to the actual situation to choose a different serial port or TCP/IP connection. mode, which indicates the Modbus protocol pattern, is valid when using a serial port, and is automatically TCP when TCP/IP is used. Response timeout, which indicates the read time-out period and no data returned from the station within the timeout period, is considered a communication failure. Delay between polls, the minimum interval for each scan, the default is 10ms. Remote Server, which represents the network settings for the terminal slave device in TCP/IP mode.  IP address, which represents the slave IP addresses in TCP/IP mode. Port, which represents the TCP mode when the slave network port. The user can set parameters according to the default: serial 1, baud rate 9600, data bit 8 bit, no check bit, 1 bit stop bit. Confirm the settings and click the OK button. If it is connected and read correctly, the main window displays information about the read register.

6), register value change:

Double-click on the main window register address to pop up the Modify dialog box, such as:

Enter a value confirmation in the Value input box. The range is -32768--32767.

Where: Slave is the address of the Modbus slave to be accessed, corresponding to the ID value in the main screen, the default is 1. Address of the register for the current operation.  Operation on register 40001 is shown in the figure. Use function code is used, you can choose 06 or 16 function code to write.

7), view the communication data frame:

Click "Communication ..." on the "Display" menu or click the "101" button on the toolbar to bring up the serial transceiver Data Frame Monitoring Information dialog "Communicationtraffic" to view the data frames sent and received by the analysis. As shown in the following:

Where: The first 6 bits are the sequence number of the data frame.  RX represents the received data frame. TX represents the data frame being sent.

8), Disconnect:

Click "Disconnect F4" to disconnect the end test, where the red "no Connection" appears in the main window to indicate the status is not connected.

Third, Modbus slave use

1), Installation registration:
Install the software, after the installation is complete, double-click the Execute Modbusslave shortcut.

Registration method: Click Connection->connect, pop Up the registration window, open the compressed package decompression of the Readme file, copy the Modbuspoll serial number, paste into the Registration window registration bar, click OK, cracked finished. Modbusslave installation crack and Modbuspoll similar, here no longer repeat.

2), main window:
The main software window looks like this:

At this time in "Noconnection" is not connected state, if only test "04 Output hold Register", you can directly click to skip to the 3rd step, directly connected.

3), Parameter settings:
In the menu "Setup", click "Slave Definition. F2 "To set the parameters, it will pop up like a dialog box.

Where: A.slave is the modbus slave address, corresponding to the ID value in the main screen, the default is 1.
B. function for the selection of functional code registers, a total of four, respectively, the corresponding relationship is as follows:

Code

Chinese name

Register PLC Address

Bit manipulation/word manipulation

Number of operations

01

Read Coil Status

00001-09999

-bit operation

Single or multiple

02

Read discrete input state

10001-19999

-bit operation

Single or multiple

03

Read Hold Register

40001-49999

Word manipulation

Single or multiple

04

Read Input Register

30001-39999

Word manipulation

Single or multiple

05

Write a single coil

00001-09999

-bit operation

Single

06

Write a single hold register

40001-49999

Word manipulation

Single

15

Write multiple coils

00001-09999

-bit operation

Multiple

16

Write multiple hold Registers

40001-49999

Word manipulation

Multiple

C. Address is the start of the register. The default starts at 1.
D. Length is the number of consecutive registers. The default is 10.

Set the OK button and the simulation window will display a list of the defined registers:

Where: ID, which represents the device address of the emulated Modbus sub-device; F, indicates the function code
By clicking on the corresponding register, you can modify the value or status of the corresponding register. For example, 2 register value is modified to 9, 9 register value is changed to 100.

4), display settings:
Data display Mode settings:
By default, the register data is displayed in signed mode (16 binary unsigned binary) with a range of -32768--32767. If the user wants to be displayed in a different numeric format, the menu "display" can be used to select settings, as shown in:

Address format settings:
Modbus slave default use of the PLC address, "Display" Menu "PLC Addresses (Base 1)" is the default selected state, the default register starting address is 1 start, this point and configuration software Modbus serial and TCP data forwarding driver is the same. Select Protocol Addresses (Base 0) If you need to set the start address to 0 for testing. In general, the default PLC address can be used.

5), Connection:
Click "Connect" in the Menu "Connection". F3 "to connect. The connection dialog box pops up:

Which: Port2, the use of the serial port (COM2), according to the actual situation to choose a different serial port or TCP/IP connection
mode, which indicates the Modbus protocol pattern, is valid when using the serial port; TCP mode is automatically used when using TCP/IP
Flow control, which is valid when the serial port mode is active;
Ignore unit ID, which indicates TCP mode when invalid group number is ignored
The user can set the serial port parameters according to the need, the default is: Serial port 1, baud rate 9600, data bit 8 bit, no check bit, 1 bit stop bit. Confirm the settings and click on the "OK" button. The red "no connection" in the main window indicates that information from the disconnected state disappears, indicating that the slave is in a normal connection state.

6), register value change:
Double-click on the main window register address to pop up the Modify dialog box, such as:

Enter the value confirmation in the input box. The range is -32768--32767.
Where: After the Auto increment option is selected, the value of the corresponding register can be increased by 1 per 1 seconds.

7), view the communication data frame:
Click on the "Display" menu "Communication ...", you can call up the serial transceiver Data Frame Monitoring Information dialog box, used to view the data frames sent and received analysis. As shown in the following:

Where: The first 6 bits are the sequence number of the data frame.
Rx: Indicates the receiving data frame.
Tx: Represents the sending data frame.

8), Disconnect:
Click "Disconnect F4" to disconnect the end test, where the red "no Connection" appears in the main window to indicate the status is not connected.

Four, Modbus host/Slave simulation program

1), install VSPD virtual serial port tool. Add COM2 and COM3 two ports via tools.

2), next open the installed modbuspoll and modbus slave software, respectively, according to "F8" configuration of the master-slave configuration,


The above configuration is 10 counter slave device ID 1 but only read the first 6 counters of data, can be set according to their own circumstances.

2, Next Press "F3" to connect, pay attention to modify the interface port, master and slave to choose our virtual out of the COM2 and COM3 port, because I only use the RTU mode, so other options such as baud rate 9600, bit 8, check bit 1, no price, etc. can remain unchanged, Then click OK to connect, not connected to the success window the second row gives a message.

Communication start, host side display: Tx=232,err=0,id=1,f=03,sr=1000ms. This means that 232 commands are sent, the number of errors, the machine ID, the function number, and the polling interval.

Using the Communication Traffic button on the toolbar, you can display the currently sent command and the accepted data.

Modbus Poll Master Station 4.3.4:http://www.cr173.com/soft/21405.html

Modbus Slave Tool: http://www.cr173.com/soft/21410.html

Modbus Debug Wizard 7.04 Green version: http://www.cr173.com/soft/5480.html

Modbus test Tools Modbuspoll and Modbus slave use method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.