Load AxonBinaryFile.ipf #pragma rtGlobals=1 // Use modern global access method. //Jeremy Bergsman's version of Christian Stricker's Axon binary file loader. ////////////////////////////////////////////////////////////////////////////////////////////////////////////// //Notes on JB's version: //Only minor changes from the original, mainly to accomodate my analysis program and automate loading multiple files //Fixed a few small bugs, as noted where they were //Changed the way waves are named to wYYMMDD_TTTT_ChX_S where YYMMDD is the date (if you //use the axon wave naming of YYYY_MM_DD_TTTT), TTTT is the trial number left padded with 0s to 4 //digits, X is the channel number, and S is the sweep/episode number (any number of digits). //Saves a few juicy details about the protocol in the wave note //Can automatically graph the waves as they are loaded //Can load multiple, consecutive trials automatically //Can choose to load only certain channels //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //Christian Stricker's original header: // This is the function file loader for AxonBinaryFiles. It differs from the one by Chris Leonard (even // though is was the starting point...) that it is a function and does not require the XOP GBLoadWave. // This file loader is therefore faster and takes care of the pretrigger delays as well as the timing offset // due to the multiplexing of the AD converter. Also, it takes care of the SI units in the unitstrings and uses // those for proper handling/scaling of the loaded waves. Included in this file is a utility to print the // header out - in case somebody has to check it if the loader is not working according to specification. // The problem with AxonBinary headers is that there are about 100 different possible versions - and I am // sure that I have not accounted for all of them. // In case the loader is not performing according to specifications, please contact the author at the // address below. // If you want to make it run on a PC. As of version 1.2 the platform should be checked and handled internally. // There is no need anymore to omit /B=(Byteswap) in the FBinRead commands (ie no byte // swapping). I am lucky enough not to have a Wintel box to test this though ... // Currently, it has been tested for AxoScope files (ABF version 1.5) and Clampex files (ABF version 1.4). // // For documentation see ABFHELP.HLP at http://www.axonet.com/pub/utility/axonfsp/windows/AXONFSP32.ZIP // The header is documented in ABFHeader.h. You need a Wintel box to get at the help file ABFHELP.HLP ... // It does not read on the Mac - Bill might not like it... // // This version only loads the files - it DOES NOT display them. // // Version: 1.2 // Date: 04/02/99 // Author: Christian Stricker // Address: Institute of Neuroinformatics, ETHZ/UniZH, Gloriastrasse 32, CH-8006 ZŸrich / Switzerland. // e-mail: Christian.Stricker@ini.phys.ethz.ch // // Version history: // // 1.0 25/08/98 First running version // 1.1. 28/08/98 Added support for reading single sweeps in // 1.2. 04/02/99 Added tentative support for Wintel platform: changed functions ReadABFHeader and GetABFSweep. // These now take the ByteSwap value depending on the platform used. Sorry... //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Menu "Macros" "LoadMultiple" "SetLoadingParameters" "HierarchicalWaveBrowser" End Macro SetLoadingParameters(whch,gra) //JBB variable whch=1,gra=0 prompt whch, "Bitwise channels to load? Ch0=1, Ch1=2, or both=3" prompt gra, "Graph waves? 0=No, 1=Yes" variable/g whichchannels, graphing whichchannels=whch graphing=gra end Macro LoadAxonBinary() variable FilePtr //JBB moved this here Open/D/R/T="BINA"/M="Open an AxonBinary file" FilePtr if (cmpstr(S_Filename,"") == 0) print "No Binary File chosen" else LoadAxonBinaryFile(S_Filename) endif End Macro LoadMultiple(startpos,endpos) //JBB VARIABLE startpos=0,endpos=9 PROMPT startpos, "First file" PROMPT endpos, "Last file:" VARIABLE loop1, as_pos, FilePtr STRING numstr Open/D/R/T="BINA"/M="Open an AxonBinary file" FilePtr if (cmpstr(S_Filename,"") == 0) print "No Binary File chosen" else as_pos=strsearch(S_Filename,".",0) // find end of file name loop1=startpos //Do it for the range the user gave do numstr="0000"+num2str(loop1) numstr=numstr[strlen(numstr)-4,strlen(numstr)] LoadAxonBinaryFile(S_Filename[0,as_pos-5]+numstr+".abf") loop1+=1 While (loop1<=endpos) endif END Macro PrintABFHeader() PrintHeaderOut() End Macro MakeCoolGraph(wavenamesample,leftset,firsttrace,lasttrace) //JBB STRING wavenamesample, leftset="Channel 0" VARIABLE firsttrace=0, lasttrace=-1 PROMPT wavenamesample, " Sample Wave", popup, WAVEList ("*Ch0_0",";", "") PROMPT firsttrace, "First trace in this set to graph" PROMPT lasttrace, "Last trace in this set to graph (-1=all)" PROMPT leftset, "Which channel on top?", popup, "Channel 0;Channel 1" MakeCG(wavenamesample,leftset,firsttrace,lasttrace) End Function MakeCG(wavenamesample,leftset,firsttrace,lasttrace) //JBB 2/1/25 //Automatically make graph from waves imported with LoadAxonBinary //If 2 input channels, puts them on left and right axes, plots them in upper and lower 45% of graph STRING wavenamesample, leftset VARIABLE firsttrace, lasttrace STRING AxonBrowsedWave STRING ThisWave VARIABLE waveloop, savmin, savtenth, chanloop, numchannels=0 NVAR whichchannels Display as wavenamesample[1,11] AxonBrowsedWave=wavenamesample[0,14] chanloop=0 do if ((2^chanloop&whichchannels)==2^chanloop) numchannels+=1 waveloop=firsttrace do ThisWave=AxonBrowsedWave+num2str(chanloop)+"_"+num2str(waveloop) if (WAVEEXISTS($ThisWave)==1) if (numchannels>=2) //could make this a switch and use multiple left axes to deal with >2 channels AppendToGraph/R $ThisWave else AppendToGraph $ThisWave endif ModifyGraph rgb($ThisWave)=(0,0,0) elseif (lasttrace==-1) break endif waveloop+=1 while (waveloop!=lasttrace+1) endif chanloop+=1 while (chanloop<=15) //fix up graph if (numchannels>=2) if (cmpstr(leftset,"Channel 0")==0) ModifyGraph axisEnab(left)={0.55,1},axisEnab(right)={0,0.45} //Left on top else ModifyGraph axisEnab(left)={0,0.45},axisEnab(right)={0.55,1} //Right on top endif endif ShowTools/A ModifyGraph axThick=0, axThick(left)=0 if (numchannels>=2) ModifyGraph axThick(right)=0 endif ModifyGraph noLabel=2 DoUpdate //X scale bar and label GetAxis /Q bottom savmin=V_min savtenth=tenth("bottom") SetDrawEnv xcoord= bottom, ycoord= prel, linethick=2 DrawLine V_max-savtenth,1,V_max,1 SetDrawEnv xcoord= bottom, ycoord= prel, fstyle= 1,fsize= 9, textxjust=1 DrawText (V_max-(savtenth/2)),.99, num2str(savtenth)+" s" SetDrawEnv xcoord= rel, ycoord= rel //Left scale bar and label GetAxis /Q left savtenth=tenth("left") SetDrawEnv xcoord= bottom, ycoord= left, linethick=2 DrawLine savmin, V_min, savmin, V_min+savtenth SetDrawEnv ycoord= left, fstyle= 1,fsize= 9,textxjust=0, textyjust=1 DrawText savmin, V_min+savtenth/2, " "+num2str(savtenth*10^12)+" pA" //Right scale bar and label if (numchannels>=2) GetAxis /Q right savtenth=tenth("right") SetDrawEnv ycoord= right, linethick=2 DrawLine savmin, V_min, savmin, V_min+savtenth SetDrawEnv ycoord= right, fstyle= 1,fsize= 9, textyjust=1 DrawText savmin, V_min+savtenth/2, " "+num2str(savtenth*10^12)+" pA" endif //Add buttons to add more waves //Button prevwave size={40,20}, pos={415,1}, proc=nextwave, title="-Wave" //Button subswave size={40,20}, pos={455,1}, proc=nextwave, title="+Wave" //PopupMenu arbwave mode=0, pos={520,1}, proc=newwv, title="Jump", value=WAVEList ("*",";", "") End Function tenth(axisspec) //JBB //returns the round number less than .2 times the given axis length STRING axisspec VARIABLE rang, order GetAxis/Q $axisspec rang=V_max-V_min*2 order=trunc(log(rang)) return trunc((rang)/10^(order-1))*10^(order-2) end Function LoadAxonBinaryFile(passedfilename) string passedfilename // jbb 3/13/02 Variable NumEpisodes, NumChanSampled, NumChar, t0 Variable SamplesPerEpisode, FilePtr, OperationMode Variable ADCRes, ADCRange, ConversionTime, dt, FileLength Variable i, j, help, SweepOffset, ArrayEnd, DataOffset, SyncArrOffset Variable AutosampleEnable, AutoSampleAdditGain, AutoSampleChanNum Variable BlockSize = 512 Variable ByteSwap //JBB's Variables: Variable ClockStartTime, SWStartTime, TimeOfEpisode//first two are clock times for the whole file, last is *offset* for each sweep within the file Variable SecondsPerEpisode Variable graphing=numvarordefault("graphing",0), whichchannels=numvarordefault("whichchannels",1) String Filetype, WaveNameBase, Name, hstr, hst, pathnam Byteswap = !cmpstr(IgorInfo(2),"Macintosh") //Open/D/R/T="BINA"/M="Open an AxonBinary file" FilePtr //removed by JBB if (cmpstr(passedfilename,"") == 0) print "No Binary File chosen" else Open/R/T="BINA" fileptr as passedfilename //jbb 3/13 Make/O/N=4/B/U charwave // Reading FileType in FBinRead FilePtr, charwave Filetype = "" i = 0 do FileType += num2char(charwave[i]) i += 1 while(i < 4) if (cmpstr(FileType, "ABF ") == 0) Make/O/N=1/B/U cwave Make/O/N=1 fwave Make/O/N=1/I lwave Make/O/N=1/W iwave Make/O/N=(16)/W SampleSeq Make/O/N=(16) ScaleArray, ProgrammableGain, unitgain = 1, SignalGain Make/O/T/N=(16) NameStrings, UnitStrings FSetPos FilePtr, 16 FBinRead/B=(Byteswap) FilePtr, lwave NumEpisodes = lwave[0] FSetPos FilePtr, 40 FBinRead/B=(Byteswap) FilePtr, lwave DataOffset = lwave[0] * BlockSize FSetPos FilePtr, 92 FBinRead/B=(Byteswap) FilePtr, lwave SyncArrOffset = lwave[0] * BlockSize FSetPos FilePtr, 120 FBinRead/B=(Byteswap) FilePtr, iwave NumChanSampled = iwave[0] FSetPos FilePtr, 122 FBinRead/B=(Byteswap) FilePtr, fwave ConversionTime = fwave[0] * 1e-6 dt = ConversionTime * NumChanSampled FSetPos FilePtr, 244 FBinRead/B=(Byteswap) FilePtr, fwave ADCRange = fwave[0] FSetPos FilePtr, 252 FBinRead/B=(Byteswap) FilePtr, lwave ADCRes = lwave[0] //Following paragraph by JBB 5/29/02 FSetPos FilePtr, 262 FBinRead/B=(Byteswap) FilePtr, iwave AutosampleEnable = iwave[0] if (AutosampleEnable) FSetPos FilePtr, 264//JBB was 262 FBinRead/B=(Byteswap) FilePtr, iwave AutosampleChanNum = iwave[0] FSetPos FilePtr, 268 FBinRead/B=(Byteswap) FilePtr, fwave AutosampleAdditGain = fwave[0] endif FSetPos FilePtr, 8 FBinRead/B=(Byteswap) FilePtr, iwave OperationMode = iwave[0] if((OperationMode == 1) %| (OperationMode == 3)) print ("!!!EVENT-DRIVEN or GAP FREE DATA!!!") FSetPos FilePtr, 10 FBinRead/B=(Byteswap) FilePtr, lwave // This is the total length in integers SamplesPerEpisode = lwave[0] / NumChanSampled else FSetPos FilePtr, 138 FBinRead/B=(Byteswap) FilePtr, lwave SamplesPerEpisode = lwave[0] / NumChanSampled // This is the number of samples endif ArrayEnd = SamplesPerEpisode - 1 FSetPos FilePtr, 142 // This is the number of pretrigger points FBinRead/B=(Byteswap) FilePtr, lwave if (lwave[0] == 0) t0 = 0 else t0 = - dt * lwave[0] endif FSetPos FilePtr, 410 FBinRead/B=(Byteswap) FilePtr, SampleSeq FSetPos FilePtr, 442 // Read the channel name strings - though not used. i = 0 do hstr = "" j = 0 do FBinRead FilePtr, cwave hstr += num2char(cwave[0]) j += 1 while(j < 10) NameStrings[i] = hstr i += 1 while(i < 16) FSetPos FilePtr, 602 // Read the unit strings i = 0 do hstr = "" j = 0 do FBinRead FilePtr, cwave hstr += num2char(cwave[0]) j += 1 while(j < 8) UnitStrings[i] = hstr i += 1 while(i < 16) FSetPos FilePtr, 730 // Read the programmable gain FBinRead/B=(Byteswap) FilePtr, ProgrammableGain hst = "" i = 0 // Make the units conform to IGOR on the SI basis. do hstr = UnitStrings[SampleSeq[i]] help = strlen(hstr) if (help > 1) hst[0,help-2] = hstr[1,help-1] //all but the first character UnitStrings[SampleSeq[i]] = hst if (char2num(hstr[0]) == 109) unitgain[SampleSeq[i]] = 1e-3 else if (char2num(hstr[0]) == 181) unitgain[SampleSeq[i]] = 1e-6 else if (char2num(hstr[0]) == 110) unitgain[SampleSeq[i]] = 1e-9 else if (char2num(hstr[0]) == 112) unitgain[SampleSeq[i]] = 1e-12 else if (char2num(hstr[0]) == 102) unitgain[SampleSeq[i]] = 1e-15 else if ((char2num(hstr[0]) == 75) %| (char2num(hstr[0]) == 107)) unitgain[SampleSeq[i]] = 1e3 else if (char2num(hstr[0]) == 77) unitgain[SampleSeq[i]] = 1e6 else if (char2num(hstr[0]) == 71) unitgain[SampleSeq[i]] = 1e9 else if (char2num(hstr[0]) == 84) unitgain[SampleSeq[i]] = 1e12 else if (char2num(hstr[0]) == 32) //this test added by JBB 5/28/02 unitgain[SampleSeq[i]] = 1 else print "This unit ", hstr[0]," is not an engeneering type (SI) unit abbreviation!" endif endif endif endif endif endif endif endif endif endif endif i += 1 while(i < NumChanSampled) FSetPos FilePtr, 922 FBinRead/B=(Byteswap) FilePtr, ScaleArray FSetPos FilePtr, 1050 FBinRead/B=(Byteswap) FilePtr, SignalGain //JBB's section added 5/28/02 to save some info for adding to the wave note FSetPos FilePtr, 24 FBinRead/B=(Byteswap) FilePtr, lwave ClockStartTime = lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave SWStartTime = lwave[0] FSetPos FilePtr, 178 FBinRead/B=(Byteswap) FilePtr, fwave SecondsPerEpisode = fwave[0] if (SecondsPerEpisode==0)//was set to minimum, so it's sweep length SecondsPerEpisode=SamplesPerEpisode*dt //Pretty sure these have already been set properly regardless of number of channels endif //End JBBs section ScaleArray = ADCRange * unitgain / (ScaleArray * ProgrammableGain * SignalGain * ADCRes) if (AutosampleEnable) ScaleArray[AutosampleChanNum] /= AutosampleAdditGain endif if(NumEpisodes == 0) NumEpisodes = 1 endif NumChar = strsearch(passedfilename, ".", 0) //jbb 3/13 //Name = S_Filename[(NumChar - 8), (NumChar - 1)] Original removed by JBB 1/18/02 Name=passedfilename[NumChar-13,NumChar-12]+passedfilename[NumChar-10,NumChar-9]+passedfilename[NumChar-7,NumChar-6]+"_"+passedfilename[NumChar-4,NumChar-1] //Added by JBB 1/18/02, 3/13, names as YYMMDD_TTTT WaveNameBase = "w" + Name + "_Ch" SweepOffset = SamplesPerEpisode * NumChanSampled Make/W/N=(SweepOffset)/O inputwave SweepOffset *= 2 // Check for the file length. FileLength = DataOffset + ceil(NumEpisodes * SweepOffset / BlockSize) * Blocksize if(SyncArrOffset > 0) FSetPos FilePtr, 96 FBinRead/B=(Byteswap) FilePtr, lwave FileLength += lwave[0] * 8 endif FStatus FilePtr if (V_logEOF != FileLength) print "Calculated File Length Does not Match Actual File Length!" endif Make/O/N=(NumChanSampled) t0wave // Conform to the multiplexing of the board. j = 0 do t0wave[j] = t0 + SampleSeq[j] * ConversionTime j += 1 while(j < NumChanSampled) i = 0 do FSetPos FilePtr, DataOffset + i * SweepOffset FBinRead/B=(Byteswap) FilePtr, inputwave hst = "_" + num2str(i) j=0 do //5/28/02 modified by jbb to not create waves for unused channels if ((2^SampleSeq[j]&whichchannels)==2^SampleSeq[j]) hstr = WaveNameBase + num2str(SampleSeq[j]) + hst Make/O/N=(SamplesPerEpisode)/O $hstr wave chaninput = $hstr SetScale/P x t0wave[j], dt, "s" $hstr SetScale y, 0, 0, Unitstrings[SampleSeq[j]] $hstr chaninput[0, arrayend] = inputwave[j + NumChanSampled * p] chaninput *= ScaleArray[SampleSeq[j]] //JBB's section: TimeOfEpisode=i*SecondsPerEpisode //episode # * time for each episode, breaks if multiple runs or trials Note chaninput, "ClockStartTime:"+num2str(ClockStartTime)+";"+"SWStartTime:"+num2str(SWStartTime)+";"+"SweepStartTime:"+num2str(TimeOfEpisode)+";" //end JBB's section endif j += 1 while(j < NumChanSampled) i += 1 while(i < NumEpisodes) Close FilePtr if (graphing==1) MakeCG(hstr,"Channel 0",0,-1) //JBB 2/28/02--automatically graph loaded waves endif Killwaves fwave, lwave, iwave, cwave, sampleseq, scalearray, inputwave Killwaves SignalGain, ProgrammableGain, NameStrings, UnitStrings, unitgain, t0wave else print "This File is not an Axon Binary File!" endif Killwaves charwave endif End Function ReadABFHeader(ByteSwap) Variable ByteSwap Variable NumEpisodes, NumChanSampled, NumChar, Fileptr, t0 Variable SamplesPerEpisode, OperationMode Variable ADCRes, ADCRange, ConversionTime, dt, FileLength Variable i, j, help, SweepOffset, ArrayEnd, DataOffset, SyncArrOffset Variable AutosampleEnable, AutoSampleAdditGain, AutoSampleChanNum Variable BlockSize = 512 SVar FileName = $"FileName" String Filetype, WaveNameBase, Name, hstr, hst Open/D/R/T="BINA"/M="Open an AxonBinary file" FilePtr if (cmpstr(s_FileName,"") == 0) print "No Binary File chosen" else Open/R/T="BINA" fileptr as s_FileName FileName = s_FileName Make/O/N=4/B/U charwave // Reading FileType in FBinRead FilePtr, charwave Filetype = "" i = 0 do FileType += num2char(charwave[i]) i += 1 while(i < 4) if (cmpstr(FileType, "ABF ") == 0) Make/O/N=1/B/U cwave Make/O/N=1 fwave Make/O/N=1/I lwave Make/O/N=1/W iwave Make/O/N=(16)/W SampleSeq Make/O/N=(16) ScaleArray, ProgrammableGain, unitgain = 1, SignalGain Make/O/T/N=(16) NameStrings, UnitStrings Make/O/N=6 ParameterWave // [0] = NumChanSampled // [1] = NumEpisodes // [2] = DataOffset in bytes // [3] = Blocksize // [4] = Lenght of episodes in bytes // [5] = LastByte in episode FSetPos FilePtr, 16 FBinRead/B=(Byteswap) FilePtr, lwave NumEpisodes = lwave[0] ParameterWave[1] = NumEpisodes FSetPos FilePtr, 40 FBinRead/B=(Byteswap) FilePtr, lwave DataOffset = lwave[0] * BlockSize ParameterWave[2] = DataOffset ParameterWave[3] = Blocksize FSetPos FilePtr, 92 FBinRead/B=(Byteswap) FilePtr, lwave SyncArrOffset = lwave[0] * BlockSize FSetPos FilePtr, 120 FBinRead/B=(Byteswap) FilePtr, iwave NumChanSampled = iwave[0] ParameterWave[0] = NumChanSampled FSetPos FilePtr, 122 FBinRead/B=(Byteswap) FilePtr, fwave ConversionTime = fwave[0] * 1e-6 dt = ConversionTime * NumChanSampled FSetPos FilePtr, 244 FBinRead/B=(Byteswap) FilePtr, fwave ADCRange = fwave[0] FSetPos FilePtr, 252 FBinRead/B=(Byteswap) FilePtr, lwave ADCRes = lwave[0] if (AutosampleEnable) FSetPos FilePtr, 262 FBinRead/B=(Byteswap) FilePtr, iwave AutosampleChanNum = iwave[0] FSetPos FilePtr, 268 FBinRead/B=(Byteswap) FilePtr, fwave AutosampleAdditGain = fwave[0] endif FSetPos FilePtr, 8 FBinRead/B=(Byteswap) FilePtr, iwave OperationMode = iwave[0] if((OperationMode == 1) %| (OperationMode == 3)) print ("!!!EVENT-DRIVEN or GAP FREE DATA!!!") FSetPos FilePtr, 10 FBinRead/B=(Byteswap) FilePtr, lwave // This is the total length in integers SamplesPerEpisode = lwave[0] / NumChanSampled else FSetPos FilePtr, 138 FBinRead/B=(Byteswap) FilePtr, lwave SamplesPerEpisode = lwave[0] / NumChanSampled // This is the number of samples endif ArrayEnd = SamplesPerEpisode - 1 FSetPos FilePtr, 142 // This is the number of pretrigger points FBinRead/B=(Byteswap) FilePtr, lwave if (lwave[0] == 0) t0 = 0 else t0 = - dt * lwave[0] endif FSetPos FilePtr, 410 FBinRead/B=(Byteswap) FilePtr, SampleSeq FSetPos FilePtr, 442 // Read the channel name strings - though not used. i = 0 do hstr = "" j = 0 do FBinRead FilePtr, cwave hstr += num2char(cwave[0]) j += 1 while(j < 10) NameStrings[i] = hstr i += 1 while(i < 16) FSetPos FilePtr, 602 // Read the unit strings i = 0 do hstr = "" j = 0 do FBinRead FilePtr, cwave hstr += num2char(cwave[0]) j += 1 while(j < 8) UnitStrings[i] = hstr i += 1 while(i < 16) FSetPos FilePtr, 730 // Read the programmable gain FBinRead/B=(Byteswap) FilePtr, ProgrammableGain hst = "" i = 0 // Make the units conform to IGOR on the SI basis. do hstr = UnitStrings[SampleSeq[i]] help = strlen(hstr) if (help > 1) hst[0,help-2] = hstr[1,help-1] UnitStrings[SampleSeq[i]] = hst if (char2num(hstr[0]) == 109) unitgain[SampleSeq[i]] = 1e-3 else if (char2num(hstr[0]) == 181) unitgain[SampleSeq[i]] = 1e-6 else if (char2num(hstr[0]) == 110) unitgain[SampleSeq[i]] = 1e-9 else if (char2num(hstr[0]) == 112) unitgain[SampleSeq[i]] = 1e-12 else if (char2num(hstr[0]) == 102) unitgain[SampleSeq[i]] = 1e-15 else if ((char2num(hstr[0]) == 75) %| (char2num(hstr[0]) == 107)) unitgain[SampleSeq[i]] = 1e3 else if (char2num(hstr[0]) == 77) unitgain[SampleSeq[i]] = 1e6 else if (char2num(hstr[0]) == 71) unitgain[SampleSeq[i]] = 1e9 else if (char2num(hstr[0]) == 84) unitgain[SampleSeq[i]] = 1e12 else print "This unit ", hstr[0]," is not an engeneering type (SI) unit abbreviation!" endif endif endif endif endif endif endif endif endif endif i += 1 while(i < NumChanSampled) FSetPos FilePtr, 922 FBinRead/B=(Byteswap) FilePtr, ScaleArray FSetPos FilePtr, 1050 FBinRead/B=(Byteswap) FilePtr, SignalGain ScaleArray = ADCRange * unitgain / (ScaleArray * ProgrammableGain * SignalGain * ADCRes) if (AutosampleEnable) ScaleArray[AutosampleChanNum] /= AutosampleAdditGain endif if(NumEpisodes == 0) NumEpisodes = 1 endif NumChar = strsearch(S_Filename, ".", 0) //Name = S_Filename[(NumChar - 8), (NumChar - 1)] Original removed by JBB 1/18/02 Name=S_Filename[NumChar-13,NumChar-12]+S_Filename[NumChar-10,NumChar-9]+S_Filename[NumChar-7,NumChar-6]+"_"+S_Filename[NumChar-4,NumChar-1] //Added by JBB 1/18/02, names as YYMMDD_TTTT WaveNameBase = "w" + Name + "_Ch" SweepOffset = SamplesPerEpisode * NumChanSampled Make/W/N=(SweepOffset)/O inputwave ParameterWave[5] = SweepOffset - 1 SweepOffset *= 2 ParameterWave[4] = SweepOffset // Check for the file length. FileLength = DataOffset + ceil(NumEpisodes * SweepOffset / BlockSize) * Blocksize if(SyncArrOffset > 0) FSetPos FilePtr, 96 FBinRead/B=(Byteswap) FilePtr, lwave FileLength += lwave[0] * 8 endif FStatus FilePtr if (V_logEOF != FileLength) print "Calculated File Length Does not Match Actual File Length!" endif Make/O/N=(NumChanSampled) t0wave // Conform to the multiplexing of the board. j = 0 do t0wave[j] = t0 + SampleSeq[j] * ConversionTime j += 1 while(j < NumChanSampled) j = 0 do hstr = "inputwave_Ch_" + num2str(SampleSeq[j]) Make/O/N=(SamplesPerEpisode)/O $hstr SetScale/P x t0wave[j], dt, "s" $hstr SetScale y, 0, 0, Unitstrings[SampleSeq[j]] $hstr j += 1 while(j < NumChanSampled) Killwaves fwave, lwave, iwave, cwave Killwaves SignalGain, ProgrammableGain, NameStrings, unitgain, t0wave Killwaves charwave return FilePtr else Killwaves charwave print "This File is not an Axon Binary File!" endif endif End Function GetABFSweep(FilePtr, EpisodeNumber, ByteSwap) Variable FilePtr, EpisodeNumber, ByteSwap Variable j, offset String hstr Wave inputwave = $"inputwave" Wave sampleseq = $"sampleseq" Wave parameterwave = $"parameterwave" Wave ScaleArray = $"ScaleArray" offset = parameterwave[2] + EpisodeNumber * parameterwave[4] FSetPos FilePtr, offset FBinRead/B=(Byteswap) FilePtr, inputwave j = 0 do hstr = "inputwave_Ch_" + num2str(SampleSeq[j]) wave input = $hstr input[0,parameterwave[5]] = inputwave[j + parameterwave[0]*p] * ScaleArray[SampleSeq[j]] j += 1 while(j < parameterwave[0]) End Function CloseABFile(FilePtr) Variable FilePtr Wave sampleseq = $"sampleseq" Wave parameterwave = $"parameterwave" Variable j j = 0 do Killwaves $"inputwave_Ch_" + num2str(SampleSeq[j]) j += 1 while(j < parameterwave[0]) Killwaves sampleseq, scalearray, inputwave, parameterwave End Function PrintHeaderOut() Variable FilePtr Variable i, j, ByteSwap string help Byteswap = !cmpstr(IgorInfo(2),"Macintosh") Open/D/R/T="BINA"/M="Open an AxonBinary file" FilePtr FStatus FilePtr Open/R/T="BINA" fileptr as s_FileName Make/O/N=4/B/U charwave Make/O/N=1/B/U cwave Make/O/N=1 fwave Make/O/N=1/I lwave Make/O/N=1/W iwave printf "\r" print " GROUP #1 - File ID and size information" printf "\r" FBinRead/B=(Byteswap) FilePtr, charwave help = "" i = 0 do help += num2char(charwave[i]) i+=1 while(i < 4) print "sFileSignature = ", help FBinRead/B=(Byteswap) FilePtr, fwave print "fFileVersionNumber = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nOperationmode = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, lwave printf "lActualAcqLength = %8.0f\r", lwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nNumPointsIgnored = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lActualEpsiodes = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lFileStartDate = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lFileStartTime = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lStopWatchTime = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fHeaderVersionNumber = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nFileType = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nMSBinFormat = ", iwave[0] printf "\r" print " GROUP #2 - File structure" printf "\r" FBinRead/B=(Byteswap) FilePtr, lwave print "lDataSectionPtr = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lTagSectionPtr = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lNumTagEntries = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lScopeConfigPtr = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lNumScopes = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lDACFilePtr = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lDACFileNumEpisodes = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, charwave help = "" i = 0 do help += num2char(charwave[i]) i+=1 while(i < 4) print "sUnused68 = ", help FBinRead/B=(Byteswap) FilePtr, lwave print "lDeltaArrayPtr = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lNumDeltas = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lVoiceTagPtr = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lVoiceTagEntries = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lUnused88 = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lSynchArrayPtr = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lSynchArraySize = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nDataFormat = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nSimultaneousScan = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lStatisticsConfigPtr = ", lwave[0] help = "" i = 0 do FBinRead FilePtr, cwave help += num2char(cwave[i]) i += 1 while (i < 12) print "sUnused108 = ", help printf "\r" print " GROUP #3 - Trial hierarchy information" printf "\r" FBinRead/B=(Byteswap) FilePtr, iwave print "nADCnumchannels = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fADCSampleInterval = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fADCSecondSampleInterval = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fSynchTimeUnit = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fSecondsPerRun = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lNumSamplesPerEpisode = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lPreTriggerSamples = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lEpisodesPerRun = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lRunsPerTrial = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lNumberOfTrials = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nAveragingMode = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nUndoRunCount = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nFirstEpisodeInRun = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fTriggerThreshold = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nTriggerSource = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nTriggerAction = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nTriggerPolarity = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fScopeOutputInterval = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fEpisodeStartToStart = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fRunStartToStart = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fTrialStartToStart = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lAverageCount = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lClockChange = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nAutoTriggerStrategy = ", iwave[0] printf "\r" print " GROUP #4 - Display parameters" printf "\r" FBinRead/B=(Byteswap) FilePtr, iwave print "nDrawingStrategy = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nTiledDisplay = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nEraseStrategy = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nDataDisplayMode = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lDisplayAverageUpdate = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nChannelStatsStrategy = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lCalculationPeriod = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lSamplesPerTrace = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lStartDisplayNum = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lFinishDisplayNum = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nMultiColor = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nShowPNRawData = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fStatisticsPeriod = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lStatisticsMeasurements = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nStatisticsSaveStrategy = ", iwave[0] printf "\r" print " GROUP #5 - Hardware information" printf "\r" FBinRead/B=(Byteswap) FilePtr, fwave print "fADCRange = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fDACRange = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lADCResolution = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lDACResolution = ", lwave[0] printf "\r" print " GROUP #6 - Environment information" printf "\r" FBinRead/B=(Byteswap) FilePtr, iwave print "nExperimentType = ", iwave[0] FStatus FilePtr print "nFilePosition = ", V_FilePos FBinRead/B=(Byteswap) FilePtr, iwave print "nAutosampleEnable = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nAutosampleADCNum = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nAutosampleInstrument = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fAutosampleAdditGain = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fAutosampleFilter = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fAutosampleMembraneCap = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nManualInfoStrategy = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fCellID1 = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fCellID2 = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fCellID3 = ", fwave[0] help = "" i = 0 do FBinRead FilePtr, cwave help += num2char(cwave[0]) i += 1 while (i < 16) print "sCreatorInfo = ", help help = "" i = 0 do FBinRead FilePtr, cwave help += num2char(cwave[0]) i += 1 while (i < 56) print "sFileComment = ", help FBinRead/B=(Byteswap) FilePtr, iwave print "nFileStartMillisecs = ", iwave[0] help = "" i = 0 do FBinRead FilePtr, cwave help += num2char(cwave[i]) i += 1 while (i < 10) print "sUnused368 = ", help printf "\r" print " GROUP #7 - Multi-channel information" printf "\r" i = 0 printf "nADCPtoLChannelMap(0-15) = " do FBinRead/B=(Byteswap) FilePtr, iwave printf " %2.0f, ", iwave[0] i += 1 while (i < 16) printf "\r" i = 0 printf "nADCSamplingSeq(0-15) = " do FBinRead/B=(Byteswap) FilePtr, iwave printf " %2.0f, ", iwave[0] i += 1 while(i < 16) printf "\r" i = 0 do help = "" j = 0 do FBinRead FilePtr, cwave help += num2char(cwave[0]) j += 1 while(j < 10) printf " sADCChannelName: %s\r", help i += 1 while(i < 16) i = 0 do help = "" j = 0 do FBinRead FilePtr, cwave help += num2char(cwave[0]) j += 1 while(j < 8) printf " sADCUnits : %s\r", help i += 1 while(i < 16) i = 0 printf "fADCProgrammableGain(0-15) = " do FBinRead/B=(Byteswap) FilePtr, fwave printf "%+4.1f, ", fwave[0] i += 1 while(i < 16) printf "\r" i = 0 printf "fADCDisplayAmplification(0-15) = " do FBinRead/B=(Byteswap) FilePtr, fwave printf "%+4.1f, ", fwave[0] i += 1 while(i < 16) printf "\r" i = 0 printf "fADCDisplayOffset(0-15) = " do FBinRead/B=(Byteswap) FilePtr, fwave printf "%+4.1f, ", fwave[0] i += 1 while(i < 16) printf "\r" i = 0 printf "fInstrumentScaleFactor(0-15) = " do FBinRead/B=(Byteswap) FilePtr, fwave printf "%+4.1f, ", fwave[0] i += 1 while(i < 16) printf "\r" i = 0 printf "fInstrumentOffset(0-15) = " do FBinRead/B=(Byteswap) FilePtr, fwave printf "%+4.1f, ", fwave[0] i += 1 while(i < 16) printf "\r" i = 0 printf "fSignalGain(0-15) = " do FBinRead/B=(Byteswap) FilePtr, fwave printf "%+4.1f, ", fwave[0] i += 1 while(i < 16) printf "\r" i = 0 printf "fSignalOffset(0-15) = " do FBinRead/B=(Byteswap) FilePtr, fwave printf "%+4.1f, ", fwave[0] i += 1 while(i < 16) printf "\r" i = 0 printf "fSignalLowpassFilter(0-15) = " do FBinRead/B=(Byteswap) FilePtr, fwave printf "%+4.1f, ", fwave[0] i += 1 while(i < 16) printf "\r" i = 0 printf "fSignalHighpassFilter(0-15) = " do FBinRead/B=(Byteswap) FilePtr, fwave printf "%4.1f, ", fwave[0] i += 1 while(i < 16) printf "\r" i = 0 do help = "" j = 0 do FBinRead FilePtr, cwave help += num2char(cwave[0]) j += 1 while(j < 10) printf " sADCChannelName: %s\r", help i += 1 while(i < 4) i = 0 do help = "" j = 0 do FBinRead FilePtr, cwave help += num2char(cwave[0]) j += 1 while(j < 8) printf " sADCChannelUnits: %s\r", help i += 1 while(i < 4) i = 0 printf "fDACScaleFactor(0-3) = " do FBinRead/B=(Byteswap) FilePtr, fwave printf "%+4.1f, ", fwave[0] i += 1 while(i < 4) printf "\r" i = 0 printf "fDACHoldingLevel(0-3) = " do FBinRead/B=(Byteswap) FilePtr, fwave printf "%+4.1f, ", fwave[0] i += 1 while(i < 4) printf "\r" FBinRead/B=(Byteswap) FilePtr, iwave print "nSignalType = ", iwave[0] help = "" i = 0 do FBinRead FilePtr, cwave help += num2char(cwave[0]) i += 1 while(i < 10) print "sUnusded1412 = ", help printf "\r" print " GROUP #8 - Synchronous Timer Outputs" printf "\r" FBinRead/B=(Byteswap) FilePtr, iwave print "nOUTEnable = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nSampleNumberOUT1 = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nSampleNumberOUT2 = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nFirstEpisodeOUT = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nLastEpisodeOUT = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nPulseSamplesOUT1 = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nPulseSamplesOUT2 = ", iwave[0] printf "\r" print " GROUP #9 - Epoch Waveform and Pulses" printf "\r" FBinRead/B=(Byteswap) FilePtr, iwave print "nDigitalEnable = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nWavefromSource = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nActiveDACChannel = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nInterEpisodeLevel = ", iwave[0] i = 0 printf "nEpochType(0-9) = " do FBinRead/B=(Byteswap) FilePtr, iwave printf " %2.0f, ", iwave[0] i += 1 while (i < 10) printf "\r" i = 0 printf "fEpochInitLevel(0-9) = " do FBinRead/B=(Byteswap) FilePtr, fwave printf "%+4.1f, ", fwave[0] i += 1 while(i < 10) printf "\r" i = 0 printf "fEpochLevelInc(0-9) = " do FBinRead/B=(Byteswap) FilePtr, fwave printf "%+4.1f, ", fwave[0] i += 1 while(i < 10) printf "\r" i = 0 printf "nEpochInitDuration(0-9) = " do FBinRead/B=(Byteswap) FilePtr, iwave printf "%+2.0f, ", iwave[0] i += 1 while(i < 10) printf "\r" i = 0 printf "nEpochDurationInc(0-9) = " do FBinRead/B=(Byteswap) FilePtr, iwave printf "%+2.0f, ", iwave[0] i += 1 while(i < 10) printf "\r" FBinRead/B=(Byteswap) FilePtr, iwave print "nDigitalHolding = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nDigitalInterEpisode = ", iwave[0] i = 0 printf "nDigitalValue(0-9) = " do FBinRead/B=(Byteswap) FilePtr, iwave printf "%+2.0f, ", iwave[0] i += 1 while(i < 10) printf "\r" i = 0 do FBinRead FilePtr, cwave help += num2char(cwave[i]) i += 1 while (i < 12) print "sUnused1608 = ", help printf "\r" print " GROUP #10 - DAC" printf "\r" FBinRead/B=(Byteswap) FilePtr, fwave print "fDACFileScale = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fDACFileOffset = ", fwave[0] i = 0 do FBinRead FilePtr, cwave help += num2char(cwave[i]) i += 1 while (i < 2) print "sUnused1628 = ", help FBinRead/B=(Byteswap) FilePtr, iwave print "nDACFileEpisodeNum = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nDACFileADCNum = ", iwave[0] help = "" i = 0 do FBinRead FilePtr, cwave help += num2char(cwave[0]) i += 1 while(i < 84) print "sDACFilePath = ", help printf "\r" print " GROUP #11 - Conditioning pulse train" printf "\r" FBinRead/B=(Byteswap) FilePtr, iwave print "nConditEnable = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nConditChannel = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lConditNumPulses = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fBaselineDuration = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fBaselineLevel = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fStepDuration = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fStepLevel = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fPostTrainPeriod = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fPostTrainLevel = ", fwave[0] help = "" i = 0 do FBinRead FilePtr, cwave help += num2char(cwave[0]) i += 1 while(i < 12) print "sUnused1750 = ", help printf "\r" print " GROUP #12 - Variable parameter user list" printf "\r" FBinRead/B=(Byteswap) FilePtr, iwave print "nParamToVary = ", iwave[0] help = "" i = 0 do FBinRead FilePtr, cwave help += num2char(cwave[0]) i += 1 while(i < 80) print "sParamValueList = ", help printf "\r" print " GROUP #13 - Autopeak measurement" printf "\r" FBinRead/B=(Byteswap) FilePtr, iwave print "nAutopeakEnable = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nAutopeakPolarity = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nAutopeakADCNum = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nAutopeakSearchMode = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "nAutopeakStart = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "nAutopeakEnd = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nAutopeakSmoothing = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nAutopeakBaseline = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nAutopeakAverage = ", iwave[0] i = 0 do FBinRead FilePtr, cwave help += num2char(cwave[0]) i += 1 while(i < 2) print "sUnused1866 = ", help FBinRead/B=(Byteswap) FilePtr, lwave print "nAutopeakBaselineStart = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "nAutopeakBaselineEnd = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "nAutopeakMeasurements = ", lwave[0] printf "\r" print " GROUP #14 - Channel arithmetic" printf "\r" FBinRead/B=(Byteswap) FilePtr, iwave print "nArithmeticEnable = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fArithmeticUpperLimit = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fArithmeticLowerLimit = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nArithmeticADCNumA = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nArithmeticADCNumB = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fArithmeticK1 = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fArithmeticK2 = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fArithmeticK3 = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fArithmeticK4 = ", fwave[0] help = "" i = 0 do FBinRead FilePtr, cwave help += num2char(cwave[0]) i += 1 while(i < 2) print "sArithmeticOperator = ", help help = "" i = 0 do FBinRead FilePtr, cwave help += num2char(cwave[0]) i += 1 while(i < 8) print "sArithmeticUnits = ", help FBinRead/B=(Byteswap) FilePtr, fwave print "fArithmeticK5 = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fArithmeticK6 = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nArithmeticExpression = ", iwave[0] help = "" i = 0 do FBinRead FilePtr, cwave help += num2char(cwave[0]) i += 1 while(i < 2) print "sUnused1930 = ", help printf "\r" print " GROUP #15 - On - line subtraction" printf "\r" FBinRead/B=(Byteswap) FilePtr, iwave print "nPNEnable = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nPNPosition = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nPNPolarity = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nPNNumPulses = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nPNADCNum = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fPNHoldingLevel = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fPNSettlingTime = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fPNInterpulse = ", fwave[0] help = "" i = 0 do FBinRead FilePtr, cwave help += num2char(cwave[0]) i += 1 while(i < 12) print "sUnused1954 = ", help printf "\r" print " GROUP #16 - Unused space at end of header block" printf "\r" FBinRead/B=(Byteswap) FilePtr, iwave print "nListEnable = ", iwave[0] printf "nBellEnable = " i = 0 do FBinRead/B=(Byteswap) FilePtr, iwave printf "%4.0f ," iwave[0] i += 1 while(i < 2) printf "\r" printf "nBellLocation = " i = 0 do FBinRead/B=(Byteswap) FilePtr, iwave printf "%4.0f ," iwave[0] i += 1 while(i < 2) printf "\r" printf "nBellRepetitions = " i = 0 do FBinRead/B=(Byteswap) FilePtr, iwave printf "%4.0f ," iwave[0] i += 1 while(i < 2) printf "\r" FBinRead/B=(Byteswap) FilePtr, iwave print "nLevelHysteresis = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, lwave print "lTimeHysteresis = ", lwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nAllowExtermalTags = ", iwave[0] help = "" i = 0 do FBinRead FilePtr, cwave help += num2char(cwave[0]) i += 1 while(i < 16) print "sLowpassFilterType = ", help i = 0 do FBinRead FilePtr, cwave help += num2char(cwave[0]) i += 1 while(i < 16) print "sHighpassFilterType = ", help FBinRead/B=(Byteswap) FilePtr, iwave print "nAverageAlgorithm = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, fwave print "fAverageWeighting = ", fwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nUndoPromptStrategy = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nTrialTriggerSource = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nStatisticsDisplayStrategy = ", iwave[0] FBinRead/B=(Byteswap) FilePtr, iwave print "nExternalTagType = ", iwave[0] help = "" i = 0 do FBinRead FilePtr, cwave help += num2char(cwave[0]) i += 1 while(i < 14) print "sUnused2034 = ", help //JBB exploring what's next // i=0 // do // FBinRead FilePtr, lwave // print i, lwave[0] // i+=1 // while (i<1000) //JBB done FStatus FilePtr print "nFilePosition = ", V_FilePos close FilePtr Killwaves fwave, lwave, iwave, charwave, cwave end