INAC Computer GmbH                                                             User's Guide TcpLink 3000 USB Communication System

Chapter 8

Utility Programs



8.1 Text file conversion with aspcon

The purpose of TCPLINK and SPECSTORE is to move files from your ASPECT to a network or to a archiving device, and to retrieve them from there if required. Since ASPECT files have a special internal format, it is not straightforward to fetch files from a network or an archive to the ASPECT that do not originate from the ASPECT . In special cases, however, it might be useful to transfer a file created on another computer to the ASPECT . For example, you could have set up a \dis automation program or a Pascal program on a remote system.

The aspcon utility program is a C program designed to run on UNIX systems. It converts any UNIX text file to the ASPECT format by supplementing it with a so-called ASPECT --1 sector block, and by shuffling the bytes into the correct order to form the required 24 bit word for the ASPECT . There are two possibilities to start aspcon:

aspcon

aspcon <input file> <output file> <conversion option>

The first way is the simplest: all required information is requested by aspcon in form of a dialog with the user. This information must (in the second way) be specified directly behind the command as arguments. The input file is the file to be converted to ASPECT format, the result is stored in the output file which the has the required structure while the input file remains unchanged. The following conversion options are provided:

  1. The input file is an ASCII file, e.g. generated by the vi text editor. The output file has ASPECT ASCII format and can be listed, edited, compiled, printed etc. after transferring it to the ASPECT .
  2. This option is the complementary to the above: the input file is an ASCII file originating from the ASPECT , and the result is a UNIX ASCII file.
aspcon is delivered on the installation diskette as C source file aspcon.c. In order to transfer it to the desired host computer, insert the installation diskette into your TCPLINK unit. Then type in the following command on the ASPECT keyboard:

TCP SUN:S a:aspcon.c
In this example, SUN.TCP is the file describing the destination host. It is the same file you are also using to send off data from the ASPECT . You can execute this command only if TCPLINK is completely installed. After the successful transfer aspcon.c is stored in the destination directory of the host according to the contents of SUN.TCP.

In order to generate an executable version of aspcon, the C compiler on the host computer must be activated by the command

cc aspcon.c -o aspcon -lm
Afterwards, aspcon represents the executable program, and aspcon.c may be deleted.

Some compilers fail because the file aspcon.c originates from a DOS device and contains extra carriage return characters, while UNIX systems expect only newline characters at the end of a line. You can easily remove the carriage returns from the file by the following procedure:

On the UNIX host, enter the vi editor using the command vi aspcon.c. The carriage returns are displayed as Control-Ms. Now, within vi, type :0,$s/^ M//, and hit the Enter key. All carriage returns are thereby removed, and you can leave vi via ZZ. The ^ M between the two slashes above is generated in vi by holding down the Shift and Control keys, and then pressing V followed by M.

8.2 Partial file extraction program extract

The program extract must be available in the user's home directory of the host computer if a file is to be transferred to the ASPECT via TCP, and the file size is larger than 512K data points.

extract is delivered in source form (file extract.c) on the installation diskette and must be compiled on the host computer. Please install and compile it exactly as described above for the program aspcon.

During operation, extract generates a protocol file extract.prot in the user's home directory on the host. The contents of this file could be helpful in case of problems. Otherwise it is not needed.



     © 2002 INAC Computer GmbH   |    Letzte Änderung: 18.09.2002