TNC Time Set

See all articles from QZX v10 n1
Author(s): Alex Burr (K5XY)
Publication: QZX
Pub Details: QZX v10 n1 (Volume 10, Issue 1)
Date: December 1991
Pages: 7

Here is a short BASIC program which is designed to automatically set the Day variable on the usual TNC. It will have to be modified a bit depending on whether your computer is a ZX81, TS2068, QL, or Z88. The Day variable in the usual TNC is the memory location which is used to time stamp the heard reports and received packet messages. It contains the year, month, day, and time. The QL and Z88 will provide this data automatically. The ZX81 has to have a custom program to keep track of the time active. If the QL has the Gold Card addition it will even keep the time automatically even if turned off.

Here is the program.

1 REM *** The following program
2 REM will send the time to your tnc
10 REM ** set tnc clock by W2IHJ ***
140 OPEN "com2:1200,E,7" as #1
150 REM Routine to get computer
151 REM time/date and convert to
152 REM TNC format
160 TNCDATE$= RIGHT$(DATE$,2) + LEFT(DATE$,2) + MID$(DATE$,4,2)
170 TNCTIME$ = LEFT$(TIME$,2) + MID$(TIME$,4,2)
180 TNCUPD$ = TNCDATE$ = TNCTIME$
190 PRINT "DAY " + TNCUPD$
200 PRINT #1, "DAY " + TNCUPD
210 SYSTEM

Here are some comments on the various lines which will help you adapt the program to your computer.

Line 140 opens a channel to the serial port which is connected to your TNC. In the QL this would be one of the serial ports, probably SER1 in the typical set up. This line also sets the data rate that you use with your TNC.

Lines 160 to 180 uses string slicing techniques to take the information from the computer (in this case assumed to be contained in string variables named date$ and time$) and puts it in a form which can be more easily transmitted to the TNC.

Line 190 prints what is to be sent to the TNC so you can verify that all is well.

Line 200 does the actual sending. Here day is the command which tells the TNC to update its time stamping variable and the TNCUPD$ contains the numbers to be used to perform the update.

Line 210 returns program control to the operating system. The port can be left open because presumably you are now going to use your TNC.