A IO module communication method

Through the small IO module communication method, the problem of complex IO module communication harnesses in industrial automation machinery is solved, low-cost and efficient data transmission and fault location are achieved, the maintainability and anti-interference ability of the system are improved, and it is suitable for a variety of applications. Industrial automation control scenario.

CN118534827BActive Publication Date: 2024-10-18HANGZHOU COMFIRMWARE TECH CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411000633.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-25
Publication Date
2024-10-18
Estimated Expiration
2044-07-25

AI Technical Summary

Technical Problem

The IO module communication harness in industrial automation machinery is large, complex, difficult to maintain, and costly, which affects the reliability and maintenance convenience of the system.

Method used

It adopts the small IO module communication method to realize data transmission and fault location through system initialization, status communication instructions, real-time communication and automatic diagnosis switching communication methods. It uses special coding to improve the anti-interference ability and supports linear and ring structures.

Benefits of technology

It reduces system costs, simplifies installation, improves system maintainability and communication reliability, and supports the needs of different industrial automation control scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118534827B_ABST
    Figure CN118534827B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of communication technology, and in particular to an IO module communication method. The technical solution includes the following steps: S1: After the system is powered on, the site and the host perform initialization preparation work; S2: The host sends a conversion state communication instruction to the site, and the site enters the initialization state after receiving it; S3: The host sends a state communication instruction, and the site calculates the number of sites based on the received data and uploads the pre-state value; S4: The host sends a state communication instruction again, and the site calculates the cumulative number of the previous slave station data length, and changes the state according to the state number. The present invention realizes high-speed data transmission and reliable control of PLC expansion I / O modules through miniaturization, low-cost design, and efficient data packet encoding and communication protocol. At the same time, it also has good scalability and maintainability, and can meet the needs of different industrial automation control scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to an IO module communication method. Background Art

[0002] Industrial automation machinery generally has many sensors, electromagnets, and air valves. For example, a photovoltaic string welding machine has 65 sensors or buttons and 82 output electromagnets or air valves. Sensors, buttons, and air valves are all in various parts of the machine and are pulled into the electrical cabinet. The wiring harness is large, complex, and dense. The wiring harness is long, the anti-interference performance is reduced, the wiring is difficult, the line search is difficult, the maintenance is inconvenient, and the cost is high. If there is a low-cost module to connect a few sensors, buttons, and air valves and communicate to transmit IO data, there is only one signal and power harness, and the above problems will be greatly reduced. Therefore, the present application proposes an IO module communication method. Summary of the invention

[0003] The purpose of the present invention is to propose an IO module communication method in view of the problem that the existing IO module communication harness in the background technology is bulky, dense, difficult to maintain and has high cost.

[0004] The technical solution of the present invention is an IO module communication method, comprising the following steps:

[0005] S1: After the system is powered on, the site and host perform initialization preparations;

[0006] S2: The host sends a communication instruction for switching state to the station, and the station enters the initialization state after receiving it;

[0007] S3: The host sends a status communication command, and the site calculates the number of sites based on the received data and uploads the pre-status value;

[0008] S4: The host sends the status communication command again, and the station calculates the accumulated length of the previous slave station data and changes the status according to the status number;

[0009] S5: The host performs real-time communication, and the station performs read and write operations and feedback according to the instructions;

[0010] S6: Based on the system architecture and communication conditions, the host automatically diagnoses and switches the communication mode.

[0011] Optionally, in step S2, the host sending the conversion status communication specifically includes: the host sends the conversion status communication, an interface RT0 of the site receives the data and synchronizes another interface RT1 to send the data.

[0012] Optionally, the station enters the initialization state after receiving the data string, specifically including: after the station interface RT0 finishes receiving the data string, it is determined that the length of the data string is 1, the station joins the state communication mode, and the state is the initialization state.

[0013] Optionally, in step S3, the host performs real-time communication including the following steps:

[0014] The host sends status communication. After the station interface RT0 receives the data string, it sends the data corresponding to the initialization status, and the terminal does not send data;

[0015] After receiving the data string, the station diagnoses the number of stations on the bus before the station according to the length of the data string and saves the value;

[0016] The slave station receives data according to the interface RT1, and at the same time, the interface RT0 sends the pre-state value. The terminal station does not wait for the interface RT1 to receive data, but directly sends it, and continuously sends the data received by RT1.

[0017] Optionally, the step S4 specifically includes the following steps:

[0018] Confirmation status communication: The host sends status communication, and the sent status data is the confirmation status;

[0019] After receiving the data string, the station interface RT0 sends the receiving length data corresponding to the real-time status, and the terminal does not send data;

[0020] After receiving the data string, the slave station calculates the accumulated data length of each previous slave station according to the data string and saves it;

[0021] The slave station receives data according to the interface RT1, and at the same time, the interface RT0 sends the receiving length data of the real-time state. The terminal station does not wait for the interface RT1 to receive data, but directly sends it, and continuously sends the data received by RT1. The slave station changes the state to the real-time state according to the state number.

[0022] Optionally, in step S5, the real-time communication specifically includes the following steps:

[0023] The host sends real-time communication. According to the encoding method, the length of real-time read and write data of each slave is 1;

[0024] Write data 0X0F, which means that all four output ports are not outputting. Write data 0X3C, which means that output ports 1 and 2 are outputting. Program a special code and write data 0XFF, which means that the station indicator light flashes for 5 seconds.

[0025] Feedback data 0X0F means that there is no signal at all four input ports. Feedback data 0X3C means that there are signals at input ports 1 and 2. Feedback data such as 0X11 means that there is a signal at input port 1 and the write data check code is wrong.

[0026] Optionally, in S6, the host automatically diagnoses and switches the communication mode, including:

[0027] If the bus station type is known, real-time communication is used;

[0028] When the device is powered on, it is initialized to a linear structure. If it is a ring structure, it will be automatically inferred and switched;

[0029] When the host parameters are inconsistent with the number of sites, communication is carried out through timed feedback data;

[0030] When a breakpoint occurs in the ring structure, it automatically switches to linear structure communication.

[0031] The present invention greatly reduces system costs by using a small IO module. The module size is similar to a USB flash drive, does not include a wiring harness, is easy to install, and can be bound with a cable tie to save installation space.

[0032] The present invention can flexibly configure the number of modules and communication methods according to actual needs, supports linear and ring structures, has strong anti-interference ability, adopts a special encoding method to improve the anti-interference ability of data, and ensures the reliability of communication.

[0033] The present invention can quickly locate and solve communication failures through regular feedback data and automatic diagnosis functions, thereby improving the maintainability of the system.

[0034] The present invention realizes high-speed data transmission and reliable control of PLC expansion I / O modules through miniaturized and low-cost design, as well as efficient data packet encoding and communication protocol. It also has good scalability and maintainability, and can meet the needs of different industrial automation control scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 This is the schematic diagram of SCBS-SUART;

[0036] Figure 2 This is the IO signal isolation diagram;

[0037] Figure 3 To convert to the state communication mode schematic diagram;

[0038] Figure 4 It is the state communication diagram;

[0039] Figure 5 The schematic diagram of the entire data flow for a linear topology. DETAILED DESCRIPTION

[0040] The technical solution of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all of the embodiments.

[0041] The components of the embodiments of the present disclosure generally described and shown in the drawings herein may be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of the present disclosure provided in the drawings is not intended to limit the scope of the present disclosure claimed, but merely represents selected embodiments of the present disclosure.

[0042] Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making any creative work shall fall within the scope of protection of the present disclosure.

[0043] Example

[0044] The PLC expansion IO module is generally an IO module with more than 8 channels. It needs to be installed next to the PLC host and is expensive, usually thousands of yuan. It is large in size and requires a special installation location. This solution is about the same size as a USB flash drive (excluding the wiring harness) and can be tied with a cable tie for installation. Small IO module, 4 inputs and 4 outputs, which greatly reduces costs. Designed with a maximum of 512 inputs and 512 outputs, the bus has a maximum of modules The maximum response time is 1ms and the maximum distance between modules is 10 meters.

[0045] In this embodiment, the IO module station has 4 inputs and 4 outputs, and 4 bits of valid data can be read and written. Because the data packet needs to be verified, an 8-bit data packet, 4-bit IO number, and 4-bit check number are used. In order to achieve maximum anti-interference, the design is 4-bit repeated NF encoding (for example, the 4-bit data is 1001, and the data packet is 10010110). Considering whether the feedback data contains whether the reception is accurate, considering the data station search diagnosis, the special code is programmed to write data 0XFF to indicate station search, and the special code is programmed to write data 0X00 to indicate useless data. The read data is designed to be 4+1-bit repeated NN encoding (4-bit data 1-bit feedback, for example, the 4-bit data is 1001 and the feedback is 0, the check inverse code 1001=0110, the data packet is 10010110, the 4-bit data is 1001 and the feedback is 1, the check 1001=1001, and the data packet is 10011001). The minimum data baud rate is calculated as 2*128*8bit / Ms=2.048Mbit / s, the maximum communication length between sites is 10 meters, and the RS422 of USART is used for communication. The data baud rate is recalculated as 2*128*11bit / Ms=2.816Mbit / s, considering data interference and damage, the baud rate is designed to be 6Mbit / s, and the maximum communication length between sites is 10 meters. To reduce costs, the design is as follows: one communication port is designed to complete the work of two communication interfaces: monitor two communication ports at the same time, control the transmission and reception of the communication ports respectively, and latch the communication port status. The principle design is as follows: Figure 1 shown.

[0046] Because the stations communicate with each other via RS485, the receiver has a high impedance differential input, which has a certain isolation effect. The stations are designed not to be isolated from each other, and a charge pump is used for voltage regulation. The input and output signals are large in size due to the optical coupler isolation, so a comparator high impedance isolation is used, such as Figure 2 The output signal requires a certain driving capability, and is driven by a Darlington tube with a driving capability of 500mA.

[0047] 10mS after the bus is powered on, the station and host are reset and initialized.

[0048] refer to Figure 3-Figure 5 ,1. The host sends the conversion status communication. One of the interfaces RT0 (communication port 0 or communication port 1) of the site receives the data and synchronizes the other RT1 interface to send the data. After the site interface RT0 receives the data string, it determines that the length of the data string is 1. The site joins the status communication mode and the status is the initialization state. In the site status communication mode, because the length of the data string received by RTO is 1, the interface RT0 directly uploads the feedback data (the content is the device type of the site, the length of the device type is greater than 2, the first data is 4-bit repeated NF encoding, and the others are 4-bit check repeated NN encoding) and monitors whether the RT1 interface has received data at the same time. When uploading data, there is received data and the received data is continuously uploaded. The site is set to 2B according to the RT1 received data. The site diagnoses that the site is B sites and saves the number of B sites. If B=0, it means it is the last site. After the master station receives the interface data string, it determines the length of the data string (set to 2N) and diagnoses that the bus has N sites to save the number of sites. The content of the data string determines the device type of each site.

[0049] 2. The host sends status communication, and the status data sent is the real-time status. The station interface RT0 receives the data string and sends 1 data corresponding to the initialization status (content definition reserved) at the same time (the end station does not send data). After the station receives the data string, it diagnoses that there are F stations (including the master station) on the bus before the station according to the length of the data string (set to F), that is, this slave station is F slave stations, and saves the number of F, and changes the pre-state to the real-time state according to the state number. The slave station receives data according to the interface RT1, and at the same time, the interface RT0 sends the pre-state value (the end station does not wait for the interface RT1 to receive data, and sends it directly), and continuously sends the data received by RT1.

[0050] 3. The host sends status communication, and the sending status data is the confirmation status. The site interface RT0 receives the data string and sends the corresponding real-time status receiving length data at the same time (the end station does not send data). After the slave receives the data string, it calculates the cumulative data length of each previous slave station according to the data string (set to Ri) and saves it. The data length of the site may be inconsistent, and the data packets in the data string are not respectively sent out of the packet point. Encoding is required to distinguish between data packets. The design encoding adopts the method mentioned above. For example, when the site data packet has a data length of N, the first data is encoded with 4 bits of repeated NF, and the other data is encoded with repeated NN, so the data packets can be distinguished. The slave receives data according to the interface RT1, and at the same time, the interface RT0 sends the real-time status receiving length data (the end station does not wait for the interface RT1 to receive data, and sends it directly), and continuously sends the data received by RT1. The slave changes the state to the real-time state according to the state number. The master station receives the data string and calculates the write data length of the real-time communication of each site for verification.

[0051] 4. The host sends real-time communication. According to the encoding method mentioned above, the length of real-time read and write data of each slave is 1. Write data such as 0X0F means that all four output ports have no output. Write data such as 0X3C means that output ports 1 and 2 have output. The special code write data 0XFF means that the station search indicator light flashes for 5S. Feedback data (read data) such as 0X0F means that all four input ports have no signal. Feedback data such as 0X3C means that input ports 1 and 2 have signal. Feedback data such as 0X11 means that input port 1 has signal. The write data check code is wrong. Real-time communication, the data string process is as follows Figure 5 The topological structure of the whole data flow. If you know that the bus stations are all I4O4 type, it is also possible for the host to send real-time communication. The device is initialized to the linear structure real-time communication of general communication when it is powered on. The host parameters are inconsistent with the number of stations, which does not affect the communication. Because there is timing feedback data, the location of the station and the timing feedback can be obtained by data string analysis. If it is a ring structure, the device will communicate once in a linear structure when it is powered on. According to the feedback data type, the station automatically infers that the bus is a ring structure and the station location, and automatically enters the ring structure communication. If a breakpoint suddenly occurs in the ring structure, it will communicate once in a ring structure. According to the feedback data type, the station automatically infers that the bus is already a linear structure and the station location, and automatically enters the linear structure communication.

[0052] The existing PLC expansion IO modules are usually large in size, expensive and require a specific installation location. The small IO module designed in this solution is shaped like a USB flash drive, easy to install and greatly reduces the cost. The module is small in size, has 4 inputs and 4 outputs, and can be tied next to the PLC host. It is designed with a maximum of 512 inputs and 512 outputs, a maximum of 128 modules on a bus, a maximum response time of 1 millisecond, and a maximum module spacing of 10 meters. In terms of communication, the station has 4 inputs and 4 outputs, and only 4 bits of valid data are required for reading and writing data. The data packet uses 8 bits, including 4 bits of IO number and 4 bits of check digit. To resist interference, the data packet uses 4-bit repeated NF encoding and 4+1-bit repeated NN encoding. The baud rate is designed to be 6Mbit / s, which is suitable for RS422 communication of USART within 10 meters, taking into account factors such as data interference and cost. Charge pump voltage regulation is used between stations, and power isolation is not performed. The input and output signals are isolated by comparator high impedance, and the output signal is driven by Darlington tube with a driving capacity of 500mA. After the station joins the status communication mode, reset, initialization and other operations can be completed. The host sends data strings of different states, and the station receives the data and gives feedback. If this solution is applied to the situation where the bus station type and equipment are familiar with the power-on initialization, or when a breakpoint suddenly occurs in the ring structure, normal communication can be achieved.

[0053] The above specific embodiments are only several optional embodiments of the present invention. Based on the technical solutions of the present invention and the relevant inspirations of the above embodiments, those skilled in the art can make various alternative improvements and combinations to the above specific embodiments.

Claims

1. An IO module communication method, It is characterized in that The following steps are involved: S1: After the system is powered on, the site and host perform initialization preparations; S2: The host sends a communication instruction for switching state to the station, and the station enters the initialization state after receiving it; S3: the host sends a status communication instruction, and the site calculates the number of sites according to the received data and uploads the pre-state value; in the step S3, the host performs real-time communication specifically including the following steps: the host sends status communication, and after the site interface RT0 receives the data string, it sends the data corresponding to the initialization state, and the end station does not send data; after the site receives the data string, it diagnoses the number of sites on the bus before the site according to the length of the data string, and saves the value; the slave station receives data according to the interface RT1, and at the same time, the interface RT0 sends the pre-state value, and the end station does not wait for the interface RT1 to receive the data, but directly sends it, and continuously sends the data received by RT1; S4: the host sends the status communication instruction again, the site calculates the cumulative number of the data length of the previous slave station, and changes the state according to the status number; the step S4 specifically includes the following steps: confirming the status communication: the host sends the status communication, and the sending status data is the confirmation status; after the site interface RT0 receives the data string, it sends the receiving length data corresponding to the real-time status, and the end station does not send the data; after the slave station receives the data string, it calculates the cumulative number of the data length of each previous slave station according to the data string and saves it; the slave station receives data according to the interface RT1, and at the same time, the interface RT0 sends the receiving length data of the real-time status, the end station does not wait for the interface RT1 to receive the data, but directly sends it, and continuously sends the data received by RT1, and the slave station changes the state to the real-time state according to the status number; S5: The host performs real-time communication, and the site performs read and write operations and feedback according to the instructions; in step S5, the real-time communication specifically includes the following steps: the host sends real-time communication, and according to the encoding method, the length of the real-time read and write data of each slave station is 1; write data 0X0F, indicating that all four output ports do not output, write data 0X3C, indicating that output ports 1 and 2 output, and the special code write data 0XFF, indicating that the station search site indicator flashes wildly for 5S; feedback data 0X0F, indicating that all four input ports have no signal, feedback data 0X3C, indicating that input ports 1 and 2 have signals, feedback data 0X11, indicating that input port 1 has a signal, and the write data check code is wrong; S6: According to the system architecture and communication situation, the host automatically diagnoses and switches the communication mode; in S6, the host automatically diagnoses and switches the communication mode including: if the bus site type is known, real-time communication is used; the device is initialized to a linear structure when it is powered on, and if it is a ring structure, it will automatically infer and switch; when the host parameters are inconsistent with the number of sites, communication is carried out through timed feedback data; when a breakpoint occurs in the ring structure, it automatically switches to a linear structure communication.

2. An IO module communication method according to claim 1, It is characterized in that In the step S2, the host sending the conversion status communication specifically includes: the host sending the conversion status communication, an interface RT0 of the site receives the data and synchronizes another interface RT1 to send the data.

3. An IO module communication method according to claim 2, It is characterized in that After receiving the data, the station enters the initialization state, which specifically includes: after the station interface RT0 receives the data string, it is determined that the length of the data string is 1, the station joins the state communication mode, and the state is the initialization state.

Citation Information

Patent Citations

  • apparatus for attenuating a light beam in optical fiber transmission

    CN101363944A

  • Wireless temperature collection system

    CN104700596A

  • Narrowband NB-IOT communication module for ultrasonic fuel gas meter and use method thereof

    CN109798947A

  • Bus converter

    CN110663227A

  • Stable and reliable single-chip microcomputer system communication method

    CN114253196A