A MODBUS asynchronous character transmission protocol has been implemented on the serial link of the KD8 recorder. The parameter configuration of the RS-485 serial link is described in the KD8 recorder user’s manual. Parameter set of the KD8 recorder serial link: •...
port communication parameters (baud rate, information unit) during the configuration of any device. In the MODBUS system, transmitted messages are placed into frames that are not related to serial transmission. These frames have a defined beginning and end. This enables for the receiving device to reject incomplete frames and to signal related errors with them.
Start and end indexes are marked symbolically as an interval equal to four lengths of the index (information unit). The checking code consists of 16 bits and emerges as the result of CRC calculation (Cyclical Redundancy Check) of the frame contents. 2.3.
2.4. LRC checking The LRC is calculated by adding together successive 8-bit bytes of the message, discarding any carries, and then two is complementing the result. It is performed on the ASCII message field contents excluding the “colon” character that begins the message, and excluding the CR, LF pair at the end of the message.
3. DESCRIPTION OF FUNCTIONS In the KD8 recorder following protocol functions has been implemented: Code Signification Reading of n-register Slave device identification 3.1. Reading of n-registers (code 03) Request: The function enables the reading of values included in registers in being addressed slave device.
Example concerning the KD8 recorder Slave address Function Number of Device Device state Checksum bytes identifier 4. ERROR CODES When the master device is broadcasting a request to the slave device then, except for messages in the broadcast mode, it expects a correct answer. After sending the request of the master unit, one of the four possibilities can occur: •...
Page 9
If in the slave device there is no bit input with the given address, then the device returns the incorrect answer with the No 02 error code. This means a forbidden data address in the slave device. Possible error codes and their meanings are shown in the table below. Code Meaning Forbidden function...
5. Table of registers • KD8 recorder identifier ( set as a respons to the identification function) : 0xB2 ▪ Register types („Typ” kolumn): float – floating point number (see the description below), sfloat – floating point number (see the description below).
Page 11
Addresses of Addresses of 32-bit 16-bit addressed addressed registers Description registers Float sfloat Float sfloat type type type type 7000 7200 7500 7700 Value of input 1 7002 7202 7501 7701 Value of input 2 7004 7204 7502 7702 Value of input 3 …...
APPENDIX A CALCULATION OF THE CHECKSUM In this appendix some examples of function in the C language calculating the LRC checksum for ASCII mode and the CRC checksum for the RTU mode have been shown The function for LRC calculation has two arguments: unsigned char *outMsg;...
Need help?
Do you have a question about the KD8 and is the answer not in the manual?
Questions and answers