Problem reading binary output file

Dear all,

I’m having some problems trying to run MLife with .outb files. Let me share with you the debugging process I have been following.

I’m doing big sets of simulations, so I’m using the binary output format to save space. These files are created in batch mode with the OutFileFmt=2. To check the results, I’m using the readFASTbinary.m function from the Matlab toolbox. I have checked many .outb files, and everything is working fine.

I’m using MLife with an exact input file that worked well with ASCII output files. I am changing the FileFormat to 2 (FAST binary), but I get this error:

Error using fread
Invalid size.

Error in ReadFASTbinary (line 42)
    DescStrASCII = fread( fid, LenDesc,     'uint8' );  % DescStr converted to ASCII
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in load_file_header (line 36)
      [~, cellNames, cellUnits, ~] = ReadFASTbinary(fileName);
                                     ^^^^^^^^^^^^^^^^^^^^^^^^
Error in process_mlife_inputs (line 169)
      [names, units] = load_file_header(FileInfo.FileName{1}, FileInfo.FileFormat, FileInfo.NamesLine, FileInfo.UnitsLine, ...
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in mlife (line 275)
   [FileInfo, Statistics, Fatigue] = process_mlife_inputs(FileInfo, Statistics, Fatigue, dataDirectory);
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in MLife_template (line 9)
[Fatigue, Statistics] = mlife(settingsFile, dataDirectory, outputDirectory);
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

As it calls the error on the readFASTbinary file of the MLife directory, I tried to change it to the one that comes in the Matlab toolbox. It resulted in MLife going a “step forward” but still having an error.


Error using process_mlife_inputs (line 190)
  For fatigue channel #1, the channel number must be between 1 and 4 (inclusive).

Error in mlife (line 275)
   [FileInfo, Statistics, Fatigue] = process_mlife_inputs(FileInfo, Statistics, Fatigue, dataDirectory);
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in MLife_template (line 9)
[Fatigue, Statistics] = mlife(settingsFile, dataDirectory, outputDirectory);
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

To solve this error, I changed the numbers of my channels (81 and 82, to calculate tower base moments) to 3 and 4. With this change I could make MLife finish processing my .outb file. To be sure it wasn’t a problem from my .outb files. I repeated this process with different files, always getting the same result.

At this point I was starting to think that there was something wrong with the readFASTBinary from MLife. To be sure of this, I created a copy of the Matlab toolbox only changing this file (swapping the runFASTbinary of the matlab toolbox with the readFASTbinary from the MLife directory). I ran the same .outb files with this new toolbox, and an error happened.


Error using fread
Invalid size.

Error in ReadFASTbinary (line 42)
    DescStrASCII = fread( fid, LenDesc,     'uint8' );  % DescStr converted to ASCII
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error in mark1 (line 8)
[Channels, ChannelNames, ChannelUnits] = ReadFASTbinary(FileName);
                                         ^^^^^^^^^^^^^^^^^^^^^^^^

With this I finished my debugging process.
What is your opinion, could there be a problem with the readFASTbinary function from MLife?
Could anyone try to replicate this with an .outb file?

Best regards,