Abstract: Protocol-free communication is a serial communication method for PLCs, applicable to communication between PLCs and host computers or other devices. This paper introduces the connection method between the communication port of an Omron PLC and an Omron V600 series RFID controller, the principle, instructions, and usage steps of protocol-free communication, and the command set and data transmission protocol of the Omron V600 series RFID controller. An example of implementing protocol-free communication between an Omron PLC and an Omron V600 series RFID controller illustrates the implementation method. Experimental results show that protocol-free communication offers flexible programming, high communication reliability, and practical value.
Keywords: Protocol-free communication, PLC, RFID controller, data transmission protocol
No-Protocol Communication between PLC and RFID ControllerAbstract: No-Protocol Communication is a kind of serial communication mode of PLC that can be used in the communications between PLC and host computers or other equipments. The link way of OMRON PLC and V600 serials RFID controller, principles, communication commands and implement steps of No-Protocol Communication, communication commands and data transfer protocol of OMRON V600 serials RFID controller were introduced. The implement method of No-Protocol Communication was explained by the No-Protocol Communication between OMRON PLC and V600 serials RFID controller. The experimental results show that No-Protocol Communication is flexible in programming, credible in communication and valuable in application.
Key words: No-Protocol Communication, PLC, RFID controller, Data Transfer Protocol
0. Introduction
In large-scale production lines, the application of PLC and RFID technologies is increasing to achieve assembly line automation. As a highly reliable control device, PLC, through data communication with RFID, can not only control and manage each production process, but also improve the production efficiency of automated production lines.
Omron's CPM2A/2C, CQM1H, C200Hα, CP1, CJ1 and CS1 series PLCs can all support protocolless communication. Using instructions such as TXD and RXD, data exchange can be performed between the PLC and the computer, between PLCs, and between the PLC and various communication devices (such as frequency converters, barcode readers and serial printers) through the serial communication port to achieve communication [1]. In this paper, the Omron CP1H PLC is selected to realize protocolless communication with the Omron V600 series RFID controller. The PLC is used as the host computer and the RFID controller is used as the slave computer.
1. System Structure
There are two link modes between the host PLC and the slave RFID controller: 1:1 and 1:N. One PLC (host computer) can connect to only 32 RFID tags (slave computers). This article describes the 1:1 link mode. In the system, the PLC and RFID controller are connected via an RS-422 bus. When the host computer communicates with the RFID controller, the dedicated SYSWAY communication protocol is used. The host computer sends communication commands first. After receiving the commands, the RFID controller first analyzes the commands from the host computer and then reads and writes the RFID tags. After communication is completed, the RFID controller returns a response code to the host computer. The SYSWAY communication protocol supports 1:1 and 1:N communication. When the host computer and the RFID controller are connected one-to-one, 1:1 communication is used; when more than one RFID controller is connected to the host computer, 1:N communication is used. In 1:N communication mode, 1:1 communication between the host computer and the RFID controller can be achieved by configuring the RFID controller.
The CP1H host computer acts as the upper-level computer. Since the PLC and RFID controller communicate via RS-422, port 1 of the CP1H uses the CP1W-CIF11 plug-in, which is an RS-422/485 type. The RFID tag (consisting of a V600-CA5D02 RFID controller, a V600-H07 antenna, and a V600-D23P66N passive tag) acts as the lower-level computer. The V600-CA5D02 RFID controller has one RS-232C and one RS-422/485 serial communication port on its body, both supporting communication with host devices such as computers and PLCs. The wiring diagram between the PLC and the RFID controller is shown in Figure 1.
Figure 1. Wiring diagram of PLC and RFID controller
The CP1W-CIF11 has a set of eight DIP switches. SW1 indicates whether a terminating resistor is used; SW2 and SW3 indicate the communication connection method: 422 or 485; SW4 is empty; SW5 and SW6 indicate whether RS control is used during communication. Before use, set the DIP switches according to the communication requirements: SW1 is ON, using a terminating resistor; SW2 and SW3 are OFF, using the 422 connection method; SW5 and SW6 are arbitrary.
2. Protocol-free communication and its commands
Protocol-free communication is a sequential communication protocol that does not use retry processing, does not undergo data format conversion processing, and has corresponding processing branches for the received data. Under the condition of no protocol and no conversion, data is sent and received through the input and output instructions (TXD, RXD) of the communication port. The protocol-free communication process is very simple. It is only necessary to set the serial communication mode of the serial port to protocol-free communication in the PLC system settings. According to protocol-free communication, the PLC can send (data stream from PLC to general external device) and receive data (data stream from general external device to PLC) with external devices with RS-232 ports or RS-422/485 ports according to the TXD and RXD instructions [2]. The implementation steps of protocol-free communication are shown in Figure 2.
Figure 2. Implementation steps of protocol-free communication
When sending and receiving messages using protocol-free communication, the data between the start and end codes is sent using the TXD instruction, or the data to be inserted between the start and end codes is received using the RXD instruction. When sending data using the TXD instruction, the data should first be read from the I/O memory before sending; when receiving data using the RXD instruction, the order is exactly the opposite. The maximum data size for a single TXD/RXD transmission and reception is 256 bytes. In protocol-free communication, the start and end codes for the transmitted and received data are specified by the user in the PLC system settings. Figure 3 shows the instruction structure for protocol-free communication on the Omron CP1H PLC.
Figure 3 Protocol-free communication commands
The TXD instruction performs a no-transformation operation on data of the specified length of bytes to be transmitted, based on the CH number specified by S. When the PLC system is set to no-sequence mode, bits 8-11 of C are output to the serial port (no-sequence mode) of the specified serial communication option. However, transmission is only possible when the transmit readiness flag (serial port 1: A392.13, serial port 2: A392.05) is ON. The maximum number of bytes that can be transmitted is 259 bytes (maximum data size 256 bytes, including start and end codes).
The RXD instruction, in the serial port (no-sequence mode) of the serial communication option board, starts from the CH number (specified by D) of the received data storage and outputs the end-of-reception data, equivalent to the storage byte length specified by N. If the end-of-reception data is less than the storage byte length specified by N, the actual end-of-reception data is output. However, when the end-of-reception flag (serial port 1: A392.14, serial port 2: A392.06) is ON, this instruction is executed to receive data (from the receive buffer). The maximum number of bytes that can be received is 259 bytes (maximum data byte 256 bytes, including start and end codes).
3. RFID controller, its command set, and data transmission protocol
The V600 series RFID controller has a rich instruction system with a total of 23 instructions, which can be applied flexibly to various occasions, including communication commands, general communication sub-commands, host commands, etc. [3]. Communication commands are mostly used to perform communication with RFID tags, such as reading and writing RFID tags that are stationary or moving. Communication sub-commands are generally used to cancel the execution of a command, while host commands are used by the host device to control the RFID controller. Communication commands are used most often in the communication process between the host computer and the RFID controller. The codes and functions of commonly used communication commands are shown in Table 1.
Table 1 Commonly Used RFID Communication Commands
In 1:1 communication mode, no checksum is calculated during communication; therefore, the correctness of the communication result can only be determined by the response code. Figure 4 shows the data transmission format between the host computer and the RFID controller. Data blocks sent from the host computer to the RFID controller are command frames, and conversely, data blocks sent from the RFID controller to the host computer are response frames. Each frame begins with an instruction code and ends with an end marker. The response frame also includes a response code indicating the execution result. The host computer and the RFID controller can transmit data in hexadecimal or ASCII format, with a maximum of 271 characters allowed per frame.
If the transmitted data exceeds 271 characters, it can be divided into a start frame, several intermediate frames, and an end frame for transmission. The start frame must contain a command code, read/write header number, and start address; otherwise, errors will occur during communication. After the host computer sends each frame, it waits for the delimiter (i.e., "↙") returned by the RFID controller before sending the next frame. A response code is only returned when the end frame data has been completely transmitted.
Figure 4. RFID controller 1:1 data transmission format
4. Implementation of Protocol-Free Communication between PLC and RFID Controller
4.1 CP1H Communication Port Settings
The PLC and RFID controller communicate using RS-422. According to the RFID controller's communication specifications, the CP1H serial port 1 mode is set to "RS-232C" using Omron programming software CX-Programmer 7.1, with a communication baud rate of 9600 and data format 7, 2, E, as shown in Figure 5.
Figure 5 CP1H communication port settings
4.2 RFID Controller Parameter Settings
The RFID controller communication parameters should be set to match the PLC communication port parameters: baud rate 9600, even parity, 7 data bits, 2 stop bits. DIP switch SW6 should be ON, indicating the use of a terminating resistor.
4.3 Examples of Communication
The program communicates between the PLC and the RFID controller, reading four data points from the channels starting at RFID tag address 0100H and storing the read data in the PLC's DM area. According to the communication data transmission format, the data to be sent is RDA1001004*. This data is converted to a hexadecimal number "524441313030313030342A0D" and stored in the six channels starting at DM0. The corresponding values for these six channels are: DM0: 5244; DM1: 4131; DM2: 3030; DM3: 3130; DM4: 3034; DM5: 2A0D.
The protocol-free communication program between the PLC and the RFID controller is shown in Figure 6. A392.13 is the transmit enable flag. When the PLC's serial port 1 is ready, A392.13 automatically turns ON, and the transmit data indicator 100.00 lights up, allowing the PLC to send data through this port. When 0.00 is ON, data from the six channels starting with DM0 is sent out, and the RFID controller responds upon receiving the command. A392.14 is the receive enable flag. After the serial port is ready, A392.14 automatically turns ON, and the receive data indicator 100.07 lights up. The PLC automatically receives the response data returned by the RFID controller and automatically stores it in the five channels starting with DM100. After executing the program, the contents of the five channels starting with DM100 are as follows: DM100: 5244; DM101: 3030; DM102: 3131; DM103: 3131; DM104: 2A0D. Therefore, the received data is: RD001111*. According to the data format of the data transmission response frame, the four numbers read from the RFID tag are: 1111.
Figure 6. Communication program between PLC and RFID controller
5. Conclusion
Protocol-free communication is a simple and easy communication method that can be implemented by small computers such as Omron's CPM2A and CP series [4]. This communication method is flexible in programming and has high communication reliability, making it a relatively ideal low-cost communication method.
References:
[1] Xu Shixu. Programmable Logic Controller Application Guide—Programming, Communication, and Networking [M]. Beijing: Electronic Industry Press, 2007: 278-285
[2] OMRON. CP1H/CP1L CPU UNIT PROGRAMMING MANUAL[K]. Shanghai: OMRON, 2007
[3] OMRON. RFID System V600 Series OPERATION MANUAL[K]. Shanghai: OMRON, 2003
[4] Wang Fengjie, Hong Yun. Research on protocol-free communication function of Omron PLC [J]. Industrial Control Computer, 2008, 21(5): 45-47