At present, the communication mode of the Siemens S7-300/400 series plc has begun to use industrial Ethernet communication extensively. The MP277/377 and xP177B series touch screens also integrate the Ethernet interface, which brings a benefit. All interfaces are unified in network communication. All Ethernet devices are used. All the devices form a LAN. The upper monitoring computer, programming device, PLC, and touch screen can easily access each other. It is convenient to expand one more device. It only needs to add a switch to expand. Multiple interfaces. Because of these benefits, the use of Ethernet communication is becoming more and more popular. Let's talk about one of the applications of Ethernet communication. The PLC and PLC are interconnected via Ethernet.
Incremental encoders provide speed, direction and relative position feedback by generating a stream of binary pulses proportional to the rotation of a motor or driven shaft. Lander offers both optical and magnetic incremental encoders in 4 mounting options: shafted with coupling, hollow-shaft, hub-shaft or bearingless. Single channel incremental encoders can measure speed which dual channel or quadrature encoders (AB) can interpret direction based on the phase relationship between the 2 channels. Indexed quadrature encoders (ABZ) are also available for homing location are startup.
Incremental Encoder,6Mm Solid Shaft Encoder,Hollow Rotary Encoder,Elevator Door Encoder Jilin Lander Intelligent Technology Co., Ltd , https://www.landermotor.com
1. Interconnection between S7-300/400
1. Using PLC and PLC to access via Ethernet, you need to add Ethernet modules, such as CP343-1, CP443-1 modules, or PLC with PN interface, such as CPU315-2DP/PN PLC.
2, using two CP343-1 interconnection, first in the same project to do two sets of PLC hardware configuration, assign a good IP address, open NetPro, select one of the PLC, double-click the blank line on the connection list, add a
S7 conection. Select another PLC to connect to and remember the ID number of the connection. One of the two sides of the communication is the client side, and the option "Establish an active connection" is activated (the default is activated). So NetPro's configuration is complete, compile and download completed.
3. Open OB1 of two sets of PLCs, call FB12 (BSEND) block to send data, FB13 (BRCV) block to receive data, 1#PLC's transmission corresponds to 2#PLC's receiving, 1#PLC's receiving corresponds to 2#PLC's sending .
4. The meaning of several parameters when calling FB12, a, REQ, sending start, rising edge trigger sending work; b, ID, connection ID number, this ID number is the ID number generated during NetPro configuration; c, R_ID The connection number and the FB block of the same connection number correspond to each other to transmit/receive data. This is defined by the user when programming. For example, the R_ID of FB12 of 1#PLC is DW#16#2, and the R_ID of FB13 of 2#PLC is also DW#16#2, in order to ensure normal receiving and sending; d, DONE, sending is completed, if the REQ end is a non-stop pulse, under normal circumstances, the DONE end should also be a non-stop pulse feedback; e, SD_1, send The starting address is represented by P# xx byte xxx, f, LEN, the length of the transmitted data.
5. It is troublesome to use FB12 and FB13 for sending/receiving. On the one hand, the Ethernet modules at both ends need to support bilateral transmission. For example, Cp343-1-Lean does not support it. On the other hand, both sides must write programs. It is not convenient for the added system, so you can activate One-way (unilateral communication, FB12 and FB13 cannot be used after activation) in NetPro, and use FB14 (GET) to take data and FB15 (PUT) to send data. The parameter definition of FB14 is similar to that of FB12, except that R_ID and LEN are missing, which is more convenient, and there is also a benefit, no need to make any changes to the original system, only need to download the unilateral PLC configuration and program. It’s ok
6. Another problem that needs attention is the difference between FB and SFB. SFB is used on S7-400, FB is used on S7-300, and SFB is used on S7-300 integrated PN port. This problem has been tortured by me. It took two days to resolve.
Second, WinLC and PLC interconnection
WinLC is a software PLC on a PC that can be used as a PLC. This is convenient for software that cannot be connected by the simulator. For example, when using SCADA software such as Intouch and Ifix as the host computer software, the test is a troublesome problem, and it needs to be connected with the actual machine to test, but if there is WinLC, Copying the program to WinLC, the host computer software and WinLC online test, save a lot of work, so WinLC is a good alternative for the environment that is not convenient for field testing. Since WinLC is a set of software PLC, it can realize the function of PLC, then communication with PLC is also achievable.
Let's talk about WinLC and S7-300 interconnection.
1. Create a new project, establish a S7-300 site, hardware configuration; establish a PC site, add a WinLC and an IE General to the PC site. The IP address of IE General is the same as the IP address of the PC. In fact, IE General refers to the Ethernet card of the PC.
2, open NetPro, create a new S7 conection on WinLC, point to S7-300, compile, save
3. Add WinLC and IE General on the PCStation. Note that the slot number should be the same as the hardware configuration.
3. Open the OB block of WinLC and call SFB14 and SFB15 to read and write the data of S7-300.
4. Start the WinLC software and download the program, so that the software PLC and PLC can be interconnected. The combination of the two methods. If there are multiple PLCs, it needs to communicate with the SCADA software on the PC through OPC, but the SCADA software is also read. The speed is too slow to meet the refresh requirements, or the data needs to be pre-processed to display. The SCADA software runs too many scripts and affects the speed. Then the data of multiple PLCs is read through the soft PLC for pre-processing. The SCADA software only communicates with one PLC, so the workload on the SCADA software will be less. At this time, combining the two methods mentioned above, you can achieve such a function.
1, the communication connection refers to the above method settings
2. Add an OPC server on the WinLC PC site and open the OPC connection list in NetPro.
Add an S7 conection, point to WinLC, compile, download
3. The OPC client can directly access the contents of the OPC server. The commonly used SCADA software such as Intouch, Citect, and IFix all support OPC. Setting the access connection can directly read and write on the software. If the interface is simpler, I write an OPC client with VB, and the read and write data is implemented on the VB program. Without SCADA software, a lot of money can be saved.