SYNAPTICADcolon

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\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 WARNING: in Windows 9x, this will launch two conversions
echo at once because batch files don't wait for subprocesses to
echo complete before they continue to the next step. This isn't
echo really a problem -- multiple copies of WaveFormer Pro can be
echo run at the same time -- as long as there is no dependency
echo between the first step and the second step. In our case,
echo the second invocation depends on the file %basename%.cbc
echo generated by the first step, so we've got a problem.
echo We're cheating here and putting a pause statement between the
echo two commands and leaving it up to the user to separate the
echo commands. In a real app you'd need to do something more clever.cc
echo .

echo .
echo Converting %basename%.txt to btim format for use as compare file
%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 Press ENTER when you think the conversion to BTIM format might be done
pause

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