[go: up one dir, main page]

CN105446927A - Generator set historical record based serial port communication method - Google Patents

Generator set historical record based serial port communication method Download PDF

Info

Publication number
CN105446927A
CN105446927A CN201510782405.XA CN201510782405A CN105446927A CN 105446927 A CN105446927 A CN 105446927A CN 201510782405 A CN201510782405 A CN 201510782405A CN 105446927 A CN105446927 A CN 105446927A
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.)
Granted
Application number
CN201510782405.XA
Other languages
Chinese (zh)
Other versions
CN105446927B (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)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Alarm Systems (AREA)

Abstract

The present invention provides a generator set historical record based serial port communication method. The method comprises the following steps: step 1: establishing a data model of historical record content, wherein the data model comprises a record type, a record number, a record value, a record high alarm limit value, a record low alarm limit value, a record date, and record time; assigning an address to each piece of data and sorting, and assigning memory space to each piece of data; step 2: establishing a historical record communication data packet, wherein the historical record communication data packet comprises historical record reading and historical record clearing; historical record reading comprises sending and receiving, and historical record clearing comprises sending and receiving; and step 3: implementing communication, wherein a generator set controller reads one or more historical records from the communication data packet in step 2.

Description

Based on the serial port communication method of genset historical record
Technical field
The present invention relates to a kind of serial port communication method, specifically, relate to a kind of serial port communication method based on genset historical record.
Background technology
What serial communication was commonly used based on hardware circuit design has RS232, RS485, RS422 tri-kinds, selects different serial communication modes according to different demands.Based on Software for Design the most frequently used, the most general be exactly Modbus serial communication protocol.Due to the place that genset communications industry has it common and special, common monitor data uses Modbus serial communication protocol.And for genset historical record, its data volume complexity is various, doing in the process communicated, unavoidably needing on this, spend a large amount of time energy to go to arrange process with general communication means, but also easily make mistakes.
In order to solve above Problems existing, people are seeking a kind of desirable technical solution always.
Summary of the invention
The object of the invention is for the deficiencies in the prior art, a kind of working specification is provided, flexibly, is easy to the serial port communication method based on genset historical record realized.
To achieve these goals, the technical solution adopted in the present invention is: a kind of serial port communication method based on genset historical record, and the method comprises the following steps:
Step 1: the data model setting up historical record content
Described data model comprises record type, record label, record numerical value, record high alarm setting numerical value, record low alarm limit numerical value, record date and writing time; To sort, to each data storage allocation space to each data allocation address;
Step 2: set up historical record communication data packet
Described historical record communication data packet comprises to be read historical record and removes historical record:
If function code 1CH is the function code reading historical record, 1DH is the function code removing historical record; Note FF00H is for removing historical record, and 00FFH is for removing historical record success;
Read historical record comprise transmission and receive, wherein, the transmission data packet format reading historical record is, the module's address arranged in turn, function code 1CH, recording address, record number, check code; The reception data packet format reading historical record is, the module's address arranged in turn, function code 1CH, record number, record content, check code;
Remove historical record comprise transmission and receive, wherein, the transmission data packet format removing historical record is, the module's address arranged in turn, function code 1DH, FF00H, FF00H, check code; The reception data packet format removing historical record is, the module's address arranged in turn, function code 1DH, 00FFH, 00FFH, check code;
Step 3: communication realizes
Generator set controller reads one or more historical record from the communication data packet of step 2.
Based on above-mentioned, described record type comprises stopping alarm, tripping alarm and tripping grinder and reports to the police; Described record label comprises the index of set number of event title, described record date comprise record the time, record month and record day, comprise described writing time 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 record high alarm setting numerical value, 5 record low alarm limit numerical value, 6 record dates, 7 writing times.
Based on above-mentioned, the memory headroom that each data are distributed is, record type accounts for a byte, record label accounts for two bytes, record numerical value accounts for two bytes, and record high alarm setting numerical value accounts for two bytes, and record low alarm limit numerical value accounts for two bytes, record date accounts for three bytes, accounts for three bytes writing time.
Based on above-mentioned, historical record is preserved in generator set controller circulation, when historical record exceedes in limited time, covers Article 1 record.
Hinge structure of the present invention has outstanding substantive distinguishing features and marked improvement, specifically, the present invention by building historical record data model and communication data packets, make the method working specification, flexibly, simple.
Embodiment
Below by embodiment, technical scheme of the present invention is described in further detail.
Based on a serial port communication method for genset historical record, the method comprises the following steps:
Step 1: the data model setting up historical record content
Described data model comprises record type, record label, record numerical value, record high alarm setting numerical value, record low alarm limit numerical value, record date and writing time; To sort, to each data storage allocation space to each data allocation address.
Wherein, described record type comprises the warning of stopping alarm, tripping alarm and tripping grinder; Described record label comprises the index of set number of event title, described record date comprise record the time, record month and record day, comprise described writing time 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 setting numerical value, 5 record low alarm limit numerical value, 6 record dates, 7 writing times.
The memory headroom that each data are distributed is that record type accounts for a byte, and record label accounts for two bytes, record numerical value accounts for two bytes, and record high alarm setting numerical value accounts for two bytes, and record low alarm limit numerical value accounts for two bytes, record date accounts for three bytes, accounts for three bytes writing time.
Step 2: set up historical record communication data packet
Described historical record communication data packet comprises to be read historical record and removes historical record:
If function code 1CH is the function code reading historical record, 1DH is the function code removing historical record; Note FF00H is for removing historical record, and 00FFH is for removing historical record success;
Read historical record comprise transmission and receive, wherein, the transmission data packet format reading historical record is, the module's address arranged in turn, function code 1CH, recording address, record number, check code; The reception data packet format reading historical record is, the module's address arranged in turn, function code 1CH, record number, record content, check code;
Remove historical record comprise transmission and receive, wherein, the transmission data packet format removing historical record is, the module's address arranged in turn, function code 1DH, FF00H, FF00H, check code; The reception data packet format removing historical record is, the module's address arranged in turn, function code 1DH, 00FFH, 00FFH, check code;
Step 3: communication realizes
Generator set controller reads one or more historical record from the communication data packet of step 2.
Historical record is preserved in generator set controller circulation, when historical record exceedes in limited time, covers Article 1 record.Such as: historical record preserves at most 1000, when historical record is more than 1000, cover Article 1 record, circulate according to this, here record sum, these two parameters of state-of-the-art record label are coordinated again, here which bar of the state-of-the-art record label address space that to be exactly a up-to-date historical record distribute at historical record sum, such as when covering the 80th article of record, the value of state-of-the-art record label is 80, record sum or 1000, so the 81st article is the oldest historical record, records just more clear when generator set controller shows this.
Finally should be noted that: above embodiment is only in order to illustrate that technical scheme of the present invention is not intended to limit; Although with reference to preferred embodiment to invention has been detailed description, those of ordinary skill in the field are to be understood that: still can modify to the specific embodiment of the present invention or carry out equivalent replacement to portion of techniques feature; And not departing from the spirit of technical solution of the present invention, it all should be encompassed in the middle of the technical scheme scope of request of the present invention protection.

Claims (4)

1. based on a serial port communication method for genset historical record, it is characterized in that: the method comprises the following steps:
Step 1: the data model setting up historical record content
Described data model comprises record type, record label, record numerical value, record high alarm setting numerical value, record low alarm limit numerical value, record date and writing time; To sort, to each data storage allocation space to each data allocation address;
Step 2: set up historical record communication data packet
Described historical record communication data packet comprises to be read historical record and removes historical record:
If function code 1CH is the function code reading historical record, 1DH is the function code removing historical record; Note FF00H is for removing historical record, and 00FFH is for removing historical record success;
Read historical record comprise transmission and receive, wherein, the transmission data packet format reading historical record is, the module's address arranged in turn, function code 1CH, recording address, record number, check code; The reception data packet format reading historical record is, the module's address arranged in turn, function code 1CH, record number, record content, check code;
Remove historical record comprise transmission and receive, wherein, the transmission data packet format removing historical record is, the module's address arranged in turn, function code 1DH, FF00H, FF00H, check code; The reception data packet format removing historical record is, the module's address arranged in turn, function code 1DH, 00FFH, 00FFH, check code;
Step 3: communication realizes
Generator set controller reads one or more historical record from the communication data packet of step 2.
2. the serial port communication method based on genset historical record according to claim 1, is characterized in that: described record type comprises stopping alarm, tripping alarm and tripping grinder and reports to the police; Described record label comprises the index of set number of event title, described record date comprise record the time, record month and record day, comprise described writing time record hour, record minute, record second;
Serial port communication method based on genset historical record according to claim 1, is characterized in that: the address sort mode of each data is, 1 record type, 2 record labels, 3 record numerical value, 4 record high alarm setting numerical value, 5 record low alarm limit numerical value, 6 record dates, 7 writing times.
3. the serial port communication method based on genset historical record according to claim 1, it is characterized in that: the memory headroom that each data are distributed is, record type accounts for a byte, record label accounts for two bytes, record numerical value accounts for two bytes, and record high alarm setting numerical value accounts for two bytes, and record low alarm limit numerical value accounts for two bytes, record date accounts for three bytes, accounts for three bytes writing time.
4. the serial port communication method based on genset historical record according to claim 1, is characterized in that: historical record is preserved in generator set controller circulation, when historical record exceedes in limited time, covers Article 1 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 true CN105446927A (en) 2016-03-30
CN105446927B 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
CN105446927B (en) 2018-03-13

Similar Documents

Publication Publication Date Title
CN202904342U (en) Vehicle-mounted GPS monitoring system for pure electric vehicle
CN204946132U (en) Based on the new distribution type gate control system of WIFI function
CN105446927A (en) Generator set historical record based serial port communication method
CN201039206Y (en) Telecommunication distribution management system
CN202275463U (en) Intelligent point of sales (POS) machine for bus
CN103294978A (en) Method of POS machine for identifying RFID electronic tag
CN207638694U (en) A kind of cloud computing safety monitoring system based on smart mobile phone
CN104133788B (en) CAN bus data transmission method in active filter system
CN202949454U (en) Intelligent network recycling machine system
CN209401051U (en) A kind of gate inhibition RFID card sender
CN209401156U (en) The communication system of state's net ammeter is adapted to based on the NB-IOT communication technology
CN101957960A (en) Electronic invoice system
CN108881808A (en) A kind of near-field communication interconnecting device and meter reading management method
CN106370253A (en) Concentrator system applied to remote transmitting gas meter
CN202652235U (en) Microcontroller Internet device with embedded TCP/IP protocol stack module
CN207440826U (en) A kind of gas station's data management system
CN204906408U (en) Intelligent transportation information exchange's safe filter equipment
CN207097022U (en) A kind of NFC network intelligences award ink recorder
CN204360399U (en) A kind of intelligent cards cabinet
CN202218271U (en) Middleware device and system based on time division-synchronization code division multiple access (TD-SCDMA)
CN101404676B (en) Processing method for calling large data volume of low-voltage distribution system
CN110568828A (en) flexible production line control system based on PLC (programmable logic controller) product tracing and statistics
CN203732968U (en) Distributed greenhouse integrated environment intelligent regulating and controlling system
CN104699862A (en) Knowledge engineering system
CN106503594B (en) The date storage method of intellectual water meter

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