Modbus RTU communication example: Ankerui ammeter communication

How to find the RS485 interface:

There are two methods, one is to check directly from the side of the meter, the terminals are 30 and 31, A and B, the corresponding positions of A+ and B- connected to the USB line are as shown in the figure below, and the second is to read from the user manual USB Tool Terminal Details
, Friends in need can private message me, free of charge.

Download the serial port driver,

I use dtech's usb2.0 to 422\RS485 cable, usually there is a QR code inside, you can download the serial port driver

Serial tool use

I am using the HslCommunicationDemo serial port debugging assistant
Initialization interface
to select modrtu in Modbus
modbusrtu initialization interface

Serial driver

After connecting the usb cable, how to check whether the driver is successfully installedinsert image description here

insert image description here
insert image description here
After the installation is complete, it looks like my third picture, and now you can start debugging

parameter settings

After the meter starts, you need to press the set key. The initial password is 1. After setting, you can check the station number of the meter. It should be 2, and then you can also read the baud rate. For some parts that cannot be seen after wiping, you should go to the official website of the device, download the user manual of the device, and check the stop bit, parity, etc. In the end, since the equipment is not at hand, I can tell you about the message, and you start the debugging assistant and communicate.
Check the first circuit load energy value message: 02 03 00 27 00 02
This debugging assistant does not need a check code, if there are other serial port assistants, you can search for the calculation of the check code. If you can't find the data attachment, please private message me.

Guess you like

Origin blog.csdn.net/jay_chou_c/article/details/129830095