CN105446927B - Serial port communication method based on generating set historical record - Google Patents

Serial port communication method based on generating set historical record Download PDF

Info

Publication number
CN105446927B
CN105446927B CN201510782405.XA CN201510782405A CN105446927B CN 105446927 B CN105446927 B CN 105446927B CN 201510782405 A CN201510782405 A CN 201510782405A CN 105446927 B CN105446927 B CN 105446927B
Authority
CN
China
Prior art keywords
record
historical record
historical
numerical value
data packet
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
Application number
CN201510782405.XA
Other languages
Chinese (zh)
Other versions
CN105446927A (en
Inventor
李朝晖
王磊
徐红宗
邓艳峰
陈荣宛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou Smartgen Technology Co Ltd
Original Assignee
Zhengzhou Smartgen Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Zhengzhou Smartgen Technology Co Ltd filed Critical Zhengzhou Smartgen Technology Co Ltd
Priority to CN201510782405.XA priority Critical patent/CN105446927B/en
Publication of CN105446927A publication Critical patent/CN105446927A/en
Application granted granted Critical
Publication of CN105446927B publication Critical patent/CN105446927B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Alarm Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present invention provides a kind of serial port communication method based on generating set historical record, and this method comprises the following steps:Step 1, the data model of historical record content is established, the data model includes record type, record label, record numerical value, record high alarm setting numerical value, record low alarm setting numerical value, record date and record time;To each data distribution address and sort, to each data distribution memory headroom;Step 2:Historical record communication data packet is established, the historical record communication data packet includes reading historical record and removes historical record:Reading historical record includes sending and receiving, and removing historical record includes sending and receiving;Step 3:Communication realizes that generator set controller reads one or more historical record from the communication data packet of step 2.

Description

Serial port communication method based on generating set historical record
Technical field
The present invention relates to a kind of serial port communication method, specifically, relate to a kind of based on generating set historical record Serial port communication method.
Background technology
Serial communication has tri- kinds of RS232, RS485, RS422 based on what hardware circuit design was commonly used, according to different demands Select different serial communication modes.Based on Software for Design it is the most frequently used, it is most common be exactly Modbus serial communication protocols.By There is its common in generating set communications industry and special place, common monitoring data are assisted using Modbus serial communications View.And it is various for generating set historical record, its data volume complexity, during communicating, with general communication Method needs to devote a tremendous amount of time energy on this unavoidably goes arrangement to handle, and is also easy to malfunction.
In order to solve the problem present on, people are seeking a kind of preferable technical solution always.
The content of the invention
The purpose of the present invention is in view of the shortcomings of the prior art, there is provided a kind of working specification, flexibly, it is easy to accomplish based on The serial port communication method of generating set historical record.
To achieve these goals, the technical solution adopted in the present invention is:It is a kind of based on generating set historical record Serial port communication method, this method comprise the following steps:
Step 1:Establish the data model of historical record content
The data model includes record type, record label, record numerical value, record high alarm setting numerical value, record alarm Lower numerical limit, record date and record time;To each data distribution address and sort, to each data distribution memory headroom;
Step 2:Establish historical record communication data packet
The historical record communication data packet includes reading historical record and removes historical record:
If function code 1CH is the function code for reading historical record, 1DH is the function code for removing historical record;Remember that FF00H is clear Except historical record, 00FFH is successful to remove historical record;
Reading historical record includes sending and receiving, wherein, the transmission data packet format for reading historical record is to be sequentially arranged Module's address, function code 1CH, recording address, record number, check code;Read historical record received data packet form be, sequentially Module's address, function code 1CH, record number, record content, the check code of arrangement;
Removing historical record includes sending and receiving, wherein, the transmission data packet format for removing historical record is sequentially to arrange Module's address, function code 1DH, FF00H, FF00H, the check code of row;Remove historical record received data packet form be, sequentially Module's address, function code 1DH, 00FFH, 00FFH, the check code of arrangement;
Step 3:Communication is realized
Generator set controller reads one or more historical record from the communication data packet of step 2.
Based on above-mentioned, the record type includes stopping alarm, tripping alarm and tripping grinder alarm;The record label Include the index of set number of event title, the record date includes record time, record month and record day, during the record Between include record hour, record minute, record second;
Based on above-mentioned, the address sort mode of each data is 1 record type, 2 record labels, 3 record numerical value, 4 records High alarm setting numerical value, 5 record low alarm setting numerical value, 6 record dates, 7 record times.
Based on above-mentioned, the memory headroom of each data distribution is that record type accounts for a byte, and record label accounts for two words Section, record numerical value account for two bytes, and record high alarm setting numerical value accounts for two bytes, and record low alarm setting numerical value accounts for two bytes, Record date accounts for three bytes, and the record time accounts for three bytes.
Based on above-mentioned, generator set controller circulation preservation historical record, when historical record exceedes the upper limit, covering first Bar records.
The present invention has prominent substantive distinguishing features and marked improvement compared with the prior art, and specifically, the present invention passes through Build historical record data model and communication data packets, make this method working specification, flexibly, it is simple.
Embodiment
Below by embodiment, technical scheme is described in further detail.
A kind of serial port communication method based on generating set historical record, this method comprise the following steps:
Step 1:Establish the data model of historical record content
The data model includes record type, record label, record numerical value, record high alarm setting numerical value, record alarm Lower numerical limit, record date and record time;To each data distribution address and sort, to each data distribution memory headroom.
Wherein, the record type includes stopping alarm, tripping alarm and tripping grinder alarm;The record label includes The index of set number of event title, the record date include record time, record month and record day, the record time bag Include record hour, record minute, record second;
The address sort mode of each data is 1 record type, 2 record labels, 3 record numerical value, 4 record high alarm settings Numerical value, 5 record low alarm setting numerical value, 6 record dates, 7 record times.
The memory headroom of each data distribution is that record type accounts for a byte, and record label accounts for two bytes, records number Value accounts for two bytes, and record high alarm setting numerical value accounts for two bytes, and record low alarm setting numerical value accounts for two bytes, and record date accounts for Three bytes, record time account for three bytes.
Step 2:Establish historical record communication data packet
The historical record communication data packet includes reading historical record and removes historical record:
If function code 1CH is the function code for reading historical record, 1DH is the function code for removing historical record;Remember that FF00H is clear Except historical record, 00FFH is successful to remove historical record;
Reading historical record includes sending and receiving, wherein, the transmission data packet format for reading historical record is to be sequentially arranged Module's address, function code 1CH, recording address, record number, check code;Read historical record received data packet form be, sequentially Module's address, function code 1CH, record number, record content, the check code of arrangement;
Removing historical record includes sending and receiving, wherein, the transmission data packet format for removing historical record is sequentially to arrange Module's address, function code 1DH, FF00H, FF00H, the check code of row;Remove historical record received data packet form be, sequentially Module's address, function code 1DH, 00FFH, 00FFH, the check code of arrangement;
Step 3:Communication is realized
Generator set controller reads one or more historical record from the communication data packet of step 2.
Generator set controller circulation preserves historical record, when historical record exceedes the upper limit, covers first record.Example Such as:Historical record at most preserves 1000, when historical record is more than 1000, covers first record, circulates according to this, here Coordinate record sum, state-of-the-art record label the two parameters again, state-of-the-art record label is exactly a newest historical record here In which bar of the address space of historical record sum distribution, such as when covering the 80th article of record, state-of-the-art record label It is worth for 80, record sum or 1000, then the 81st article is oldest historical record, when generator set controller shows this Bar record just becomes apparent from understanding.
Finally it should be noted that:The above embodiments are merely illustrative of the technical scheme of the present invention and are not intended to be limiting thereof;To the greatest extent The present invention is described in detail with reference to preferred embodiments for pipe, those of ordinary skills in the art should understand that:Still The embodiment of the present invention can be modified or equivalent substitution is carried out to some technical characteristics;Without departing from this hair The spirit of bright technical scheme, it all should cover among the claimed technical scheme scope of the present invention.

Claims (5)

  1. A kind of 1. serial port communication method based on generating set historical record, it is characterised in that:This method comprises the following steps:
    Step 1:Establish the data model of historical record content
    The data model includes record type, record label, record numerical value, record high alarm setting numerical value, record low alarm setting Numerical value, record date and record time;To each data distribution address and sort, to each data distribution memory headroom;
    Step 2:Establish historical record communication data packet
    The historical record communication data packet includes reading historical record and removes historical record:
    If function code 1CH is the function code for reading historical record, 1DH is the function code for removing historical record;Note FF00H goes through for removing The Records of the Historian is recorded, and 00FFH is successful to remove historical record;
    Reading historical record includes sending and receiving, wherein, the transmission data packet format for reading historical record is the module being sequentially arranged Address, function code 1CH, recording address, record number, check code;The received data packet form for reading historical record is to be sequentially arranged Module's address, function code 1CH, record number, record content, check code;
    Removing historical record includes sending and receiving, wherein, the transmission data packet format for removing historical record is to be sequentially arranged Module's address, function code 1DH, FF00H, FF00H, check code;The received data packet form for removing historical record is to be sequentially arranged Module's address, function code 1DH, 00FFH, 00FFH, check code;
    Step 3:Communication is realized
    Generator set controller reads one or more historical record from the communication data packet of step 2.
  2. 2. the serial port communication method according to claim 1 based on generating set historical record, it is characterised in that:The note Recording type includes stopping alarm, tripping alarm and tripping grinder alarm;The record label includes the index of set of event title Number, the record date includes record time, record month and record day, and the record time includes record hour, record point Clock, record second.
  3. 3. the serial port communication method according to claim 1 based on generating set historical record, it is characterised in that:Per number According to address sort mode be 1 record type, 2 record labels, 3 record numerical value, 4 record high alarm setting numerical value, 5 record alarm Lower numerical limit, 6 record dates, 7 record times.
  4. 4. the serial port communication method according to claim 1 based on generating set historical record, it is characterised in that:Per number It is that record type accounts for a byte according to the memory headroom of distribution, record label accounts for two bytes, and record numerical value accounts for two bytes, Record high alarm setting numerical value accounts for two bytes, and record low alarm setting numerical value accounts for two bytes, and record date accounts for three bytes, record Time accounts for three bytes.
  5. 5. the serial port communication method according to claim 1 based on generating set historical record, it is characterised in that:Generator Group controller circulation preserves historical record, when historical record exceedes the upper limit, covers first record.
CN201510782405.XA 2015-11-16 2015-11-16 Serial port communication method based on generating set historical record Active CN105446927B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510782405.XA CN105446927B (en) 2015-11-16 2015-11-16 Serial port communication method based on generating set historical record

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510782405.XA CN105446927B (en) 2015-11-16 2015-11-16 Serial port communication method based on generating set historical record

Publications (2)

Publication Number Publication Date
CN105446927A CN105446927A (en) 2016-03-30
CN105446927B true CN105446927B (en) 2018-03-13

Family

ID=55557147

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510782405.XA Active CN105446927B (en) 2015-11-16 2015-11-16 Serial port communication method based on generating set historical record

Country Status (1)

Country Link
CN (1) CN105446927B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5903737A (en) * 1996-03-06 1999-05-11 Lg Electronics Inc. Apparatus and method for serial data communication utilizing general microcomputer
CN202713370U (en) * 2012-06-25 2013-01-30 浙江运达风电股份有限公司 Wind turbine generator system dual serial communication device based on WP3X00 system
CN203324451U (en) * 2013-07-04 2013-12-04 中能电力科技开发有限公司 Serial port communication-based wind turbine generator operation data acquisition device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5903737A (en) * 1996-03-06 1999-05-11 Lg Electronics Inc. Apparatus and method for serial data communication utilizing general microcomputer
CN202713370U (en) * 2012-06-25 2013-01-30 浙江运达风电股份有限公司 Wind turbine generator system dual serial communication device based on WP3X00 system
CN203324451U (en) * 2013-07-04 2013-12-04 中能电力科技开发有限公司 Serial port communication-based wind turbine generator operation data acquisition device

Also Published As

Publication number Publication date
CN105446927A (en) 2016-03-30

Similar Documents

Publication Publication Date Title
CN102592364A (en) Encryption and decryption functions based field service terminal and application method thereof
CN106874743A (en) The method and system that a kind of cryptographic smart cardses are preserved and extracted
CN105446927B (en) Serial port communication method based on generating set historical record
CN105809231B (en) Multi-frequency multi-purpose electronic tag and using method thereof
CN103746791B (en) Encryption communication device and method applied to the field of industry
CN105303712A (en) Cargo access method and device based on intelligent freshness preservation cabinet
CN203386254U (en) NFC (Near Field Communication) technology-based high-safety access control system
CN101840505A (en) Individual identity identification system
CN204883811U (en) Payment card safety coefficient
CN106682834A (en) Performance management method
CN107203914A (en) A kind of data managing method of raw material order
CN205003796U (en) POS (point of sale) machine
CN104899519A (en) Privacy protection credit method based on virtual ID
CN101329092A (en) Air conditioner and method for limiting time operation
CN201984530U (en) Automatic networking verification system for blank client identities
CN105490780B (en) A kind of variable data transmission method based on RS422 agreements
CN103336986A (en) Fingerprint bank card
CN205541381U (en) Production data acquisition device
CN103310386A (en) RFID-based automatic time optimization method for work piece in production line
CN205121742U (en) Payment terminal circuit based on financial information
CN106157014A (en) A kind of novel auth method
CN106251504B (en) A kind of intelligence express delivery based terminal system
CN107577969B (en) A kind of smart card and its personalization method
CN2470886Y (en) Enciphered IC-card read-wright device
CN203608215U (en) Non-recorded screen single-point bastion machine for operation precision recognition of operation and maintenance database

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant