steveohara / j2mod

Enhanced Modbus library implemented in the Java programming language
Apache License 2.0
269 stars 111 forks source link

read write mismatch #116

Closed aniluoh closed 3 years ago

aniluoh commented 3 years ago

Expected Behavior

Writing a float value 286.075 when reading, it should return the same value.

Actual Behavior

When reading it, it shows the value 287.20

Steps to Reproduce the Problem

/*

import com.ghgande.j2mod.modbus.Modbus; import com.ghgande.j2mod.modbus.io.ModbusSerialTransaction; import com.ghgande.j2mod.modbus.msg.WriteMultipleRegistersRequest; import com.ghgande.j2mod.modbus.msg.WriteMultipleRegistersResponse; import com.ghgande.j2mod.modbus.msg.WriteSingleRegisterRequest; import com.ghgande.j2mod.modbus.msg.WriteSingleRegisterResponse; import com.ghgande.j2mod.modbus.net.SerialConnection; import com.ghgande.j2mod.modbus.procimg.Register; import com.ghgande.j2mod.modbus.procimg.SimpleRegister; import com.ghgande.j2mod.modbus.util.ModbusUtil; import com.ghgande.j2mod.modbus.util.SerialParameters; import java.util.logging.Level; import java.util.logging.Logger;

/*

Specifications

aniluoh commented 3 years ago

Sorry! for inconvenience, my device was faulty.