CN110457056B - Instrument on-line upgrading method and receiving device based on HART bus - Google Patents
Instrument on-line upgrading method and receiving device based on HART bus Download PDFInfo
- Publication number
- CN110457056B CN110457056B CN201910706081.XA CN201910706081A CN110457056B CN 110457056 B CN110457056 B CN 110457056B CN 201910706081 A CN201910706081 A CN 201910706081A CN 110457056 B CN110457056 B CN 110457056B
- Authority
- CN
- China
- Prior art keywords
- module
- application program
- data packet
- request
- upgrading
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/382—Information transfer, e.g. on bus using universal interface adapter
- G06F13/385—Information transfer, e.g. on bus using universal interface adapter for adaptation of a particular data processing system to different peripheral devices
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/65—Updates
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computer Security & Cryptography (AREA)
- Stored Programmes (AREA)
Abstract
The invention relates to the field of online upgrading of industrial instruments, in particular to an instrument online upgrading method and a receiving device based on HART (highway addressable remote transducer) bus. The upgrading method comprises the following steps: the instrument online upgrading method based on the HART bus comprises the following steps: acquiring an application program upgrading request sent by a CAL line; sending an application program upgrading file sending request to an upper computer in real time after receiving the application program upgrading request; receiving a current data packet in an application program upgrading file sent by an upper computer based on a HART bus; erasing original data, and writing the data in the current data packet into a corresponding storage address; checking whether the received current data packet has errors; and if no error exists, receiving the next data packet in the application program upgrading file sent by the upper computer based on the HART bus, and repeating the steps until an end frame of the application program upgrading file is received. The receiving device comprises an on-chip memory, a HART communication interface and a control module, wherein the control module comprises: the device comprises an upgrade request module and an upgrade file module.
Description
Technical Field
The invention relates to an online upgrading method of an industrial instrument, in particular to an online upgrading method and a receiving device of an instrument based on HART bus.
Background
In an industrial instrument, an MCU is often used for realizing complex functions, but the MCU needs a simulator for programming an application program, after a product is delivered to a user, the program needs to be changed or upgraded through an external interface, the product needs to be unpacked for maintenance, and the program is difficult to upgrade.
In the prior art, programming for updating an application program is downloaded through a full-duplex interface RS232, but the RS232 interface has poor anti-interference capability and short transmission distance and is only suitable for being used in a product development stage. After the product is put into practical use, the field environment is complex, the number of interference sources is large, the reliability of RS232 communication is poor, and the product is easy to fail in the process of program upgrading. In practical products, one unpractical RS232 interface is configured, so that the complexity and the maintenance cost of the system are increased.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides an instrument online upgrading method and a receiving device based on HART bus, which utilize the HART protocol physical layer widely applied in industrial instruments to transmit data, thereby improving the reliability of application program upgrading.
According to the technical scheme provided by the invention, as the first aspect of the invention:
an online upgrading method for a meter based on a HART bus comprises the following steps:
acquiring an application program upgrading request sent by a CAL line;
sending an application program upgrading file sending request to an upper computer in real time after receiving the application program upgrading request;
receiving a current data packet in an application program upgrading file sent by an upper computer based on a HART bus;
erasing original data, and writing the data in the current data packet into a corresponding storage address;
checking whether the received current data packet has errors;
and if no error exists, receiving the next data packet in the application program upgrading file sent by the upper computer based on the HART bus, and repeating the steps until an end frame of the application program upgrading file is received.
Further, S610: if the error exists, sending the packet data to the upper computer to receive an error signal;
s620: and the upper computer suspends sending the next data packet after receiving the packet data receiving error signal and retransmits the current data packet until the current data packet is error-free.
As a second aspect of the present invention:
the device for receiving the online upgrade of the instrument based on the HART bus is characterized by comprising:
the on-chip memory comprises a bootstrap program memory area positioned at the front section of the memory address bit and an application program memory area positioned at the rear section of the memory address bit;
the HART communication interface is used for sending signals to the upper computer or receiving data packets sent by the upper computer based on a HART bus;
a control module, the control module comprising: an upgrade request module and an upgrade file module;
the upgrading request module can acquire and judge an application program upgrading request;
the upgrading file module can acquire and judge an upgrading file data packet through the HART communication interface; and storing the obtained application program upgrading request in a bootstrap program storage area of an on-chip memory.
Further, the upgrade request module includes:
the upgrading request acquisition module is used for acquiring an application program upgrading request sent by a CAL line;
the upgrading request judging module is used for judging the upgrading request of the application program obtained by the upgrading request obtaining module;
the upgrade file sending request module sends an application program upgrade file sending request to an upper computer according to the judgment result of the upgrade request judging module;
further, the upgrade file module includes:
the data packet receiving module is used for receiving a data packet in an application program upgrading file sent by an upper computer based on an HART bus;
the data packet analysis module is used for analyzing the data packet;
a data erasing module capable of erasing data in an on-chip memory application program storage area;
and the data writing module can write the data analyzed by the data packet analysis module into the corresponding position of the erased application program storage area of the on-chip memory.
Furthermore, the upgrade file module further comprises a check module, wherein the check module is used for acquiring the data packet check code analyzed by the data packet analysis module, and checking whether the received current data packet is incorrect according to the data packet check code.
From the above, it can be seen that the invention provides an online upgrading method and a receiving device for a meter based on a HART bus, which have the following advantages compared with the prior art: the anti-interference performance of communication can be improved and the communication distance can be improved based on the process of upgrading the file data packet by the application program sent by the HART bus, the error rate can be reduced, the reliability of information transmission is improved, and the situation such as accidental power failure does not influence the online upgrade of the MCU program again in the upgrading process; the adoption of the cal line is a judgment on hardware logic, and has higher reliability than the judgment which is purely based on communication.
Drawings
Fig. 1 is a flow chart of a first embodiment of the first aspect of the present invention.
Fig. 2 shows a second and third embodiment of the first aspect of the invention.
Fig. 3 is a block diagram of the second aspect of the present invention.
Fig. 4 is a block diagram illustrating an upgrade request module according to a second aspect of the present invention.
Fig. 5 is a block diagram of the structure of the upgrade file module in the second aspect of the present invention.
100. The system comprises an on-chip memory, 110, a bootstrap program memory area, 120, an application program memory area, 200, a HART communication interface, 300, a control module, 310, an upgrade request module, 311, an upgrade request acquisition module, 312, an upgrade request judgment module, 313, an upgrade file sending request module, 320, an upgrade file module, 321, a data packet receiving module, 322, a data packet analysis module, 323, a data erasing module, 324, a data writing module, 325, a verification module and 326, and a memory address acquisition module.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to specific embodiments and the accompanying drawings. In which like parts are designated by like reference numerals.
A first embodiment as a first aspect of the invention:
as shown in fig. 1, the method for upgrading a HART bus-based instrument online provided by the present invention includes:
s100: acquiring an application program upgrading request sent by an upper computer;
s200: sending an application program upgrading file sending request to an upper computer in real time after receiving the application program upgrading request, wherein the application program upgrading file sending request is a discrete pulse signal, and when the upper computer receives the application program upgrading file sending request of the discrete pulse signal, the upper computer sends an application program upgrading file data packet based on an HART bus through an HART modulation and demodulation circuit;
s300: receiving a current data packet in an application program upgrading file sent by an upper computer based on a HART bus;
s400: identifying a storage address corresponding to the current data packet;
s500: and erasing the original data in the storage address corresponding to the current data packet, and writing the data in the current data packet into the corresponding storage address.
S700: and receiving a next data packet in the application program upgrading file sent by the upper computer based on the HART bus, and repeating the steps until an end frame of the application program upgrading file is received.
It can be understood that, the above online upgrade method can improve the anti-interference performance of communication and can improve the communication distance based on the process of upgrading the file data packet by the application program sent by the HART bus.
A second embodiment as the first aspect of the invention:
as shown in fig. 2;
s100: acquiring an application program upgrading request sent by a CAL line;
s200: sending an application program upgrading file sending request to an upper computer in real time after receiving the application program upgrading request, and sending an application program upgrading file data packet based on an HART bus by the upper computer through an HART modulation and demodulation circuit when receiving the application program upgrading file sending request;
s300: receiving a current data packet in an application program upgrading file sent by an upper computer based on a HART bus;
s400: identifying a storage address corresponding to the current data packet;
s500: erasing the original data in the storage address corresponding to the current data packet, and writing the data in the current data packet into the corresponding storage address;
s600: checking whether the received current data packet is wrong, and if not, performing S700;
s700: and receiving a next data packet in the application program upgrading file sent by the upper computer based on the HART bus, and repeating the steps until an end frame of the application program upgrading file is received.
As a third embodiment of the first aspect of the invention, as shown in fig. 2:
s100: acquiring an application program upgrading request sent by an upper computer;
s200: sending an application program upgrading file sending request to an upper computer in real time after receiving the application program upgrading request, wherein the upper computer sends an application program upgrading file data packet based on an HART bus through an HART modulation and demodulation circuit;
s300: receiving a current data packet in an application program upgrading file sent by an upper computer based on a HART bus;
s400: identifying a storage address corresponding to the current data packet;
s500: erasing the original data in the storage address corresponding to the current data packet, and writing the data in the current data packet into the corresponding storage address;
s600: checking whether the received current data packet has errors;
s610: if the data is wrong, erasing the data written in the corresponding storage address and sending packet data to the upper computer to receive a wrong signal;
s620: and the upper computer suspends sending the next data packet after receiving the packet data receiving error signal, retransmits the current data packet, repeats S100 to S600 until the current data packet is correct, and executes the step S700 if the current data packet is correct.
It can be understood that S600, S610, and S620 are used to determine whether the received data packet is correct, reduce the error rate, and improve the reliability of information transmission.
As a first embodiment of the second aspect of the present invention, as shown in fig. 3:
the utility model provides a based on online upgrade receiving arrangement of HART bus instrument, the online upgrade receiving arrangement of HART bus instrument includes:
an on-chip memory 100, wherein the on-chip memory 100 comprises a bootstrap memory area 110 located at the front section of the memory address bit and an application memory area 120 located at the rear section of the memory address bit; it should be explained that the bootstrap memory area 110 is used for storing the received bootstrap, receiving the application program sent from the host computer based on the HART bus, and storing the application program in the application memory area. (ii) a The application program storage area 120 is used for storing received application programs, the content of the application programs is an application program upgrade file data packet sent by an upper computer, and the function of the instrument is determined by the application programs in the application program storage area 120 of the on-chip memory 100.
A control module 300, the control module 300 comprising: an upgrade request module 310 and an upgrade file module 320;
the upgrade request module 310 may obtain and determine an application program upgrade request sent by an upper computer through the HART communication interface 200, and store the obtained application program upgrade request in the bootstrap storage area 110 of the on-chip memory 100; it should be explained that, in S100, after the upgrade request module 310 of the receiving apparatus obtains the application upgrade request sent by the upper computer, the application upgrade request is stored in the boot program storage region 110 of the on-chip memory 100;
the upgrade file module 320 may obtain and determine an upgrade file data packet sent by an upper computer through the HART communication interface 200, and store the upgrade file data packet in the application program storage area 120 of the on-chip memory 100;
and the HART communication interface 200 is used for sending signals to an upper computer or receiving data packets sent by the upper computer based on a HART bus.
As shown in fig. 4, the upgrade request module 310 includes:
an upgrade request obtaining module 311, configured to obtain an application program upgrade request sent by a CAL line;
an upgrade request determining module 312, where the upgrade request determining module 312 is configured to determine an application program upgrade request obtained by the upgrade request obtaining module 311, and if the upgrade request determining module 312 determines that the received request is an application program upgrade request, the upgrade request obtaining module 311 stores the determined application program upgrade request in the bootstrap storage area 110 of the on-chip memory 100;
an upgrade file sending request module 313, wherein if the upgrade request judging module 312 judges that the received request is an application program upgrade request, the upgrade file sending request module 313 sends an application program upgrade file sending request to the upper computer in real time through the HART communication interface 200 according to the judgment result of the upgrade request judging module 312;
it is to be explained that the upper computer starts to send the data packet of the sent application program upgrade file to the receiving device after receiving the sent application program upgrade file sending request.
As shown in fig. 5, the upgrade file module 320 includes:
the data packet receiving module 321 is configured to receive a data packet in an application program upgrade file sent by an upper computer based on a HART bus;
a packet parsing module 322, configured to parse the packet;
a storage address obtaining module 326, where the storage address obtaining module 326 is configured to obtain a storage address corresponding to the data packet parsed by the data packet parsing module 322;
a data erasing module 323, wherein the data erasing module 323 can erase data in the application program storage area 120 of the on-chip memory 100 at a position corresponding to the storage address acquired by the storage address acquiring module 326;
a data writing module 324, wherein the data writing module 324 can write the data parsed by the packet parsing module 322 into a position corresponding to the application storage area 120 of the on-chip memory 100 erased by the packet parsing module 322.
A checking module 325, where the checking module 325 is configured to obtain the data packet check code analyzed by the data packet analyzing module 322, and check whether the received current data packet has an error according to the data packet check code.
It can be understood that, if the checking module 325 determines that the data packet received by the data packet receiving module 321 is incorrect, the receiving device receives an incorrect signal to the sending packet data; and the upper computer suspends sending the next data packet after receiving the packet data receiving error signal and retransmits the current data packet until the current data packet is error-free.
Those of ordinary skill in the art will understand that: the above description is only exemplary of the present invention and should not be construed as limiting the present invention, and any modifications, equivalents, improvements and the like made within the spirit of the present invention should be included in the scope of the present invention.
Claims (6)
1. An instrument online upgrading method based on HART bus is characterized by comprising the following steps:
step S100: acquiring an application program upgrading request sent by a CAL line;
step S200: sending an application program upgrading file sending request to an upper computer in real time after receiving the application program upgrading request;
step S300: receiving a current data packet in an application program upgrading file sent by an upper computer based on a HART bus;
step S400: identifying a storage address corresponding to the current data packet;
step S500: erasing the original data in the storage address corresponding to the current data packet, and writing the data in the current data packet into the corresponding storage address;
step S600: checking whether the received current data packet has errors;
step S700: and if no error exists, receiving a next data packet in the application program upgrading file sent by the upper computer based on the HART bus, and repeating the steps S300 to S600 until an end frame of the application program upgrading file is received.
2. The HART-bus based meter online upgrade method according to claim 1,
if the error exists, sending the packet data to the upper computer to receive an error signal;
and the upper computer suspends sending the next data packet after receiving the packet data receiving error signal and retransmits the current data packet until the current data packet is error-free.
3. The device for receiving the online upgrade of the instrument based on the HART bus is characterized by comprising:
the on-chip memory (100) comprises a bootstrap program memory area (110) located at the front section of the memory address bit and an application program memory area (120) located at the rear section of the memory address bit;
the HART communication interface (200) is used for sending signals to the upper computer or receiving data packets sent by the upper computer based on a HART bus;
a control module (300), the control module (300) comprising: an upgrade request module (310) and an upgrade file module (320);
the upgrading request module (310) can acquire and judge an application program upgrading request, and stores the application program upgrading request into a bootstrap program storage area (110) of the on-chip memory (100);
the upgrading file module (320) can acquire and judge an upgrading file data packet through the HART communication interface (200); and storing the upgrade file data packet in an application program storage area (120) of an on-chip memory (100).
4. The HART-bus-based meter online upgrade receiving device according to claim 3, wherein the upgrade request module (310) comprises:
the upgrading request acquisition module (311), the upgrading request acquisition module (311) is used for the application program upgrading request sent by the CAL line;
the upgrading request judging module (312), the upgrading request judging module (312) is used for judging the upgrading request of the application program obtained by the upgrading request obtaining module (311);
and the upgrade file sending request module (313) sends an application program upgrade file sending request to an upper computer according to the judgment result of the upgrade request judging module (312).
5. The HART-bus-based meter online upgrade receiving device according to claim 3 or 4, wherein the upgrade file module (320) comprises:
the data packet receiving module (321) is used for receiving a data packet in an application program upgrading file sent by the upper computer based on the HART bus;
a packet parsing module (322), the packet parsing module (322) being configured to parse the packet;
a data erasure module (323), the data erasure module (323) being capable of erasing data in an application storage area (120) of an on-chip memory (100);
a data writing module (324), wherein the data writing module (324) can write the data analyzed by the data packet analyzing module (322) into the erased application program storage area (120) of the on-chip memory (100).
6. The HART-bus-based meter online upgrade receiving device according to claim 5, wherein the upgrade file module (320) further comprises a check module (325), the check module (325) is configured to obtain a data packet check code analyzed by the data packet analysis module (322), and check whether the received current data packet has an error according to the data packet check code.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910706081.XA CN110457056B (en) | 2019-08-01 | 2019-08-01 | Instrument on-line upgrading method and receiving device based on HART bus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910706081.XA CN110457056B (en) | 2019-08-01 | 2019-08-01 | Instrument on-line upgrading method and receiving device based on HART bus |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110457056A CN110457056A (en) | 2019-11-15 |
CN110457056B true CN110457056B (en) | 2021-07-02 |
Family
ID=68484432
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910706081.XA Active CN110457056B (en) | 2019-08-01 | 2019-08-01 | Instrument on-line upgrading method and receiving device based on HART bus |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110457056B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112445508B (en) * | 2020-10-17 | 2022-10-04 | 中国航空工业集团公司洛阳电光设备研究所 | ARM application program online upgrading method based on CAN bus |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101625387A (en) * | 2009-08-06 | 2010-01-13 | 上海工业自动化仪表研究所 | Fast scanning detecting device of two-wire system industrial instrument and detecting method |
CN103002129A (en) * | 2012-11-16 | 2013-03-27 | 上海工业自动化仪表研究院 | Smartphone-based HART (highway addressable remote transducer) handheld operator and implementation method thereof |
CN103701789A (en) * | 2013-12-20 | 2014-04-02 | 重庆川仪自动化股份有限公司 | Instrument communication module and method |
CN103763351A (en) * | 2014-01-03 | 2014-04-30 | 中达电通股份有限公司 | Software online upgrading method based on upper computer and lower computers |
-
2019
- 2019-08-01 CN CN201910706081.XA patent/CN110457056B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101625387A (en) * | 2009-08-06 | 2010-01-13 | 上海工业自动化仪表研究所 | Fast scanning detecting device of two-wire system industrial instrument and detecting method |
CN103002129A (en) * | 2012-11-16 | 2013-03-27 | 上海工业自动化仪表研究院 | Smartphone-based HART (highway addressable remote transducer) handheld operator and implementation method thereof |
CN103701789A (en) * | 2013-12-20 | 2014-04-02 | 重庆川仪自动化股份有限公司 | Instrument communication module and method |
CN103763351A (en) * | 2014-01-03 | 2014-04-30 | 中达电通股份有限公司 | Software online upgrading method based on upper computer and lower computers |
Also Published As
Publication number | Publication date |
---|---|
CN110457056A (en) | 2019-11-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20090198770A1 (en) | System and method of updating codes in controller | |
CN102759724B (en) | Testing method and system for communication reliability of intelligent electric energy meters | |
CN111008033A (en) | Universal DSP (digital signal processor) online upgrading system and upgrading method based on serial port | |
CN103631609A (en) | Method and system for refreshing vehicle-mounted ECU application program | |
US20070288937A1 (en) | Virtual Device Driver | |
WO2020019490A1 (en) | Interface testing method, electronic device and storage medium | |
CN111190629B (en) | Embedded terminal upgrading software package and analysis method thereof | |
CN112069074A (en) | RFID tag chip verification device based on UVM | |
CN110457056B (en) | Instrument on-line upgrading method and receiving device based on HART bus | |
CN110795112A (en) | Multi-channel IC burning method, device and system | |
CN109857433B (en) | Single chip microcomputer software upgrading tool and method | |
CN113225232B (en) | Hardware testing method and device, computer equipment and storage medium | |
CN112181460B (en) | Program firmware upgrading method and device, electronic equipment and storage medium | |
CN112286566B (en) | Automobile instrument differential upgrading method based on USB transmission | |
CN110134423B (en) | Firmware updating method and device and computer readable storage medium | |
CN100399752C (en) | System and method for testing digital communication signal processing single board | |
CN112346665B (en) | PCIE-based communication method, device, equipment, system and storage medium | |
CN112463633B (en) | Method, device, equipment and medium for checking address decoding of on-chip memory | |
CN110908818B (en) | Verification method, device, equipment and storage medium | |
CN113010114A (en) | Data processing method and device, computer equipment and storage medium | |
CN113034873A (en) | Sensor communication method, device and system | |
CN111857664B (en) | Application development method, device, equipment and storage medium | |
KR20010027466A (en) | Method for reprogramming ecu of vehicles | |
CN114594752B (en) | Tractor control unit software refreshing method and storage medium | |
US20070074082A1 (en) | Systems and methods for gathering debug information |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |