Batch Mode Example : Tektronix files
SynaptiCAD products that can read Tektronix files and have the compare option added can run comparisons
on files using batch mode execution. This makes it very fast to load successive Logic Analyzer captures
and perform comparisons. This example shows a batch file that will compare a Tektronix logic analyzer
file and a file that has been converted to SynaptiCAD.s btim format. The following code really only
3 lines of code and a lot of documentation. The code can be copied in to a *.bat file and executed:
echo off
REM This batch file demonstrates how to do batch conversion/comparison with
REM WaveFormer Pro. Input is a golden reference file (reference.btim),
REM a filter file (reference_filter.tim) and a Tektronix file.
REM The filter file contains the comparison tolerances for each signal being compared.
REM The filter file was created by loading the reference file, changing all the signals
REM to compare signals and setting the comparison tolerances, then save as "Waveform filter".
REM
REM This bat file converts the Tektronix file to a btim file (our native file format).
REM Next it sets the filter file to set the compare tolerances, loads the reference file,
REM and compares the converted Tektronix btim file against the reference file.
set syncad=c:\SynaptiCAD\bin\win32\syncad.exe
set product=wfp
set basename=LMOList
set referencefile=reference.btim
set filterfile=reference_filter.tim
echo This assumes that the files %basename%.vcd and %filterfile%
echo are in the current directory.
echo .
echo Converting %basename%.txt to btim format for use as compare file
REM we split the perl command across multiple lines with ^ to improve readability
%syncad% -p%product% --batch-mode --eval-perl-string twf::SetFilterFile(undef);^
twf::OpenFile(qw(%basename%.txt),qw(TVECTOR_To_IF));^
twf::SaveFile(qw(%basename%.btim),qw(IF_To_TIMBINARY));
echo .
echo Now we invoke WaveFormer Pro to do the comparison
echo and display the results.
REM NOTES: that the argument to CompareFile must be a .tim/.btim file, so if
REM you have, for example, a .cbc and a .tim, do the OpenFile on the
REM .cbc and the Compare on the .tim; doing it in the other order
REM will fail. If neither of the files is a .tim file, you need to
REM convert one of them to a .tim/.btim file first.
%syncad% -p%product% --eval-perl-string twf::SetFilterFile(undef);^
twf::OpenFile(qw(%referencefile%));^
twf::SetFilterFile(qw(%filterfile%));^
twf::CompareFile(qw(%basename%.btim));
Return to the Batch Main Page
|