DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Error in parsing .dat with Matlab

Hi community, 

I try to parse a .r64/.dat file (exported from DEWESoft) in MatLab. 

 

Online I found a function which was implented exclusively for this usecase. 

If I run this script I get a critical error. The function needs to know where a channel begins/ends (listed below). 

 

elseif strcmp(ImpExp,'IMPLICIT') && step > 0
            % Kanal mit konstanter Schrittweite (z.B. Zeit)
            variable.(name) = [] ;
            variable.(name)(:,1) = wert_start:step:wert_ende ;

Belong to this Article I saw that I have to change the Parameters to get the Start-Pointer of the first value in the channel (Index 240,221,...). 

 

My exported .dat-file does not store the end-value of the channel. 

 

end
            % --------- IMPLICIT oder EXPLIZIT ---------
            if strncmp(zeilen(nn),'210',3)
                ImpExp = zeilen{nn}(5:end);
            end
            % --------- Kanallaenge ---------
            if strncmp(zeilen(nn),'220',3)
                laenge = str2double(zeilen{nn}(5:end));
            end
            % --------- Startzeile ---------
            if strncmp(zeilen(nn),'221',3)
                channelstart = str2double(zeilen{nn}(5:end));
            end
            % --------- Schrittweite ---------
            if strncmp(zeilen(nn),'241',3)
                step = str2double(zeilen{nn}(5:end));
            end
            % --------- Startwert ---------
            if strncmp(zeilen(nn),'250',3)
                wert_start = str2double(zeilen{nn}(5:end));
            end
            % --------- Endwert ---------
            if strncmp(zeilen(nn),'251',3)
                wert_ende = str2double(zeilen{nn}(5:end));
            end            
#BEGINCHANNELHEADER
200,Time
201,Data
202,s
210,IMPLICIT
220,137
240,0
241,1
253,increasing
260,Numeric
#ENDCHANNELHEADER

Does anyone know how to solve this problem?

 

Regards
Daniel

0 Kudos
Message 1 of 3
(2,462 Views)

Hi Daniel,

 

In a DIAdem DAT file, an IMPLICIT channel is one whose values are completely defined in the *.dat file and not present in the *.r64 file.  You simply use the linear equation with offset and slope and number of values to recreate the data array.  There is no end position in the *.r64 file, there is no starting position in the *.r64 file.  The offset, slope and number of values are all in the *.dat file, and that's all you need.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 2 of 3
(2,416 Views)

Hi Brad,

I solved that problem. The software with which I exported the .dat-File discriminates between an .R64 and .R32 file. Smiley Indifferent

Solution: 1) Export all datas as 64-bit or 2) include the second file in which the binaries are stored. 

 

 

Thank you!

 

Daniel

0 Kudos
Message 3 of 3
(2,407 Views)