Implementation of S7-200 and Danfoss Free Communication Protocol
2026-04-06 08:16:11··#1
Abstract : This paper introduces the characteristics of the DANFOSS inverter communication protocol and the implementation of free communication between the S7-200 PLC and DANFOSS. Keywords : PLC, DANFOSS, serial port, communication 1 Project Requirements The project aims to monitor and operate three inverters via a touchscreen, using an RS485 serial bus from the PLC to control all operations, including monitoring operating status and reading/writing parameters. For economic convenience and cost savings, the standard configuration of the inverters and the RS485 serial communication protocol are used directly, without using common PROFIBUS boards and protocols. Because the inverter manufacturer's proprietary protocol is used, there is no readily available communication program for the PLC; a suitable communication protocol must be written to meet the requirements. 2 Inverter Communication Protocol The project uses DANFOSS inverters as drive devices. These inverters have standard RS485 serial ports, but the communication protocol used is the manufacturer's proprietary FC protocol. The main characteristics of this protocol are as follows: The host command format has three types: control commands, read commands, and write commands. Control commands: Contain 8 bytes. The master can use these commands to control the slave device's reset, start/stop, forward/reverse rotation, acceleration/deceleration, parameter settings, speed setting, etc. The slave device's response is also 8 bytes, reflecting whether the slave device's voltage, current, torque, frequency, etc., are normal, whether there are faults or warnings, and the slave device's operating speed. Read commands, write commands: Contain 16 bytes. Parameter reading and writing and control can be performed simultaneously, or only parameter reading and writing can be performed without controlling the slave device. One byte contains: start bit, 8 data bits, even parity, and stop bit, totaling 11 bits. Frame structure: start byte, command length byte, address, 4/12 data bytes, XOR parity byte. Timing: Default baud rate 9600, at least two bytes of response time and pause time, maximum response time is 50ms. 3. PLC Communication Protocol : The S7-200 PLC's serial port uses an RS485 physical structure and half-duplex communication mode. In software, it can only be used as an exclusive resource; that is, sending cannot be done while receiving, and receiving cannot be done while sending. Furthermore, no more than one send or receive command can be executed simultaneously. Throughout the entire serial port programming process, ensuring that only one command is executed at any given time is crucial. Therefore, employing a suitable scheduling scheme is key to the success of the entire communication process. [b][align=center]For details, please click: Implementation of the S7-200 and Danfoss Free Communication Protocol[/align][/b]