Home | About Us | In-Circuit Test | Functional Test | Tutorials, Software, etc | Fixtures | Contact Us
Hartman Associates
BT Basic & Hidden File Headers

Learn how to use BT Basic to create source files with different attributes.

One of the problems with using BT Basic to modify existing test source files or generating new test source files is that file output is in text mode only. If you read, modify and write out a test source file the output file no longer is in the filetype suitable for compiling. One option is to get filetype "filename", re-store, and compile. When modifying many files this is very time consuming and prone to errors.

The filetype information is contained in the first line of the file. When these files are loaded into a BT Basic window, these headers are not visible, however if you use the file manager icon on your 3070 desktop and browse to a test source file and open it into the text editor you will see this hidden line. Listing 1 is the first several lines of a testjet source file. Note the first line starting with the character sequence "!!!!". All test source headers begin with this sequence. The remainder of the line is unique to the software version and source file type. The one depicted in Figure 1 is, of course, the hidden header for a testjet source.

Listing 2 is a simple read/write BT Basic program that reads the testjet source file and writes it to a file named "testjet.txt". If you do a catalog of the directory you will see that the while the original file "testjet" has a file type of "src testjet", the file "testjet.txt" has a file type of "src". To convert this file back to a compilable testjet source file you must execute a get testjet "testjet.txt" then re-store it.

Listing 3 is a similar BT Basic program, but it writes the hidden testjet header line to the file. Note the first line: all test source headers are 78 characters in length. The header is written out as the first line to the output file. If you do a catalog of the directory you will see that the newly created file "testjet.src" has a file type of "src testjet" and is ready to be compiled.

Now, the question is "how do I get the hidden header codes?". It's actually very simple. Using the 3070 file manager, find a testjet source file in a current board directory and double click on it, loading it into the text editor. At the beginning of the header code line insert the following character sequence !* and store the file under a new name. The added prefix "!*" prevents the header from creating a "syntax challenged" testjet source file. If you restore it to the same name your testjet file will be corrupted. You will notice that the new file you created has a file type of "src". Load the new file in a BT Basic window and you will see the modified header code at the top of the file. You can either copy the first line into the clipboard using the mouse and paste it into your BT Basic program (since the first character is a "!" it is treated as a commented line) or you can delete all lines in the file except the header line and restore the file and then merge it into your BT Basic program. Regardless of the method used, simply edit the line similar to the line defining "TJHdr$" in Listing 3. Remember to remove your "!*" sequence at the beginning of the line.

The methods describe above can be used for any test source files, digital, analog, mixed digital, mixed analog, wirelist, fixture, etc.

Listing #1

!!!! 25 0 1 978255792 Vb4ad

default threshold low 18 high 10000

device "u12"
! test pins 12, 13, 14, 15, 16, 17, 18, 20 !! ground pins commented by IPG
! pins 1, 11, 25, 23, 24 !! ground pins commented by IPG
test pins 3
test pins 4
test pins 5
test pins 6; threshold low 10 high 100
test pins 7
test pins 8
test pins 9
test pins 10
test pins 21
test pins 22
test pins 26
test pins 27
end device

Listing #2

assign @Rd to "testjet";read
assign @Wr to "testjet.txt";write,over

loop
T$ = ""
enter @Rd,,Error;T$
exit if Error
output @Wr;T$
end loop

assign @Rd to *
assign @Wr to *

Listing #3

HdrOut:image78a
TJHdr$="!!!! 25 0 1 1000847537 V4b2c"

assign @Rd to "testjet";read
assign @Wr to "testjet.src";write,over
output @Wr using HdrOut;TJHdr$
loop
T$ = ""
enter @Rd,,Error;T$
exit if Error
output @Wr;T$
end loop
assign @Rd to *
assign @Wr to *

Copyright © 2005 Hartman Associates