Introduction to RS485 communication method of FATEK FBs series PLC

Publisher:CreativeDreamerLatest update time:2024-07-04 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

This project is a pipe bending machine equipment renovation project. Without destroying the original functions of the equipment, only the original FATEK PLC of the equipment is replaced, so that the pipe bending machine can interact with the Estun robot through signals. The robot can load and unload the pipe bending machine, which saves labor costs and improves production efficiency.


This article describes the RS485 communication method between two FATEK FBs series PLCs.


FATEK PLC

The two PLC models are FBS-44MN.

FBs-CB25 communication expansion board

Two FBs-CB25 communication expansion boards. Each FBs-CB25 communication expansion board has two communication ports, one is Port1 (RS232) and the other is Port2 (RS485).

410e6ab2-356e-11ee-9e74-dac502259ad0.jpg

PLC Programming Software

FBs-CB25 communication board RS485 wiring method

4139d418-356e-11ee-9e74-dac502259ad0.jpg

The quality of the transmission line has a great impact on the transmission signal. The signal attenuation of a poor quality twisted pair is very large at high transmission rates, and the transmission distance will be greatly shortened. In addition, its noise immunity is poor and it is easily affected by noise. Therefore, it is necessary to use a twisted pair with an outer shielding coating.

The transmission line must be connected from the first station to the second station, then from the second station to the third station, and then one by one to the last station.

Each communication expansion board has a set of terminal resistors. In the RS485 communication architecture, the terminal resistor switches of the two PLCs on the far left and far right need to be adjusted to the "0N" position (they are set to the "OFF" position when shipped from the factory), and the terminal resistors of all PLCs between the two sides need to be set to the "OFF" position.

Edit PLC parameters and programs

PLC parameters

Setting the communication protocol

4151aa0c-356e-11ee-9e74-dac502259ad0.jpg 4181ce4e-356e-11ee-9e74-dac502259ad0.jpg 419e13b0-356e-11ee-9e74-dac502259ad0.png

First, set the "communication protocol of Port2 communication port" of the two FATEK PLCs. Select "ModBus RTU" here.

FATEK FBs series PLC has three communication protocols: FATEK communication protocol, ModBus protocol, and Freeport communication protocol. Users can choose the communication protocol of the communication port according to different intelligent terminals.

Communication Protocol

illustrate

FATEK communication protocol

This communication protocol is applicable to all communication ports on the FATEK PLC host in standard communication mode. In addition to the consistency of both parties in hardware connection and communication parameter settings, any data read and write operation on the PLC must also comply with the format of this communication protocol in terms of communication information format, so that the PLC can respond correctly. In the communication structure of FATEK PLC, FATEK PLC is defined as a slave (SLAVE), and any peripheral device connected to FATEK PLC is a master (MASTER), that is, the master (peripheral device) actively sends commands, and the slave (FATEK PLC) can only respond to the main system according to the requirements of the command after receiving the command information, and cannot actively send information to the main system.

ModBus Protocol

Modbus is a master/slave communication mode with a single master station. There is only one master station on the Modbus network. The master station has no address on the Modbus network. The address range of the slave station is 0~247, where 0 is the broadcast address and the actual address range of the slave station is 1~247. The Modbus communication standard protocol can be transmitted through various transmission lines, such as RS232C, RS485, optical fiber, radio, etc. Modbus has two serial transmission modes, ASCII and RTU. They define different ways of how data is packaged and decoded. Devices that support the Modbus protocol generally support the RTU format. Both communicating parties must support one of the above modes at the same time.

Freeport communication protocol

The so-called free communication protocol, FATEK PLC as the master station, writes the communication transmission data format according to the communication format of the slave station device to ensure the consistency of the communication format. Only when the data format of the slave station device is in line with the data format of the slave station device can the device recognize the command requirements sent by the master station, and then process the data and respond to the command. This will greatly improve the compatibility of the communication interface of the PLC control object.

Setting communication parameters

41c551b4-356e-11ee-9e74-dac502259ad0.jpg

Communication Port

Setting the register

Just recognize the value

Default communication speed

Other communication default parameters

Port0

R4050

5621H

9600 bps

7-bit Data、Even、1 -bit Stop

Port1

R4146

5621H

9600 bps

7-bit Data、Even、1 -bit Stop

Port2

R4158

5621H

9600 bps

7-bit Data、Even、1 -bit Stop

Port2 (High Speed)

R4161

5665H

153600 bps

8-bit Data、Even、1 -bit Stop

Port3

R4043

5621H

9600 bps

7-bit Data、Even、1 -bit Stop

Port4

R4044

5621H

9600 bps

7-bit Data、Even、1 -bit Stop

Because the communication port of this project is "Port2", the "Port2" port needs to be set. There are two ways to set the Port2 communication parameters: "Port2 communication parameters" and "Port2 communication parameters (H)". Since the production cycle of the pipe bending machine is relatively high and the communication between PLCs also involves data transmission, the "Port2 communication parameters (H)" method is selected. When setting its communication rate, it must be ≥38400.

Delayed response time: After the PLC receives and processes a communication command, it will wait until the delayed response time expires before responding to the communication command.

Transmission delay time: When the PLC communication port uses FUN150 (M-BUS) or FUN151 (CLINK) as the Master of the ModBus or Fatek communication network, the next communication command can be set to wait until the transmission delay time expires before being sent out.

Receiving abnormal detection time:

1. When the PLC communication port is set to ModBus RTU communication protocol, the system will use the default receiving interval to distinguish each communication command. If the default value of the system causes occasional poor communication, you can set M1956 to 1 and set the high byte of R4148 to improve the poor communication phenomenon.

2. When the PLC communication port uses FUN151 (CLINK) to communicate with the external peripherals, if the communication protocol itself does not have an end code to distinguish each communication message, the high byte of R4148 is used to determine the receiving interval of the new message.

Set the PLC station number

41f23ee0-356e-11ee-9e74-dac502259ad0.jpg

Because this project uses two FBs series PLCs, the station numbers must be set in sequence when setting the communication station numbers, and they cannot be repeated.

PLC Program Editing

4214bc4a-356e-11ee-9e74-dac502259ad0.jpg

R4047: Port1~Port4 communication protocol setting (set Port1~Port4 to FATEK or Modbus RTU communication protocol).

R4161: Define communication parameters of communication port 2 (high-speed CPU LINK).

R4055: Display or set the PLC station number (when the high byte of the register is not equal to 55H, the content of R4055 displays the station number of this PLC; when the high byte of register R4055 is equal to 55H, the low byte of R4055 is used to set the station number of this PLC).

R4047: (high byte) = 56H. The communication port is planned to be ModBus RTU/ModBus ASCII communication protocol interface

=Other values, no above functions (default is FATEK communication protocol)

(Low byte) =Port1~4, FATEK/ModBus RTU/ModBus ASCII communication protocol.

The format of R4047 is shown below:

422d02f0-356e-11ee-9e74-dac502259ad0.jpg

The format of R4161 is shown below:

425e73e4-356e-11ee-9e74-dac502259ad0.jpg

427b7322-356e-11ee-9e74-dac502259ad0.jpg

The format of R4055 is as follows:

429fe450-356e-11ee-9e74-dac502259ad0.jpg

General Summary

In this project, when using FATEK PLC-FBs series PLC for RS485 communication, the communication parameters can be reasonably set according to the on-site conditions. Be careful when writing PLC programs. If three PLCs are communicating, except for the PLC station number, the other parameter settings need to be set the same. After setting the communication parameters, FATEK PLC still needs to write a "parameter program" in the program. Since data transmission and other functions are required between the two PLCs, when writing the "ModBus Master Table", it is necessary to pay attention to the data format and content length in the table, which will affect the communication rate.


Reference address:Introduction to RS485 communication method of FATEK FBs series PLC

Previous article:Installation and advantages of CH44X series Hall sensors in brushless motors
Next article:The difference between variable frequency motor and BLDC motor Advantages and disadvantages of BLDC variable frequency motor

Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号