问题
Another modbus question here, I've been learning Modbus RTU and feel that I have a pretty good grasp on it and am now writing code to convert RTU to TCP.
A question that was brought up to me today was, when you are converting from RTU to TCP, can you leave the CRC on the end?
I know that the TCP structure does not contain a CRC but I'm not sure why?
Any insight to this would be quite helpful :)
回答1:
The CRC is not necessary mainly because TCP/IP is running on top of protocols that already check message integrity against random errors.
MODBUS TCP framing does not include the CRC, since the CRC is the part of the ADU (application data unit) that is specific to MODBUS RTU. If your implementation left it in, you're not implementing MODBUS TCP anymore and you won't interoperate with endpoints that are MODBUS TCP endpoints.
来源:https://stackoverflow.com/questions/33762798/can-you-keep-a-crc-in-a-modbus-tcp-message