50 likes | 138 Views
Converter System Log Design. Tim Xu (li.xu@envisioncn.com) Nov-18-2009. Overview.
E N D
Converter System Log Design Tim Xu (li.xu@envisioncn.com) Nov-18-2009 Envision Energy
Overview Converter will detect all system fault, and record fault information into non-volatile memory, it also sends fault information to PC client software as well for further handling. In order to efficiently archive and/or transport fault log information, a well designed fault data structure is needed, this structure shall also contribute to speed up fault log search. Envision Energy
Fault Log Data Structure Totally 6 bytes for one fault log data record • ID - unique fault index (16 bits) • Timestamp - system time at when event happened (31 bits) • Push or Pump - fault happened or disappeared (1 bits) Envision Energy
How to Archive a Fault Log Data During system normal operation time, all fault log data were archived in a circular buffer allocated in main memory. Before system is going to shutdown, the fault log data will be written back to eeprom memory for future access. Assume circular buffer size is 8K bytes, When a fault happened, firmware will write the fault data into circular buffer according to below diagram. Firmware rewinds to 1st memory location after writing to last memory location. 1st Write fault data 2nd 3rd 0x0020, 0x13800023 4th 1365th Circular Buffer 8K bytes Envision Energy
How to Search a Fault Log Data Main Fault Memory 1st fault data 2nd fault data 3rd fault data 4th fault data … Last fault data If a user performs search according to fault data timestamp, the firmware will use Binary Search method to search Main Fault Memory (MFM) to get that data as all fault log data were archived in timestamp order; however, if a user perform search according to fault ID, then the firmware will have to go through the entire MFM linearly to return all fault log data required by user. There could be a more efficient search method to search according to fault ID. Envision Energy