In the safety system, F-CPUs can use the PN/PN Coupler module to perform safety-related communication between controllers. Communication is performed through two safety application blocks, namely the SENDDP block for sending data and the RCVDP block for receiving data. These blocks are called by the user in the corresponding safety program of the F-CPU to send 16 data of the BOOL data type and 2 data of the INT data type or 1 data of the DINT data type (S7-1200, S7-1500) to another F-CPU in a fail-safe manner.
In this example, CPU1513F-1PN is used as an IO controller, CPU1215FC is used as another IO controller, and safety-related communication between the two CPUs is realized through PN/PN Coupler (V4.2). CPU1513F uses F application block SENDDP to send in the safety program, and CPU1215FC uses RCVDP to receive in the safety program, transmitting 16 BOOL data and 2 INT data at a time in a safe manner. Note: RCVDP must be called at the beginning of the safety program, and SENDDP must be called at the end of the safety program.
Software and hardware environment used in the example
hardware:
CPU1513F-1PN 6ES7 513-1FL02-0AB0, V2.8.3
CPU1215FC DC/DC/DC 6ES7 215-1AF40-0CB0, V4.4.1
PN/PN Coupler 6ES7 158-3AD10-0XA0, V4.2.0
software:
STEP7 Professional V16 Update2
STEP7 Safety V16
1. The first case (operation in the same project)
In this case, two CPUs are operated in one project using STEP7 V16. The detailed steps are as follows.
1.1 Create a project with STEP7 V16 and add S7-1500 and S7-1200 stations
Use STEP7 V16 to create a new project, and configure the S7-1500 and S7-1200 stations respectively through "Add New Device", select the corresponding CPU model, create their own PN/IE subnets, set their own IP addresses, and confirm the device names.
In this example, the CPU151F device name is PLC_1, and the CPU1215FC device name is PLC_2. See Figure 1.
Figure 1 Create two PLC stations in a new project
1.2 Configuring PN/PN Coupler
Find PN/PN Coupler in the "Hardware Catalog", confirm the order number, select the version, and drag it into the "Network View", as shown in Figure 2.
Figure 2 Drag PN Coupler V4.2 into the project
Figure 3 Connecting the PN Coupler PROFINET interface X1 to the PROFINET interface of the CPU1513F
Figure 4 Configuring the IP address and device name of the PN Coupler PROFINET interface X1
Figure 5 Configuring the IP address and device name of the X2 part of the PN Coupler PROFINET interface
Note: For secure communication, a fixed-format transmission area type must be used. Here, CPU1513F sends data to CPU1215FC, so the type with an output length of 12 bytes must be selected.
Figure 6 Configuring PN Coupler address mapping
The two CPUs are in the same project. The system automatically generates a matching transmission area "PROFISAFE input/output 12 bytes/6 bytes" on the PLC_2 side of the PN Coupler PROFINET interface X2, as shown in Figure 7.
Note: It is best to use the IO address automatically assigned by the system. If you want to modify it, make sure that the starting address of the input address and output address assigned in the transmission area are the same.
Figure 7 PN Coupler address mapping information
Figure 8 Address allocation of the transfer area in two CPUs
1.3 Assigning PN/PN Coupler device names
Click the X1 network interface on the left side of the PN Coupler with the left mouse button, hold down the mouse and drag to connect to the PROFINET interface of the CPU1513F, so that the PROFINET interface X1 of the PN Coupler is connected to the PN/IE_1 subnet, and the IO controller is assigned to PLC_1, as shown in Figure 3. Then set the IP address and device name of the X1 interface, as shown in Figure 4.
Use the same method to drag the PROFINET interface X2 of the PN Coupler to the PROFINET interface of the CPU1215FC. The network will show that it is connected to the PN/IE_2 subnet, and the IO controller will be automatically assigned to PLC_2. The words "Multiple Assignment" will be displayed in the lower left corner of the PN Coupler, and then set the IP address and device name of the X2 interface. See Figure 5.
In the PN Coupler properties interface, create "Transfer Area_1" in "Conversion Mapping" and select "PROFISAFE Input/Output 6 Bytes/12 Bytes" as the type, as shown in Figure 6.
After compiling and downloading both safety CPUs, you still need to assign the PN Coupler device name online so that PROFINET communication can be normal. In addition, since the PN Coupler has two PROFINET network ports, you need to operate them separately.
In the previous configuration, CPU1513F is connected to the PROFINET interface X1 network on the PN Coupler, so when actually connecting the network cable, the PROFINET network cable of CPU1513F should be inserted into the network port of the bus adapter on the left side of the PN Coupler. Similarly, the network cable of CPU1215FC should be inserted into the network port of the bus adapter on the right side of the PN Coupler.
Figure 9 PN Coupler module panel diagram
Take the CPU1513F side operation as an example to introduce the operation of assigning device names. First, ensure that the computer's network cable is connected to the PROFINET interface X1 network on the PN Coupler. Right-click the left side of the PN Coupler with the mouse, and select Assign Device Name in the pop-up dialog box, as shown in Figure 10.
Figure 10 Right click on the left side to open the device name assignment interface
After entering the device name assignment interface, click "Update List" to display the accessible nodes in the network. Check that the MAC address is the same as the MAC ADDRESS 1 printed on the PN Coupler to ensure that it is the PROFINET X1 interface on the PN Coupler. Click "Assign Name", as shown in Figure 11.
Figure 11 Assigning a device name
After the operation is successful, "OK" will be displayed in the status bar, as shown in Figure 12.
Figure 12: Assigning device name completed
Use the same steps to assign a device name to the PROFINET interface X2 of the PN Coupler. After completion, the network view shows that the communication is normal after it is online, as shown in Figure 13.
Note: At this time, the computer's network cable must be connected to the PROFINET interface X2 network on the PN Coupler, and right-click the right side of the PN Coupler with the mouse to check that the MAC address is the same as the MAC ADDRESS 2 printed on the PN Coupler.
Figure 13 Hardware configuration online status
1.4 Programming and downloading
In addition to hardware configuration, safety-related communications also require the use of dedicated safety communication program blocks to send and receive data.
Add an F-DB in the CPU1513F program block, name it "SendData" and create 16 BOOL type and 2 INT type variables for sending data. Add an F-DB in the CPU1215FC program block, name it "RcvData" and create 16 BOOL type and 2 INT type variables for receiving data, as shown in Figure 14.
Figure 14: The structure of the sending data block in CPU1513F
Figure 15 Receive data block structure in CPU1215FC
In the example, CPU1513F sends data to CPU1215FC, so the SENDDP data sending function block is called in the safety main program FB1 of CPU1513F. Pay attention to the filling of parameters DP_DP_ID and LADDR. The location of the instruction is shown in Figure 16.
Figure 16 Instruction location
The LADDR parameter needs to be found in the properties of the PN Coupler X1 interface section as the system constant of "Transmission Area_1", as shown in Figure 17.
Figure 17 Finding the system constants of the transmission area_1 configured in the PN Coupler X1 interface
The RCVDP data receiving function block is called in the safety main program FB1 of CPU1215FC, and the parameter DP_DP_ID must be consistent with the SENDDP of CPU1513F, as shown in Figure 16.
Figure 18 The DP_DP_ID of the receiving function block in CPU1215FC must be consistent with the sending function block in CPU1513F
The LADDR parameter needs to be found in the properties of the PN Coupler X2 interface section as the system constant of "Transmission Area_1", as shown in Figure 19.
Figure 19 Finding the system constants of the transmission area_1 configured in the PN Coupler X2 interface
In the example, CPU1513F sends 2 INT type data to CPU1215FC. If you want to send DINT type data, you only need to fill in the data address to be sent in the input parameter SD_DI_00 of the SENDDP function instruction, and set the input parameter DINTMODE=1.
At this time, CPU1215FC can receive DINT data at the output parameter RD_DI_00 of the RCVDP function instruction. Note: INT and DINT data cannot be transmitted at the same time.
Compile the programs of the two PLCs and then download them to the PLCs respectively.
1.5 Communication Test
After checking for errors, create new monitoring tables for the two sites and monitor the data, as shown in Figure 20.
Figure 20 Communication test
1.6 What to do when a communication error occurs
If a communication error occurs, the sender (SENDDP instruction) sets the output parameters ERROR and SUBS_ON = 1 and displays information about the type of communication error that occurred at the output parameter DIAG.
The receiver (RCVDP instruction) replaces the fail-safe values specified by the input parameters SUBBO_xx and SUBI_xx or SUBDI_00 at the corresponding outputs and sets the outputs ERROR and SUBS_ON = 1. Information about the type of communication error that occurred is displayed at the output parameter DIAG.
Figure 21 SENDDP/RCVDP instruction DIAG structure description
When the communication error is no longer detected, the RCVDP instruction sets the output parameter ACK_REQ = 1, and safe data transfer is resumed with an acknowledgement of the rising edge at the input parameter ACK_REI.
Previous article:Design of Motor Control System Based on FPGA
Next article:What should I do if the PLC output point is broken?
- Popular Resources
- Popular amplifiers
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- How to turn on the internal enable of Panasonic servo drive?
- What is the rigidity setting of Panasonic servo drive?
- How to change the inertia ratio of Panasonic servo drive
- What is the inertia ratio of the servo motor?
- Is it better for the motor to have a large or small moment of inertia?
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- How to turn on the internal enable of Panasonic servo drive?
- What is the rigidity setting of Panasonic servo drive?
- How to change the inertia ratio of Panasonic servo drive
- What is the inertia ratio of the servo motor?
- Is it better for the motor to have a large or small moment of inertia?
- What is the difference between low inertia and high inertia of servo motors?
- The 17th International Medical Device Design and Manufacturing Technology Exhibition invites you to participate!
- Master the core technology, do you know the domestic programming language Mulan?
- Keil C51 MCU Programming Software and Instructions Learning Tutorial (Full Version)
- I also play around with logic analyzers occasionally. I work on hardware. What should I do after capturing these waveform data? Compare the logarithms...
- Disassembled a forehead thermometer
- High-performance control technology for asynchronous motors without speed sensors
- RISC-V MCU IDE MRS (MounRiver Studio) development: bind the opening method of each suffix file
- [Evaluation of SGP40] - SGP40 gas concentration cycle test
- 8 circuit designs that you must know about microcontrollers
- Share: UC3842 switching power supply maintenance example