thebestpatrick / nda-extractor

Extracts data from Neware binary files (.nda)
BSD 2-Clause "Simplified" License
9 stars 2 forks source link

Unable to parse nda to csv #1

Open ghost opened 7 years ago

ghost commented 7 years ago

I have been trying to convert .nda file into csv file using your python scripts. I tweaked around with the parser to run with python 2.7 While I'm the getting the output to csv the values in the output file are weird. I have shared the nda file along with csv file. Could you please tell me how you have identified the byte size for each of the parameter? Do you have any source for such identification? data.zip

thebestpatrick commented 7 years ago

It appears as though the formatting has changed slightly between the 2015 and 2017 versions of the software, but with some tweaking it should be fixable. Each field is being read as 4 bytes except for the two under "charge and energy" which are read as 8. However, these are likely just two 4byte fields that I have pushed together because one of them was always zeroed in the setup I was on (for example, we did not read temperature, do you have a temperature probe set up on the machine?)

I do not have an outside source for the identification as I found MTI to be rather uncooperative in this regard, however it was based on extensive testing and comparing against known values in nda files. If the formatting has indeed changed, would it be possible to provide me some of the known values for your file so I can compare?

ghost commented 7 years ago

We do not have a temperature probe on the machine. I'm attaching the sample output file for the shared nda file. Ch1-3.xls.zip

thebestpatrick commented 7 years ago

It does look like there have been significant changes to the formatting, the files I was working from had a line size of 59 and your new file has a line size of 86. I've managed to find the timestamp and a couple other patterns are emerging.

ghost commented 7 years ago

With minor changes I was able to get timestamp and when I trying to access line = f.read(line_size), I'm getting empty string. I'm trying to figure out how the single .nda file is split into multiple sheets of xls file with the BTSDA software and which part of nda file I need to access to get the Cycle data and Record data and length of each parameter for both Record and Cycle datasets. Were you able to make any progress on it?

thebestpatrick commented 7 years ago

Yes, but not quite release quality work yet. The .nda file is split so that the first block of the file, the header so to speak, can be processed to retrieve the data you see in the first 4 records of the xls sheet (unit, test, cycle, step). This header goes from the first byte until about byte 3820, but it varies from file to file. After the header, the rest of the data in the .nda is from the 'record' tab, each line being represented by 86 bytes that needs to be split up properly by fields.