Determining Length of ADU

C

Thread Starter

Chuck

I am admittedly a Modbus Newbie with prior experience in CANOpen, Profibus and DeviceNET. I have also designed proprietary serial protocols of my own.

My question is regarding the decoding of an ADU in the context of a slave unit. Since the ADU has no length parameter, must the entire PDU be looked at before reaching the CRC? This seems to be a lot of work if the data is in error.
 
I've only recently started working with modbus, but as far as I can tell, you will need to look at the entire PDU. The CRC check is just to make sure that the whole packet was transmitted correctly, so for there to be a CRC error, you need to apply the CRC check to the whole packet.

I guess you may be talking about other errors though, for instance an invalid address range, etc. When developing my slave, I just followed the state diagrams in the Modbus Application Protocol Specification before each function code, in which case you need to get past the initial CRC check.

Hope that helps... it's not really much extra work, the CRC functions are given in the serial implementation guide.
 
Top