A distributed PLC control system based on RS485 bus communication design - Communication design applications -

by:Coolmay     2020-06-25
Introduction 0

with the development of computer and communication technology, the diversification of various modules of PLC and information technology, is controlled by PLC as the basic unit of the distributed control system is widely used in the field of automation, urgently needs a kind of can bus is suitable for long distance digital communication. On the basis of RS422 standard, the EIA developed a support multiple nodes, long distance and receive high sensitivity of RS485 bus standard. EIA was in front of it all standard combined with RS prefix ( The abbreviation of English RcommendeStandard) , so many engineers who have been following this name, because the RS485 remote ( 1200m) , multiple nodes, 32) And the characteristics of transmission line of low cost, makes the EIA of RS485 industrial application of choice for data transfer standard.

I plant 18 electric actuators debugging line, distribution in three of some area of the plant, each debugging line by a PLC and HMI control, in order to debug data under centralized management, and to assess the correctness of the debug results, to monitor debug line, 18 sets of PLC controller and the computer through the RS485 bus connected to form a distributed monitoring system, through the data communication computer and PLC to realize data sharing, complete the debugging process of centralized management and decentralized control. Each station of the computer and PLC communication is an important part of the system, based on RS485 bus is discussed in detail in this paper, the upper machine communication system, using VB to write a PLC free port communication protocol design and actual application solutions. Can draw lessons from for all kinds of PC, PLC and HMI application example of the communication system design, also can be used as detection technology and automation design project training and teaching platform.

1 RS485 network composition

adopt RS485 standard has balanced to send, a differential received data transceiver to drive the bus, and RS422 is same, can be multiple ( Up to 32) RS485 interface interconnection, and the connection is more simple, just put the of each interface & other; +” The client and & other; +” It connects, & other - - - - - - ” The client and & other; - - - - - - ” And connection to the end of the two wires is RS485 & other; Physical bus & throughout; 。 These interconnected physical status full equality of RS485 interface, logically take a dominant position, the other for the subordinate status. In communication, also used the calling from the reply.

control system hardware structure is shown in figure 1, PC for the computer, the next bit machine adopts Siemens S7 - 200 series PLC, the PLC through the communication port 0 directly on the RS485 bus, PC through RS232/485 converter connected with RS485 bus, the formation of 1: N communication mode. Is the main task of the control system, the upper machine debugging online data information, complete the debugging process monitoring. Under a machine is the main task of the debugging process for automatic control, debug data sent to the PC, and according to the PC command execution.

figure 1 network diagram

2 computer and PLC communication of PC and PLC communication between computer and PLC communication module is actually the command and response, the initial transfer machine has priority, will all debugging data sent to the PC, PC based on the data from the received data to determine which debugging line, the response comes back after data analysis, data and command, lower machine receive only sent to their own data. Communication with & other; Throughout the frame &; For the unit, the frame is divided into data frame and response frame two kinds. Data frame by PLC sent to PC; Response frame after receiving data frames to the upper machine with automatic PLC controller signal command and judging all the instruction code, characters and data are in hexadecimal code sent and received.

S7 - 200 series PLC communication mode has two kinds: one kind is to point to point ( PPI) Communication protocol for the man-machine interface of the PLC programmer or with Siemens product communication between; The other is a completely open to the user free port mode ( freeportmode) , by the user communication protocol. PPI model can only stop way in PLC ( 停止) Under the communication, and free port mode works only on PLC controller ( 运行) Under the communication, we use the free port communication mode before communicate, should first to a serial port initialization. For S7 - 200 PLC is initialized by setting up special marks a SMB30.

2。 1 PLC send instructions

send S7200 PLC have special send instructions to send data, format for:


XMTTABLEPORTTABLE sends data to the number of bytes where the data length, the maximum is 255. To send data must be stored in the back of the TABLE. Such as TABLE storage area for VB600, to send & other; 信息” Form of data storage is shown in figure 2. The PORT specified communication PORT, the project is set to 0. When sending data, PLC special marks a SM4. 5 to 0; After sending, SM4. 5 to 1. So can pass judgment SM4. The state of the 5 to send the post-processing.

figure 2 PLC send information

if you have an interrupt service routine is connected to the sending end events, after sending the last character in the buffer, will generate an interrupt, For port interruption of 0 to 9, for port 1 26) for interrupt event 。

technology zone CPU cache and the second level cache depth analysis eMMC mass burn trouble, do you really know? Isolated flyback and BUCK application design schottky diode in the selection and application guide design how to use Altium Designer makeup?
Shenzhen Coolmay Technology Co., Ltd. is different from other companies as we provide timely and unique services to our respected clients.
Shenzhen Coolmay Technology Co., Ltd. , to be the world leader in products, services and solutions that enable and transform the way consumers and businesses gather, manage, distribute and communicate information.
There are many advantages associated with .
If our brand is successful and consistent, it will be much easier to initially grab customers and encourage them to purchase plc manufacturers further.
Rewards and discount programs give customers more reason to come back for plc manufacturers again, especially in the competitive retail and services markets.
Custom message
Chat Online 编辑模式下无法使用
Chat Online inputting...