data loader for MINISOFT '.el1' files
#pragma rtGlobals=1 // Use modern global access method.
#pragma version=1.2
////////////////////////
// Remarks:
// Data loader for .el1 files, which were saved with the program 'MINISOFT V7.8' (http://www.greisinger.de/).
// The binary file structure of the .el1 files has been worked out empirically (because the
// company didn't want to reveal any details of their binary format), so the structure
// may change in fututre versions of the program. Additionally be aware of bugs.
// The data loader reads out the data, the time scaling, and some parameters which are put in the wave note.
////////////////////////
Menu "Load Waves"
"Load MiniSoft File...", LoadMiniSoftFile()
end
function LoadMiniSoftFile()
variable refnum
open/z=2/m="Looking for a MiniSoft file"/r/t=".el1" refnum
if(V_flag==-1)
return 0
endif
fstatus refnum
string S_filenameLocal=ReplaceString(".el1",S_filename,"")
variable V_numDataPnts,V_timeDelta,V_timeStart,V_startComment,V_commentLen
variable V_startWindowTitle,V_windowTitleLen,V_tmp,V_measureMin,V_measureMax
variable V_version,V_alarmMin,V_alarmMax,V_alarmDelay
string S_comment,S_windowTitle,S_identification
fsetpos refnum,99; fbinread/b=3/f=3 refnum,V_startComment
V_startComment-=1 // in Igor, first byte is byte #0!!!
fsetpos refnum,1007; fbinread/b=3/f=5 refnum,V_version
fsetpos refnum,1111; fbinread/b=3/f=5 refnum,V_measureMin
fsetpos refnum,1119; fbinread/b=3/f=5 refnum,V_measureMax
fsetpos refnum,1503; fbinread/b=3/f=5 refnum,V_alarmMin
fsetpos refnum,1511; fbinread/b=3/f=5 refnum,V_alarmMax
fsetpos refnum,1519; fbinread/b=3/f=3 refnum,V_alarmDelay
fsetpos refnum,2003; fbinread/b=3/f=3 refnum,V_numDataPnts
fsetpos refnum,2011; fbinread/b=3/f=3 refnum,V_timeDelta
fsetpos refnum,3999; fbinread/b=3/f=5 refnum,V_timeStart
V_timeStart=V_timeStart*24*60*60-126313200 // Conversion into s, offset subtraction
make/o/n=(V_numDataPnts) $S_filenameLocal
wave w=$S_filenameLocal
fbinread/b=3/f=5 refnum,w // data start @ 4007
setscale/p x V_timeStart,V_timeDelta,"dat" w
S_identification=padstring("",39,0x20)
fsetpos refnum,2103; fbinread refnum,S_identification
S_identification=replacestring(num2char(32),S_identification,"")
fsetpos refnum,V_startComment
do
fbinread/f=1 refnum,V_tmp
while(V_tmp!=4)
fstatus refnum; V_commentLen=V_filePos-V_startComment-1
do
fbinread/f=1 refnum,V_tmp
while(V_tmp!=0)
fstatus refnum; V_startWindowTitle=V_filePos
do
fbinread/f=1 refnum,V_tmp
while(V_tmp!=4)
fstatus refnum; V_windowTitleLen=V_filePos-V_startWindowTitle-1
S_comment=padstring("",V_commentLen,0x20)
fsetpos refnum,V_startComment; fbinread refnum,S_comment
S_windowTitle=padstring("",V_windowTitleLen,0x20)
fsetpos refnum,V_startWindowTitle; fbinread refnum,S_windowTitle
S_comment=replacestring(";",S_comment,"")
S_windowTitle=replacestring(";",S_windowTitle,"")
S_comment=replacestring(num2char(10),S_comment,"")
note/nocr w,"identification:"+S_identification+";"
note/nocr w,"window title:"+S_windowTitle+";"
note/nocr w,"comment:"+S_comment+";"
note/nocr w,"version:"+num2str(V_version)+";"
note/nocr w,"measure minimum:"+num2str(V_measureMin)+";"
note/nocr w,"measure maximum:"+num2str(V_measureMax)+";"
note/nocr w,"alarm minimum:"+num2str(V_alarmMin)+";"
note/nocr w,"alarm maximum:"+num2str(V_alarmMax)+";"
note/nocr w,"alarm delay/min:"+num2str(V_alarmDelay)+";"
if(V_version!=74&&V_version!=73)
DoAlert 0,"MiniLog version of file "+S_filenameLocal+".el1 is not 7.3 or 7.4 (with which this file loader has been tested).\rPlease check the data carefully for reliability!"
endif
close refnum
end
Forum
Support
Gallery
Igor Pro 10
Learn More
Igor XOP Toolkit
Learn More
Igor NIDAQ Tools MX
Learn More
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
July 8, 2008 at 12:21 pm - Permalink