1, the environment:
Computer + Modbus standard agreement from machine serial online (baud rate, address code 01, 9600, 8 data bits, 1 stop bit, and white parity bits)
C #. Netframework4.5 NModBus4
2, read 0 04 register x5025, continuous read three address
Instruction with serial debugging tools can normal hair,
Write instructions: 01 00 04 50 25 03 B0 C0
Collect data: 01 04 06 01 60 00 00 00 00 E1 4 a
3, the phenomenon of bug
Serial port monitor can see that the instruction have normal to send, is that there is no postback data, best can not solution.
4, the code
Because just learning debugging stage, oneself write a serial port can write and read and write can't accept,
Then simply download a great god to do the demo,
Source:
Link: https://pan.baidu.com/s/1mPAhRixLbsDb7h2ePENTRA
The extracted code: b5w6
Follow this code, how can't get data, do not know what place is there is something wrong with the
RegisterBuffer=master. ReadInputRegisters (slaveAddress startAddress, numberOfPoints);
Attach a screenshot:
Points is not much, a great god genuflect is begged directions
CodePudding user response:
Add that the abnormalities of the track to the operation timed outCodePudding user response:
Hello how to deal with?CodePudding user response:
I also use before you download this demo, can be used, you first make sure your function code is right. This software can also try to use ModScan give it a try,