Some bits are not being send via serial #2421
Unanswered
Rafael-Dagostim
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
SerialPort Version
9.2.7
Node Version
16.3.0
Electron Version
No response
Platform
Windows
Architecture
x64
Hardware or chipset of serialport
FTDI
What steps will reproduce the bug?
I'm testing the modbus protocol manually using the serial port, I'm writing on multiple coils (FC15 on modbus protocol), that's the test code I'm using:
What happens?
All the time I write that on controller using the FTDI, there are some bits that do not appear on the data. Apparently those bits that disappear are always from the end of a byte (like this 255 on the 8th position of Buffer, always miss the last bit when I read)
What should have happened?
On the read of those datas I've send, It should came a value of 255 (11111111) instead of 254 (11111110). To check the modbus coil data I'm using the program CAS Modbus Scanner. On the code test I'ven send, the coil starting on 0 to 9 (10 first bit address) should be with value 1, but note on print the 8th address of first byte is 0.
Additional information
I've opened an issue on the modbus library I'm using, thinking the problem was there, but after creating manually the modbus structure and sending via pure serialPort I noted this problem happens to.
Edit: I forgot to say the data being read are only the last two values of Buffer before the CRC (in this case there are 255 and 7), all the rest of Buffer are infomation needed for the protocol (slave id, command id, etc tec...)
Beta Was this translation helpful? Give feedback.
All reactions