Difference between revisions of "Elsys Wiki - Help and Recources for TranAX and TraNET DAQ:About"

From Elsys Wiki - Help and Recources for TranAX and TraNET DAQ
Jump to: navigation, search
(Conversion BDF to tpc5 files, formula example)
 
(Blanked the page)
 
Line 1: Line 1:
== Convert multiple *.bdf files into *.tpc5 files ==
 
  
Fast recording and streaming to disk with '''Continuous''' or '''ECR''' mode(Event Controlled Recording) creates files with the extension *.bdf (binary data file).
 
These files can be opened and handled with TranAX Data Acquisition Software and saved later in Elsys's standard *.tpc5 file format.
 
 
To convert multiple of these *.bdf files at once, the following Formula Editor example can be used.
 
copy and paste the code below into TranAX Formula Editor.
 
 
<syntaxhighlight lang=vb style="border:0px dashed blue">
 
; Convert multiple bdf files to tpc5
 
; 26.9.2017 Elsys AG / TBE
 
; TranAX 4.0 or newer
 
 
; Select directory with *.bdf files
 
path = "D:\Transfer"
 
retval = pause ("BDF file path:", path);
 
if retval = 1 then
 
  SetFormulaError("Aborted...")
 
endif
 
 
; Convert each file
 
for each item in GetFiles(path, "*.bdf")
 
  SaveBDF2TPC5(item);
 
next
 
 
 
endformula
 
; Save bdf file as a tpc5 file
 
Function SaveBDF2TPC5(filenameBDF)
 
  filenameTPC5 = GetFilenameWithoutExtension(filenameBDF, "bdf") + "tpc5"
 
  save(filenameTPC5, filenameBDF)
 
EndFunction
 
 
 
; remove file extension
 
Function GetFilenameWithoutExtension(filepath, extension)
 
  GetFilenameWithoutExtension = Slice(filepath, 0, (Length(filepath)-1) - Length(extension))
 
EndFunction
 
</syntaxhighlight>
 

Latest revision as of 12:08, 26 September 2017