Real-time receiving and transmitting method and device based on Linux platform and storage medium
A real-time receiving and platform technology, applied in the direction of bus network, data exchange through path configuration, etc., can solve the problems of needing to modify the driver, heavy workload to modify the driver, and heavy workload.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0038] The invention provides a real-time sending and receiving method based on a Linux platform, and relates to an electric meter product realized by using a LINUX operating system, and a device for collecting and transmitting data through a serial port RS485.
[0039] The MODBUS RTU protocol specification is an industry standard (De facto) for communication protocols in the industrial field, and is now a common connection method between industrial electronic devices. The main reasons why Modbus is more widely used than other communication protocols are: public publication and no copyright requirements, easy deployment and maintenance; Modbus RTU In data acquisition and supervisory control systems (SCADA), Modbus is usually used to connect monitoring computers and remote terminals Control system (RTU).
[0040] Such as figure 1 As shown, the real-time transceiving method based on Linux platform of the present invention comprises the steps:
[0041] S1: Set the current threa...
Embodiment 2
[0052] Embodiment 2 discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the following steps are implemented:
[0053] Setting step: set the current thread as the state of receiving data in real time, and set the state of receiving data in real time as the highest priority; detection step: detect whether the serial port device has collected data, if so, execute the judgment step, otherwise judge whether it is in the preset Collect the data within the waiting time, if so, execute the judgment step, otherwise re-detect the serial port device; judgment step: judge whether the frame length of the collected data meets the preset byte, if so, execute the matching step, otherwise , continue to collect the remaining bytes of the data; matching step: match each component in the frame format of the data with the corresponding information in the ...
Embodiment 3
[0056] Embodiment 3 discloses a readable computer storage medium, which is used to store a program, and when the program is executed by a processor, the real-time sending and receiving method of Embodiment 1 is realized.
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 
