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).
PLC Programming Software
FBs-CB25 communication board RS485 wiring method
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
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
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
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
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:
The format of R4161 is shown below:
The format of R4055 is as follows:
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.
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
- Popular Resources
- Popular amplifiers
- "Cross-chip" quantum entanglement helps build more powerful quantum computing capabilities
- Why is the vehicle operating system (Vehicle OS) becoming more and more important?
- Car Sensors - A detailed explanation of LiDAR
- Simple differences between automotive (ultrasonic, millimeter wave, laser) radars
- Comprehensive knowledge about automobile circuits
- Introduction of domestic automotive-grade bipolar latch Hall chip CHA44X
- Infineon Technologies and Magneti Marelli to Drive Regional Control Unit Innovation with AURIX™ TC4x MCU Family
- Power of E-band millimeter-wave radar
- Hardware design of power supply system for automobile controller
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- [TI recommended course] #Common errors and solutions in DC/DC converter design#
- Who has used MSP430 to control T6963C to drive JHD240128D LCD?
- Pyboard timer terminal callback function problem
- Relay wiring
- Blood pressure monitor diastolic and systolic blood pressure
- How to analyze this kind of circuit? I need your advice. It can be paid.
- The 59GHz oscilloscope has arrived. Those who want to test it, please take a look.
- Realizing High-Speed Analog-to-Digital Converters Using CMOS Technology
- [Hua Diao Experience] 02 Simple use of Xingkong board
- TI live broadcast at 8pm tonight [Innovation of next-generation automotive gateway system]