A method for realizing bidirectional reliable communication through IO port

By controlling the START signal and DATA line, bidirectional reliable communication is achieved using the PLC's X0 and X1 digital I/O ports, solving the problem of high cost of communication equipment between PLCs and reducing equipment deployment costs.

CN116319120BActive Publication Date: 2026-06-09SUZHOU CORESTAR TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SUZHOU CORESTAR TECH CO LTD
Filing Date
2023-05-11
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Traditional PLC communication requires a large number of I/O ports, resulting in high equipment cost and complexity. Traditional I/O ports can transmit signals one-to-one at a fast speed, but they consume a large number of ports.

Method used

The START signal controls the start and stop of pulse signal transmission on the DATA line. Bidirectional reliable communication is achieved using the X0 and X1 digital I/O ports of the PLC. The master and slave ends control data transmission through bus state switching and delay control.

Benefits of technology

It achieves reliable two-way communication, reduces equipment deployment costs, requires only two ordinary digital output ports, and does not require special function pins.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116319120B_ABST
    Figure CN116319120B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of real-time communication, in particular to a method for realizing bidirectional reliable communication through IO ports, then reaching a delay T3 through DATA output data pulse number, then reaching a delay T4 through START switching from BUSY to IDLE, and finally confirming whether all data pulse units are completely sent; after starting work from the slave process, whether START is switched from IDLE to BUSY to receive the number of synchronization pulses is listened to, after confirming whether START is switched from BUSY to IDLE, whether the number of synchronization pulses received is determined, then whether START is switched from IDLE to BUSY is listened to, then the number of received data pulses is confirmed, then whether START is switched from BUSY to IDLE and whether data checking is correct are listened to, and finally whether the received data is valid is confirmed. The application improves the defect that the existing communication equipment structure is complex, only two normal digital output ports are needed for a single communication equipment, special function pins are not needed, so that the cost of equipment arrangement is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of real-time communication technology, specifically a method for achieving bidirectional reliable communication through I / O ports. Background Technology

[0002] Communication refers to the exchange and transmission of information between people or between people and nature through some behavior or medium. In a broad sense, it refers to the accurate and secure transmission of information from one party to another by any method and any medium without violating their own wishes. With the rapid development of modern science, various communication methods such as radio, landline telephone, mobile phone, Internet and even video telephone have emerged. Communication technology has brought people closer together, improved economic efficiency, and profoundly changed human lifestyles and social landscape.

[0003] With the continuous development of technology, the requirements for the functions and flexibility of automated equipment are constantly increasing. Traditional PLC communication mainly relies on communication modules or I / O ports to transmit signals one-to-one. Communication modules can transmit a large number of signals with high accuracy, but the cost is high. I / O ports transmit signals one-to-one with extremely high accuracy and fast transmission speed, but as the amount of transmitted signals increases, the number of I / O ports required for communication between two PLCs continues to increase, consuming a large number of PLC ports and increasing equipment costs. Summary of the Invention

[0004] The purpose of this invention is to address the shortcomings of existing technologies by providing a method for achieving bidirectional reliable communication through I / O ports, thereby solving the problems mentioned in the background art.

[0005] To achieve the above objectives, the present invention provides the following technical solution: a method for achieving bidirectional reliable communication through an I / O port, comprising the following steps:

[0006] Step 1: The START signal controls the start and stop of pulse signal transmission on the DATA line. The DATA line follows the START signal to send a synchronous pulse number and a data pulse number. The START signal is the enable signal for starting / stopping data transmission controlled by the host computer. The DATA line is the pulse signal transmission line controlled by the host computer. The START signal switches between high and low levels by controlling the closing / opening of the PLC's X0 digital I / O port and the COM common terminal. The DATA line outputs pulses by controlling the closing / opening of the PLC's X1 digital I / O port and the COM common terminal.

[0007] Step 2: The master and slave ends initiate communication. The master first switches the START signal from the IDLE bus idle state to the BUSY bus busy state. After a delay of T1, it outputs the number of synchronization pulses through the DATA line. After a delay of T3, it switches the START signal from the BUSY bus busy state back to the IDLE bus idle state. After a delay of T4, it switches the START signal from the IDLE bus idle state back to the BUSY bus busy state again. After a delay of T1, it outputs the number of data pulses through the DATA line. After a delay of T3, it switches the START signal from the BUSY bus busy state back to the IDLE bus idle state. After a delay of T4, it confirms whether all data pulse units have been sent. If not, the above data pulse sending steps are repeated. If completed, the master-end communication ends. IDLE refers to the bus idle state, meaning the START signal is in a low-level state where data transmission is stopped. BUSY refers to the bus busy state, meaning the START signal is in a high-level state where data transmission is started.

[0008] Step 3: After initiating communication from the slave end, monitor in real time whether the START signal changes from the IDLE bus idle state to the BUSY bus busy state. If it changes, receive the number of synchronization pulses transmitted on the DATA line. Then, monitor whether the START signal changes from the BUSY bus busy state to the IDLE bus idle state. If it changes, verify whether the number of received synchronization pulses is the master-slave agreed number. If it is the agreed number, continue to monitor whether the START signal changes from the IDLE bus idle state to the BUSY bus busy state. If it changes, receive the number of data pulses transmitted on the DATA line. Then, monitor whether the START signal changes from the BUSY bus busy state to the IDLE bus idle state. If it changes, verify the number of received data pulses. If the verification is correct, confirm that the received data is valid, and the slave end communication ends.

[0009] The START signal is a host control signal that enables / stops data transmission.

[0010] The DATA refers to the data transmission controlled by the host.

[0011] The IDLE state is the bus idle state, meaning that START is in the stopped data transmission state.

[0012] The BUSY state indicates that the bus is busy, meaning that START is in the state of starting to send data.

[0013] The present invention has the following beneficial effects:

[0014] This method of achieving bidirectional reliable communication through I / O ports improves upon the shortcomings of existing communication equipment with its complex structure. A single communication device only requires two ordinary digital output ports and does not need special function pins, thereby reducing the cost of equipment deployment. Attached Figure Description

[0015] Figure 1 This is a schematic diagram of the main process operation of the present invention;

[0016] Figure 2 This is a schematic diagram of the process operation of the present invention. Detailed Implementation

[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] Please see Figure 1-2 In this implementation scheme: a method for achieving bidirectional reliable communication through I / O ports includes the following steps:

[0019] Step 1: The START signal controls the start and stop of pulse signal transmission on the DATA line. The DATA line follows the START signal to send a synchronous pulse number and a data pulse number. The START signal is the enable signal for starting / stopping data transmission controlled by the host computer. The DATA line is the pulse signal transmission line controlled by the host computer. The START signal switches between high and low levels by controlling the closing / opening of the PLC's X0 digital I / O port and the COM common terminal. The DATA line outputs pulses by controlling the closing / opening of the PLC's X1 digital I / O port and the COM common terminal.

[0020] Step 2: The master and slave ends initiate communication. The master first switches the START signal from the IDLE bus idle state to the BUSY bus busy state. After a delay of T1, it outputs the number of synchronization pulses through the DATA line. After a delay of T3, it switches the START signal from the BUSY bus busy state back to the IDLE bus idle state. After a delay of T4, it switches the START signal from the IDLE bus idle state back to the BUSY bus busy state again. After a delay of T1, it outputs the number of data pulses through the DATA line. After a delay of T3, it switches the START signal from the BUSY bus busy state back to the IDLE bus idle state. After a delay of T4, it confirms whether all data pulse units have been sent. If not, the above data pulse sending steps are repeated. If completed, the master-end communication ends. IDLE refers to the bus idle state, meaning the START signal is in a low-level state where data transmission is stopped. BUSY refers to the bus busy state, meaning the START signal is in a high-level state where data transmission is started.

[0021] Step 3: After initiating communication from the slave end, monitor in real time whether the START signal changes from the IDLE bus idle state to the BUSY bus busy state. If it changes, receive the number of synchronization pulses transmitted on the DATA line. Then, monitor whether the START signal changes from the BUSY bus busy state to the IDLE bus idle state. If it changes, verify whether the number of received synchronization pulses is the master-slave agreed number. If it is the agreed number, continue to monitor whether the START signal changes from the IDLE bus idle state to the BUSY bus busy state. If it changes, receive the number of data pulses transmitted on the DATA line. Then, monitor whether the START signal changes from the BUSY bus busy state to the IDLE bus idle state. If it changes, verify the number of received data pulses. If the verification is correct, confirm that the received data is valid, and the slave end communication ends.

[0022] In this embodiment, START is the enable signal for host control, which starts / stops data transmission; DATA is the host-controlled data transmission; IDLE is the bus idle state, that is, START is in the stopped data transmission state; BUSY is the bus busy state, that is, START is in the started data transmission state.

[0023] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for achieving bidirectional reliable communication via I / O ports, characterized in that: Includes the following steps: Step 1: The START signal controls the start and stop of pulse signal transmission on the DATA line. The DATA line follows the START signal to send a synchronous pulse number and a data pulse number. The START signal is the enable signal for starting / stopping data transmission controlled by the host computer. The DATA line is the pulse signal transmission line controlled by the host computer. The START signal switches between high and low levels by controlling the closing / opening of the PLC's X0 digital I / O port and the COM common terminal. The DATA line outputs pulses by controlling the closing / opening of the PLC's X1 digital I / O port and the COM common terminal. Step 2: The master and slave ends initiate communication. The master first switches the START signal from the IDLE bus idle state to the BUSY bus busy state. After a delay of T1, it outputs the number of synchronization pulses through the DATA line. After a delay of T3, it switches the START signal from the BUSY bus busy state back to the IDLE bus idle state. After a delay of T4, it switches the START signal from the IDLE bus idle state back to the BUSY bus busy state again. After a delay of T1, it outputs the number of data pulses through the DATA line. After a delay of T3, it switches the START signal from the BUSY bus busy state back to the IDLE bus idle state. After a delay of T4, it confirms whether all data pulse units have been sent. If not, the above data pulse sending steps are repeated. If completed, the master-end communication ends. IDLE refers to the bus idle state, meaning the START signal is in a low-level state where data transmission is stopped. BUSY refers to the bus busy state, meaning the START signal is in a high-level state where data transmission is started. Step 3: After initiating communication from the slave end, monitor in real time whether the START signal changes from the IDLE bus idle state to the BUSY bus busy state. If it changes, receive the number of synchronization pulses transmitted on the DATA line. Then, monitor whether the START signal changes from the BUSY bus busy state to the IDLE bus idle state. If it changes, verify whether the number of received synchronization pulses is the master-slave agreed number. If it is the agreed number, continue to monitor whether the START signal changes from the IDLE bus idle state to the BUSY bus busy state. If it changes, receive the number of data pulses transmitted on the DATA line. Then, monitor whether the START signal changes from the BUSY bus busy state to the IDLE bus idle state. If it changes, verify the number of received data pulses. If the verification is correct, confirm that the received data is valid, and the slave end communication ends. The START signal is a host control signal that enables / stops data transmission. The DATA refers to the data transmission controlled by the host. The IDLE state is the bus idle state, meaning that START is in the stopped data transmission state. The BUSY state indicates a busy bus state, meaning that START is in the state of starting to send data.