USB/PPI cable

USB/PPI cable is suitable for the Siemens S7-200 full range of PLCs. It is a programming cable that provides serial connection and RS485 signal conversion and PPI protocol conversion via USB interface.
The driver control running in the computer simulates the USB interface of the computer into a traditional serial port (commonly known as the COM port), thereby using various existing programming software, communication software, and monitoring software. The working power is taken from the USB port and is not powered by the programming port of the PLC. The two-color LED on the converter box indicates the data transmission and reception status. For industrial sites with high interference and easy to damage the communication port, opto-isolated USB/PPI+ programming cable is selected.

USBPPI1

USB/PPI cable characteristics and technical indicators:

1. Support USB/PPI operating system: Windows2000/WindowsXP (WinNT4/95/98/Me/DOS is not supported)
2. Support USB/PPI programming software version: STEP7 Micro/WIN V3.2 and above
3. Fully compatible with USB V1.1 and USB CDC V1.1 specifications
4.USB bus power supply, current consumption is about 50mA
5. Baud rate: 9.6kbps standard baud rate automatically adapts
6. Support UART data format
7. Data bits: 8
8. Stop bits: 1, 2
9. Check digit: odd/even/no parity
10. Support the maximum communication distance of 2KM (9600bps)
11. Only one USB programming cable is supported per PC

USB/PPI cable usage:

The USB/PPI programming cable needs to be installed with the USB device driver. These drivers are included on the CD that ships with the product. For the installation method, please refer to the documentation on the driver CD, which will not be described here.
After the driver installation is completed, the COM port corresponding to the USB/PPI programming cable will appear in the device manager of Windows. Simply select the COM port in the programming software or other application software, and the next use is the same as the traditional RS232. The port programming cable is identical. It should be noted here that the programming cable does not support the “USB” option of the local communication port setting in the programming software.

USB/PPI cable long distance communication:

The maximum communication distance between the USB/PPI programming cable and the PLC can reach 2KM (9600bps). In this case, a 120Ω termination resistor should be connected between the 3rd and 8th pins of the RS485 port of the cable (DB9 Male) to eliminate signal reflection. The PFB-G bus isolator is installed on the PLC side, and the communication line adopts a shielded twisted pair with a cross-sectional area of ​​0.22 mm2 or more. More than 2000 meters distance can be added to the bus to add RS485 repeater to extend the communication distance.

The interface of Siemens PLC is RS485, so why not use USB-485 cable directly, but use USB-PPI and USB-MPI cable?

1. PPI cable can be converted with a simple RS232-RS485 interface, but cannot meet the high-speed communication of 187.5K.
2. There is a protocol chip in the MPI programming cable, which cannot be converted using a simple RS232-RS485 interface.
3. Many people always bite RS485. In fact, it is two things, one is physical, and PPI and MPI are on the agreement.

The difference between Siemens s7-200 programming line USB-ppi and communication line pc-ppi

The Siemens s7-200 programming line usb-ppi and the communication line pc-ppi need to be purchased separately. Why can’t the programming line be used for communication directly? Summary: USB/PPI is a programming cable that provides serial connection and RS485 signal conversion and PPI protocol conversion through USB interface. Under the control of the driver running in the computer, the USB interface of the computer is simulated into the traditional serial port (commonly known as a COM port), so as to use various existing programming software, communication software and monitoring software. The working power of this cable is taken from the USB port and no longer supplied by the PLC programming port. The two-color light-emitting diode on the conversion box indicates the sending and receiving status of data.
How to use it: USB/PPI programming cables require USB device drivers to be installed. These drivers are contained in the cd-rom that is shipped with the product. Please refer to the instructions on the driver cd-rom for the installation method.

After the driver is installed, the corresponding COM port of USB/PPI programming cable will appear in the device manager of Windows. You only need to select the COM port in the programming software or other application software, and the following use is exactly the same as the traditional RS232 programming cable. It should be noted here that this programming cable does not support the “USB” option of local communication port setting in the programming software.

Siemens s7-200 PPI communication protocol

PPI protocol of S7-200 PLC
Through hardware and software listening methods, the PPI communication protocol inherent in the PLC is analyzed, and then the upper computer adopts VB programming, follows the PPI communication protocol, reads and writes PLC data, and realizes man-machine operation tasks. Compared with the usual free communication protocol, this communication method omits the programming of the PLC communication program, and only needs to write the communication program resources of the upper computer.
S7-226’s programming port physical layer is RS-485 structure, SIEMENS provides MicroWin software, using PPI (Point to
Point) protocol, which can be utilized to transfer and debug PLC programs. In the field application, when the PLC is needed to communicate with the host computer, more custom protocols are used to communicate with the host computer. In this communication mode, the programmer needs to first define his own honest communication format, write code in the PLC, and use the interrupt mode to control the data transmission and reception of the communication port. In this way, PLC programming debugging is more cumbersome, consuming PLC software interrupts and code resources, and when the PLC communication port is defined as a free communication port, the PLC programming software cannot monitor the PLC, which brings inconvenience to the PLC program debugging. .
SIEMENS
The programming communication interface of S7-200PLC, the internal curing communication protocol is PPI protocol. If the upper computer follows the PPI protocol to read and write the PLC, the communication code of the PLC can be shown. How to get the PPI agreement? When the PLC programming software reads and writes PLC data, the third serial port can be used to listen to the PLC communication data, or the software method can be used to intercept the data of the port that has been opened and is communicating, and then summarize and parse the data of the PPI protocol. Read and write messages. In this way, the host computer follows the PPI protocol, and can conveniently read and write the data inside the PLC to realize the man-machine operation function of the host computer.
Software design
Measurement and control tasks in the system by SIEMENS
The S7-226PLC is completed, and the PLC works in a cyclic scan mode. When the timing time is up, the data acquisition or PID control task is executed to supplement the on-site signal control. The monitoring software of the computer is compiled by VB, and the serial communication is accomplished by the MSComm control. The protocol monitored by the communication is the PPI protocol.
PPI agreement
Siemens PPI (Point
To
Point) communication protocol adopts master-slave communication mode. The steps of one read/write operation include: first, the upper computer issues a read/write command, and the PLC makes a correct response. When the upper computer receives the response, it sends a confirmation application command, and the PLC completes. The correct reads and writes response, responds to the host computer data. In this approach, the data is sent and received twice, and the reading and writing of data is completed [5].
The format of its communication data message is roughly as follows:
1. The data format of the read and write application is as follows:
SD
LE LER SD DA SA FC DASP SSAP DU FCS ED
SD: (Start
Delimiter) Start delimiter (68H)
LE: (Length) message data length
LER: (Repeated Length) repeat data length
SD:
(Start Delimiter) Start Delimiter (68H)
SA: (Source
Address) The source address, which is a pointer to the address, multiplied by the address value by 8.
DA: (Destination
Address) The target address, which is a pointer to the address, multiplied by 8 for the address value.
FC: (Function Code) function code
DSAP: (Destination
Service Access Point) destination service access point
SSAP: (Source Service Access
Point) source service access point
DU: (Data Unit) data unit
FCS: (Frame Check Sequence) check code
ED: (End
Delimiter) end delimiter (16H)
The message data length and the repeat data length are the data lengths from DA to DU, and the check code is the sum check of the DA to DU data, and only the last byte value is taken.
In the variable data of reading and writing PLC, the function code of the read data is
6CH, the function code for writing data is 7CH.
2. The PLC receives the read/write command and is correct after verification. The returned data format is
E5H
3. Confirm the data format of the read and write commands as:
SD SA DA FC FCS ED
Where SD is the start character and is 10H
SA is the data source address
DA is the destination address
FC is the function code, take 5CH
FCS is the last byte of the sum of SA+DA+FC
ED is the end character, take 16H
Software compilation of PPI protocol
When using the host computer to communicate with the PLC, the host computer adopts VB programming. The computer uses PPI cable or ordinary 485 serial port card to connect with the PLC programming port. The communication system adopts the master-slave structure, and the upper computer follows the PPI protocol format to issue read and write applications. , PLC returns the corresponding data. The program is implemented as follows:
1, the serial port initialization program:
MSComm1.CommPort = 1
MSComm1.Settings = “9600,e,8,1″
MSComm1.InputLen = 0
MSComm1.RThreshold = 1
MSComm1.InputMode =
comInputModeBinary
The PPI protocol defines that the serial port transmits and receives data in binary form, so that the communication efficiency of the message is higher than that of the ASCII code.
2. The serial port reads the data program to read the VB100 data unit as an example:
Dim
Str_Read(0 To 32) ‘Defines the data being sent as an array of bytes as elements.
Str_ Read (32) = &H16
‘The corresponding array element is assigned, in the following format:
Str_ Read (29) = (100*8) \ 256 ‘Address is a pointer value, first take the high address pointer
Str_
Read (30) = (100*8) Mod 256 ‘take low address pointer
Str_ Read (24) = 1
‘Data length read (number of Bytes)
For I=4 to 30
Temp_FCS = Temp_FCS +
Str_Read(i)
Next I
Str_Read(31)= Temp_FCS Mod 256
‘Calculate FCS checksum, other array element assignments are omitted.
68 1B 1B 68 2 0 6C 32 1 0 0 0 0 0 E 0 0 4 1 12 A 10 2 0
1 0 1 84 0 3 20 8B 16
After the PLC returns the data E5, confirm the read command and send the following data:
10 2 0 5C 5E
16
Then the host computer VB program receives the following data:
68 16 16 68 0 2 8 32 3 0 0 0 0 0 2 0 5 0 0 4 1 FF 4 0
8 22 78
16
First, the target address and the source address are identified, and the return data of this application is confirmed, and then the check check is performed. After the correct analysis, the 26th data (&H22) is the data of VB 100 bytes.
3, the serial port write data program, to write VB100 data unit as an example:
Dim
Str_Write(0 To 37) ‘Defines the transmitted data as an array of bytes as elements.
Str_Write (37) = &H16
‘The corresponding array element assignment, according to the following format
Str_Write (35) = &H10 ‘Data value to be written
68 20 20 68 2 0 7C
32 1 0 0 0 0 0 E 0 5 5 1 12 A 10 2 0 1 0 1 84 0 3 20 0 4 0 8 C B9 16
PLC returns data
After E5, confirm the write command and send the following data:
10 2 0 5C 5E 16
Then the host computer VB program receives the following data:
68 12 12 68 0 2 8
32 3 0 0 0 0 0 2 0 1 0 0 5 1 FF 47
16
This is the return data that the PLC correctly receives and writes information.
4, serial port receiving program:
In the data receiving program, the MSComm control in VB is used to receive all the data in the buffer at one time, store it in the temporary storage unit in the form of an array, and then analyze the value of each element to obtain the read and write data.
Dim
RCV_Array() As Byte
Dim Dis_Array As String
Dim RCV_Len As
Long
RCV_Array = MSComm1.Input ‘Remove the data from the serial receive buffer.
RCV_Len =
UBound(RCV_Array)
ReDim Temp(0 To UBound(RCV_Array))
For i = 0 To
RCV_Len
Dis_Array = Dis_Array & Hex(RCV_Array (i)) & ” ”
Next
i
Text1.Text = Dis_Array
‘The received data is sent to the display.
In the program reading and writing process, a maximum of 222 bytes can be read and written at a time, and the currently given data is read and written in an integer format.
Data type Str_
Read(27)
S 04H
SM 05H
I 81H
Q 82H
M 83H
V 84H
The above procedure is based on the V variable area of ​​reading and writing PLC. The PPI protocol can also read and write various types of data in S7-200PLC, including I, Q, SM, M, V, T, C, S and other data. Type, can directly read the above variables in the bits, bytes, words, double words, etc., when reading the bit variable, is to read the byte value of the bit, and then the host computer automatically recognizes the value of the bit. According to the type of data read and written, where Str_
The value of Read(27) is different:
In the control system, the communication between the PLC and the host computer uses the PPI communication protocol, and the host computer cyclically reads and writes the PLC every 0.5 seconds. When the PLC is programmed, the data such as the detected value and output value to be read are stored in a continuous variable area of ​​the PLC. When the host computer reads the data of the PLC, the set of consecutive data can be read out at one time, and the data is reduced. The frequency is frequently read in fractions. When the data such as the set value is modified, the communication operation of writing the data is performed.

How do you implement variable transfer in formats such as VW VD when performing PPI communication between Siemens S7-200 plc?

The NETR/NETW instruction can read and write the M and V variables of the partner (communication partner). Since the M area has limited space (maximum 32 bytes MB0 to 31), the V variable area (10240 bytes) is commonly used as the buffer for communication. Two buffers are identified in each PLC, one for reception and one for transmission.
Programming only needs to call the subroutine created by NETR/NETW in the master station. Then (the main and slave have to do) is to sort the I and AI input data into the send buffer in the v variable area, and then read the receive buffer. The data in the receive buffer of the partner are the same as the data in the send buffer here. Similarly, the data in the receive buffer can be interpreted by reading the data in the receive buffer.
Setting cpu224xp as a slave does not affect the touch screen plugged into PORT1. The two serial ports are separate from each other and can be used separately as master and slave respectively because they have different interrupt numbers. .

How to use a computer to connect AB PLC

First open the RS LINX software and it will automatically scan to the PLC you are connected to. If it is just a monitoring program, then directly open the lower software, online.

If it is a new module, first set the CPU IP with BOOTP/DHCP (modify the IP for the old module can also be modified in RS linx), then use ControlFLASH to brush the hardware (must be the same as your lower computer version)

After you finish, you can use the program to download normally.

64380cd7912397ddfdfaa9e05282b2b7d1a28756

e4dde71190ef76c6dbd7cacf9616fdfaae5167c8

The communication interface of Siemens PLC is how to connect the two wires of RS485 to the 9-pin serial port?

The difference between the parallel port and the serial port is that the way of exchanging information is different. The parallel port can transmit information through 8 data lines at the same time, one byte is transmitted at a time; and the serial port can only transmit one bit of data with one line, each time. Transfer one bit of a byte. In serial communication processing, RTS/CTS and XON/XOFF are often seen. This is the two flow control options. Currently, flow control is mainly used in modem data communication, but for ordinary RS232 programming, understand A little bit of knowledge in this area is good.

The programmable controllers produced by SIEMENS in Germany are also widely used in China, and are used in metallurgy, chemical and printing production lines. Siemens (SIEMENS) PLC products include LOGO, S7-200, S7-1200, S7-300, S7-400 and so on.

The door S7 series PLC is small in size, fast in speed, standardized, and has network communication capability, stronger function and high reliability. S7 series PLC products can be divided into micro PLC (such as S7-200), PLC with small-scale performance requirements (such as S7-300) and PLC with medium and high performance requirements (such as S7-400).

In general, programmable controllers can be classified from three perspectives. The first is to classify the size of the programmable controller from the control, the second is to classify the performance of the programmable controller, and the third is to classify the structural characteristics of the programmable controller.

Siemens PLC S7-200 and computer communication connection

I use the same computer with the same data cable to connect with the PLC, and the PLC224CN PLC connection is normal, why not communicate with a CPU224XP PLC!?

 

09fa513d269759eec7a666a5b4fb43166c22dfeeb219ebc4b74543a94b7ce0a218178a82b901147c

Connect to the computer to set the port. May be USB, maybe COM 2, COM3

Siemens PLC S7-200 is not connected to computer communication:

1, check if the computer has RS232 interface, the programming line and interface are not damaged
Is the USB driver installed and the port set correctly?

2, check if the USB is damaged

3. If there is no problem above, it may be that the communication frequency of the last time the program was written, and the communication frequency of this write is not the same as the communication frequency. At this time, we must use Siemens 5161 card to unlock, reset the communication frequency.

4, if there is still a problem, that is, the communication port of the PLC is damaged.