![read error modbus poll read error modbus poll](https://aws1.discourse-cdn.com/business6/uploads/nodered/original/3X/f/4/f434b54b954feaa9e186651fbb7f3cd8cb1b7b55.png)
Taking the data from your screenshot Register 0080 = 21210 and register 0081 = 5. I had a scan through the manual you provided and cound not see any mention of this but trying the two options points towards a little-endian order (meaning the second register is the high part of the number).
#READ ERROR MODBUS POLL HOW TO#
However it does not state how to combine multiple registers so larger numbers can be processed. So the byte order within a register is set (and this is implemented in your ReadHoldingRegistersMsg function). MODBUS uses a ‘big-Endian’ representation for addresses and data items. This means we need to think about encoding.
#READ ERROR MODBUS POLL 32 BIT#
So we are dealing with a 32 bit number stored across two registers. How should I edit that code to get the correct data ? Thank youį18A Unsigned long integer: numeric data: 0 to (2E32 -1) Value on this app is different to real value on device Ushort CRCFull = 0xFFFF // Set the 16-bit register (CRC register) = FFFFH.ĬRC = CRCHigh = (byte)((CRCFull > 8) & 0xFF) ĬRC = CRCLow = (byte)(CRCFull & 0xFF) UInt16 result = Word.ByteToUInt16(data) įor (int i = 0 i > 8) // Starting Address Highįrame = (byte)startAddress // Starting Address Lowįrame = (byte)(numberOfPoints > 8) // Quantity of Registers Highįrame = (byte)numberOfPoints // Quantity of Registers Lowīyte crc = this.CalculateCRC(frame) // Calculate CRC.įrame = crc // Error Check Lowįrame = crc // Error Check High SerialPort1.Read(bufferReceiver, 0, serialPort1.BytesToRead) īyte data = new byte Īrray.Copy(bufferReceiver, 3, data, 0, data.Length) SerialPort1.Write(frame, 0, frame.Length) īyte bufferReceiver = new byte ThreadPool.QueueUserWorkItem(new WaitCallback((obj) =>īyte frame = ReadHoldingRegistersMsg(slaveAddress, startAddress, function, NumberOfPoints) If (serialPort1.IsOpen) serialPort1.Close() SerialPort1 = new SerialPort("COM7", 19200, Parity.None, 8, StopBits.One) Public ModbusRTUProtocol(uint pNumberOfPoints) Private ushort startAddress = 128 //0080 hex => 128 dec Here is some of code on Visual Studio public class ModbusRTUProtocol
![read error modbus poll read error modbus poll](https://hitfreedownload.com/wp-content/uploads/2020/04/1488372194_modbus-poll-213x304-1-210x300.jpg)
I want to read fromĠ080-0081,=> 0089 address from this manual I used visual Studio C# to make program to read holding register of device. I've tried PC to MiCOM P127 Relay (master-slave) communication using Modbus RTU protocol in RS-485