DDM18SD Energy Meter https://www.aliexpress.com/item/33003316323.html USE Example {{:modbus:pasted:20200507-191359.png}} Troubleshooting Warning ♦ During maintenance, do not touch the wiring of the meter with your hands, metal, or bare wires to prevent electric shock. ♦ Always disconnect the power to the meter and disconnect the power to the meter installation device before performing maintenance. Danger ♦ Only qualified personnel who are familiar with the relevant operations and procedures can perform maintenance on this meter. ♦ Use insulation tools for maintenance. ♦ Make sure to restore the protective cover after maintenance. ♦ Do not damage the seal of the meter. RS-485 Network Common Problems and Solutions RS-485 Communication Distance Like RS-422, RS-485 has a maximum transmission distance of approximately 1219 meters and a maximum transmission rate of 10 Mb/s. The length of the balanced twisted pair is inversely proportional to the transmission rate. It is possible to use the longest specified cable length only when the transmission rate is below 100 kb/s. The highest rate transmission is only possible at very short distances. Generally, the maximum transmission rate of a 100-meter twisted pair cable is only 1 Mb/s. RS-485 Network Topology The network topology of RS-485 generally adopts a terminal-matched bus type structure and does not support ring or star networks. It is preferable to use a bus to connect the various nodes in series, and the length of the lead line from the bus to each node should be as short as possible so that the reflected signal in the lead line has the least influence on the bus signal. In summary, a single, continuous signal path should be provided as the bus. RS-485 Terminal Matching Resistor RS-485 requires two terminal matching resistors whose resistance are equal to the characteristic impedance of the transmission cable. In most cases, the termination is matched between 100Ω and 120Ω. Terminal matching resistors are not required for transmission distances below 300 meters. The terminal resistors are connected to both ends of the transmission bus. Polarity of RS-485 Cable RS-485 uses two wires for transmission. The two wires are different and are labeled A and B respectively. The A line is the one with a higher voltage in the idle state. RS-485 Cable RS-485 can use international and Chinese standard communication cables. The international cable standard is: the wire diameter is larger than AWG18. The Chinese standard is RVVP1 × 2 × 0.5mm². Isolation and Anti-jamming of RS-485 Communication Lines The shield of the shielded twisted pair should be connected to the shield terminals of each RS-485 device. The shield is only allowed to be grounded at one point. instrument = minimalmodbus.Instrument('com22', 56) # port name, slave address (in decimal) instrument.serial.baudrate = 9600 instrument.serial.stopbits = 1 instrument.serial.parity = serial.PARITY_EVEN instrument.serial.timeout = 1 print(instrument.serial) voltage = instrument.read_float(0x00, functioncode=4) # Registernumber, number of decimals current = instrument.read_float(0x08, functioncode=4) # Registernumber, number of decimals actvie_power = instrument.read_float(0x12, functioncode=4) # Registernumber, number of decimals reactvie_power = instrument.read_float(0x1A, functioncode=4) # Registernumber, number of decimals power_factor = instrument.read_float(0x2A, functioncode=4) # Registernumber, number of decimals frequency = instrument.read_float(0x36, functioncode=4) # Registernumber, number of decimals total_active_power = instrument.read_float(0x0100, functioncode=4) # Registernumber, number of decimals total_reactive_power = instrument.read_float(0x0400, functioncode=4) # Registernumber, number of decimals