Author Topic: Tektronix 4924 Tape Drive Emulator  (Read 34780 times)

0 Members and 1 Guest are viewing this topic.

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #250 on: September 02, 2021, 09:23:05 pm »
Ok - more progress.

I wanted a longer test for the current features, so I have uploaded a new Tek4924sd set of files to the Store.

Two new folders:

SYSTAPE - all the files from the Tektronix 4050 System Software tape, ported to use the Tape Emulator for file access.
ADVENTURE - my port of adventure from the 4907 floppy drive system to use Tape Emulator for file access.

Adventure will start and load some data files until it runs out of memory on your 4051.
This game requires 64KB of RAM - so is limited to the 4052 and 4054 computers for now.
I ported this from a Commodore PET version that runs in 32KB.  But the Commodore version makes heavy use of integer variables, integer arrays and string arrays. 

Tek BASIC does not support integers - all numbers are in double-precision floating point and take 8 bytes of memory per number :(

I do think with the 4051 CALL "EXEC" command, we could create assembler programs to handle the integer arrays and try to squeeze this Adventure version into a 4051 with 32KB of RAM (after the Tape Emulator is done).

In the meantime - I tried the SYSTAPE on my 4052:

PRINT@5,19:"SYSTAPE"
FIND@5:1
OLD@5:
RUN

This file 1 is a menu program - I picked the first selection and it loaded file 2 which finds there is more than 8KB of RAM and it loads file 7. 

But since I can't read all the screen in my 4052 until I fix the display, I didn't try to manually enter Y data points to see a simple Y-Plot.

Then I decided to try to run Adventure and ran into a Tape Emulator bug.

PRINT@5,19:"ADVENTURE"
FIND@5:51  (the main program is file 51 not file 1)
OLD@5:
RUN

I could see on my 4052 it print "Welcome", then I saw a GPIB error 69 on line 179.

Line 179 contains the FIND @5:2 command to open file 2.

Previous to that the lines opened file 1 and read 131 pairs of numbers.

I noticed in my early testing with my continuedDev version that I had to add time delays in Adventure between successive INPUT commands.

I don't think that should be necessary if the Tape Emulator needs more time before it is ready for a command, it should be able to delay Tek BASIC using GPIB protocol.

Here is the debug output when the delay is too short.

You can see in line 62 the first INPUT from file 1, the numbers 1 and 133488.

Then I see another 1 being printed on the debug console - that doesn't look right.

Then the emulator reports ATN or ERR during send and then done and then the next INPUT command.

There are errors on every transaction - and on the Tektronix side it did get the data, but the Emulator didn't respond on the INPUT in the next section of code.

* Adventure - debug1.zip (1.71 kB - downloaded 59 times.)
 

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: Tektronix 4924 Tape Drive Emulator
« Reply #251 on: September 03, 2021, 08:22:53 am »
I have downloaded your version 0.05.35.

I had to change a couple of things to make it compile:

1 - I edited the Store_Tek_4924.h file to set SD_SCK_MHZ(50) as the parameter name wasn't found
2 - I commented GPIBdevice.h line 1.  I googled ArduinoCloudProvidersExamples and the Arduino.cc page indicates it is only compatible with boards with the SAMD CPU.

3 - Then I updated the Config.h line 10 to display the 0.05.35 version number when I use the ++ver command on the serial console.

I can use INPUT on ASCII PROGRAM files but not ASCII DATA files?

How do I enable the serial debug output to see those commands on the serial console?

1. I added the parameter to AR488_Config.h. The storage section in mine now looks like this:

#define EN_STORAGE
#ifdef EN_STORAGE
  #define SDCARD_CS_PIN 4  // SS pin on Pandauino 644-Narrow / 1284-Narrow (644P/1284P)
  #define SDCARD_CLK 16    // Clock speed in MHz
  #define EN_TEK_4924
//  #define EN_PET_9060
#endif

Since the SD card reader doesn't have its own clock, my assumption was that this should match the speed of the Arduino clock? I previously had it set to 20MHz as my dev board has a 20MHz crystal. Adding the parameter to the Config file allows it to be set as required. The parameter '#define SDCARD_CS_PIN 4' can actually be commented out as it will use pin 4 by default anyway.

2. That line is spurious. Not quite sure where it came from but I have deleted it.

3. Since we now have the same setup that uses the same CS pin number, I will be pushing up the AR488_Config.h file from the next update.

Thank you for the details of your tests which are encouraging. I will look over them in detail and investigate any anomalies. Just to reply to one point:

I can use INPUT on ASCII PROGRAM files but not ASCII DATA files?

That's curious because I was actually testing with ASCII DATA files. Is it possible that the letter 'D' is not in the correct position in the file name? Did you notice from the emulator console what type is was identified as?

It might just be worth checking the number of spaces in the filename and make sure that 'D' is the eighth character. The INPUT function should work on both ASCII DATA and ASCII PROG files.

Quote
  if ((f_type == 'D') || (f_type == 'P')) {

Thank you for the detailed report on your testing. I picked up a couple of things while skimming through it but I plan to have a more detailed look later and carry out the tests you suggest.

I edited Store_Tek_4924 line 349 and changed (filenum > 0) to (filenum >=0).

I will make this change and test on my 4051.

Quote
I noticed in my early testing with my continuedDev version that I had to add time delays in Adventure between successive INPUT commands.

I don't think that should be necessary if the Tape Emulator needs more time before it is ready for a command, it should be able to delay Tek BASIC using GPIB protocol.

I agree. Versions 05.32 and 05.33 had a problem in that regard but neither 0.31 nor version 05.35 should need any delays. Of course, 05.31 will not have the latest developments and fixes. I will test Adventure on the 4051 a bit later to see how it behaves.

I have also noted the new feature request and will have a think about how this can be implemented.
« Last Edit: September 03, 2021, 08:35:26 am by WaveyDipole »
 

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: Tektronix 4924 Tape Drive Emulator
« Reply #252 on: September 03, 2021, 10:14:24 am »
I updated line 349 of Store_Tek_4924 as suggested and I do now get the TLIST. Selecting a program returns back to the "UTILITIES menu", although looking at line 450 of file 1 in UTILITIES that looks like what it was meant to do so I guess the test was a success!
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #253 on: September 03, 2021, 11:51:00 am »
Quote
Quote from: mmcgraw74 on Yesterday at 05:31:28 pm
I can use INPUT on ASCII PROGRAM files but not ASCII DATA files?

That's curious because I was actually testing with ASCII DATA files. Is it possible that the letter 'D' is not in the correct position in the file name? Did you notice from the emulator console what type is was identified as?

It might just be worth checking the number of spaces in the filename and make sure that 'D' is the eighth character. The INPUT function should work on both ASCII DATA and ASCII PROG files.

You are correct, I found that my filenames in that folder were not aligned properly - the serial debug output pointed out my error.
I fixed all those filenames in my latest sd image zip file upload.

You should be able to test the Adventure file input commands.

I wrote a short test program on my 4054A yesterday and duplicated the hangs:

100 PRINT@5,19:"ADVENTURE"
110 FIND@5:1
120 FOR J=1 TO 131
130 FOR K=1 TO 100
140 NEXT K
150 INPUT A,B
160 PRINT A,B
170 NEXT J
180 END

I tried changing the delay in line 130 but it didn't affect the results.
Typically the program would hang (but BREAK key worked) at line 150 with J=2 or J=3 on my 4054A.

Running this on your 4051 might work with smaller or no delays.
Sometimes my 4052 would complete the loop of 131 data pairs - mostly not.

The 4054A uses the TI 9914 GPIB IC - so it has quite a bit faster GPIB performance than the 4052 (which has the same discrete GPIB interface as the 4051), plus both of them are about 10x faster CPUs than the 4051.

I suspect I will need to get a logic analyzer trace of my 4052 and 4054A running this test program to compare to the 4051 result.

We should be able to add each of the following sections of code that access the other data files - some of which INPUT strings.

When all those data files can be read successfully on my 4052 and 4054 with the delay code removed - Adventure will work :)
« Last Edit: September 03, 2021, 11:53:21 am by mmcgraw74 »
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #254 on: September 03, 2021, 12:08:17 pm »
The Tektronix Tekniques newsletter - Vol 6 No 3 Fall 1982 pages 18-19 had an article on the introduction of the 'new' A-Series 4052A and 4054A.

http://www.bitsavers.org/pdf/tektronix/tekniques/vol6/Tekniques_Vol_6_No_03.pdf

It said the BASIC performance for some commands was up to 20% faster and the GPIB performance was 4X faster than the original 4052 and 4054.

In addition 38 new BASIC commands were added including IF/THEN/ELSE, DO/EXIT IF/LOOP and character strings supporting full 256 ASCII characters instead of original 128 characters.

Another BASIC enhancement which was not published at that time was the 4052A/4054A CALL "EXEC" assembly language command - used in the 4052A/4054A Assembler program, whose documentation included the A-Series ROM entry points and all the new 16-bit bit-slice CPU opcodes!

After the 4052A/4054A Assembler program was published - Tektronix followed with the 4051 Assembler program which also included 4051 ROM entry points.

I posted both of these assembler programs and docs on my Tektronix 4051/4052/4054 program repository:

https://github.com/mmcgraw74/Tektronix-4051-4052-4054-Program-Files
« Last Edit: September 03, 2021, 12:15:43 pm by mmcgraw74 »
 

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: Tektronix 4924 Tape Drive Emulator
« Reply #255 on: September 03, 2021, 12:39:41 pm »
I ran the program after a small modification on the 4051 and it ran up to the final entry no. 314. The first time I ran it I was prompted for an entry so I modified it to request the data from device 5. I also had to change the case for the word "ADVENTURE" to "Adventure". No big deal. The modified version I ran:

Code: [Select]
100 PRINT@5,19:"Adventure"
110 FIND@5:1
120 FOR J=1 TO 131
130 FOR K=1 TO 100
140 NEXT K
150 INPUT@5:A,B
160 PRINT A,B
170 NEXT J
180 END

This ran all the way through to the final entry no. 314. I then removed lines 130 and 140 leaving:

Code: [Select]
100 PRINT@5,19:"Adventure"
110 FIND@5:1
120 FOR J=1 TO 131
150 INPUT A,B
160 PRINT A,B
170 NEXT J
180 END

This also ran up to entry no. 314. I ran it five times times more and it ran without an error. One slight anomaly I noticed was that some numbers were being represented with exponents. For example entry no. 206 was printed as 1.0541692E+7. I presume this is due to the size of the number in question which has 8 digits. There were a handful of others in the listing.

I will carry out and post a logic analyser trace a little later.
 
« Last Edit: September 03, 2021, 02:00:34 pm by WaveyDipole »
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #256 on: September 03, 2021, 01:53:00 pm »
Excellent result!

Yes, some of the integers have exponents due to the number of significant digits.

Can you add test code to process all four data files 1 through 4.
Your test code doesn't have to worry about the arrays - you can put the results in simple variables for the test.

If you remove the print variable code and then just print the J value from each completed loop, completion of all four tests is an extensive test of the INPUT command on the 4051!

BTW - lines 246 to 257 read a set of strings and concatenate them into a single string while saving pointers to each one in the V9 array.  No need to do anything like that in the test - just read each of the strings.
« Last Edit: September 03, 2021, 01:57:08 pm by mmcgraw74 »
 

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: Tektronix 4924 Tape Drive Emulator
« Reply #257 on: September 03, 2021, 02:18:05 pm »
Will do. Running out of time today, but maybe tomorrow. Just had a quick look at files 2 - 4 and I see they are in different formats. Did you want me to modify the program accordingly for the data in each file and run each one separately? I don't mind doing arrays, perhaps for file 3 where 5 variables per line are involved. It will be good programming practice in any case.

I have just done a LA capture of the GPIB bus while the test program was running. I have attached the text output from the Sigrok PulseView IEEE decoder and some images of the traces.

Overview of transmission:
1261321-0

Start of transmission - switching to the Adventure directory:
1261327-1

Selecting file 1:
1261333-2

Burst of data reading each pair of variables.
1261339-3

Final two bursts and transmission ends:
1261345-4
« Last Edit: September 03, 2021, 02:31:09 pm by WaveyDipole »
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #258 on: September 03, 2021, 02:21:27 pm »
I was thinking to add all the file tests into one test program - but just printing the final loop count on each file to show the complete file was read successfully.  Then you wouldn't need to page the screen.

I guess each test could be written individually with data printout to verify the output matches the data file, then combine them all and REM or delete the output print statements.
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #259 on: September 03, 2021, 02:23:58 pm »
I can also generate binary versions of these files to be used for READ/WRITE tests.
 

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: Tektronix 4924 Tape Drive Emulator
« Reply #260 on: September 03, 2021, 02:30:32 pm »
No problem. I can do all 4 as a single batch.
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #261 on: September 04, 2021, 04:20:39 pm »
I did some troubleshooting on my 4052 display issue - it appears to be the Collimator circuit that isn't working.

Here is the description of that circuit and the schematic page:



I clipped onto resistor leads and connected to a voltmeter.

Q361 was off and the R359 adjustment pot voltage changed on the collector pin as I adjusted that pot.
When I pressed the PAGE key to ERASE the screen, the voltage dipped briefly toward zero.

Q162 appears to be the problem.  When I press the PAGE key neither the emitter or collector voltage changed, although the base voltage changed from -4V to 0V.

I've ordered a replacement transistor - the Tektronix Common Semiconductor Manual indicated the P/N is 2N4250.

The symptom I have is similar to the description of the Collimation circuit:

Quote
Collimation operating level, as established by the collimation control circuitry, determines the
linearity of flood gun intensity across the face of the crt. If the voltage is too  high, the outer
portions of the crt will tend to write up and excessive display power will be used. If the voltage
is too low, the center of the crt will tend to write up and information on the outside edges will
tend
to show  information  dropout.

My voltage on P58 pins 3 and 5 was around 0.4V
« Last Edit: September 04, 2021, 04:26:12 pm by mmcgraw74 »
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #262 on: September 04, 2021, 04:40:33 pm »
Not deterred by my 4052 display issue - I decided to capture the 4052 running the simple INPUT test program on the Adventure file 1.

I change the output PRINT statements to PRINT @40: which is the Option 1 Serial interface port.  I connected my USB serial adapter to the 4052 serial connector - configured the port for 9600-8N1 and used Tera Term to send the test program to the 4052 and to show the output of the test program.

I also connected the Tape Emulator to the same PC and used RealTerm to display the Tape Emulator serial debug output.

Here is my slightly modified test program:

Code: [Select]
100 PRINT@5,19:"ADVENTURE"
110 FIND@5:1
120 FOR J=1 TO 131
130 FOR K=1 TO 100
140 NEXT K
150 INPUT@5:A,B
160 PRINT@40:A,B
170 NEXT J
180 PRINT@40:"DONE"
190 END

I started with a time delay of 100, and on the first run - all the data was received, but I didn't have the logic analyzer capture the data.

Then I changed the delay to 10 and only got to J=17, and still didn't have the LA connected.

I then connected the logic analyzer and tried the delay of 10 but all the data was received.

Then I changed the delay to 1 - started the LA and all the data was received.

We should be able to compare the screenshots and zip of the trace file - attached.

First screenshot is running the "CD Adventure" command:



Second shot is the Tek BASIC UNTALK/UNLISTED at the end of every command - no need to show this again



Third image is FIND@5:1



Next is the INPUT@5: A,B



last attachment is the trace file.  The LA doesn't have enough samples for the entire trace.

* FNDINP.zip (8.1 kB - downloaded 15 times.)

Sorry - last attachment is the first set of A,B from file 1

« Last Edit: September 04, 2021, 04:42:55 pm by mmcgraw74 »
 

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: Tektronix 4924 Tape Drive Emulator
« Reply #263 on: September 04, 2021, 06:19:20 pm »
I put together a test program as you suggested and gave it a try and ran into some problems.

Here is the program:

Code: [Select]
100 REM Adventure File 1
110 PRINT@5,19:"Adventure"
120 FIND@5:1
130 FOR J=1 TO 131
140 INPUT@5:A,B
150 NEXT J
160 PRINT "File 1 total: ", J-1, "pairs of numbers read"
200 REM Adventure File 2
220 FIND@5:2
230 FOR J=1 TO 114
240 INPUT@5:A$
250 INPUT@5:B
260 NEXT J
270 PRINT "File 2 total: ", J-1, "string/number pairs read"
300 REM Adventure file 3
320 FIND@5:3
330 DIM K0(5)
340 FOR J=1 TO 228
350 INPUT@5:K0(J)
360 NEXT J
370 PRINT "File 3 total: ",J-1, "groups of 5 numbers read"
400 REM Adventure file 4
410 T = 0
415 X = 0
417 Y = 0
418 Z = 0
420 FIND@5:4
430 FOR J=1 TO 38
440 INPUT@5:A$
450 NEXT J
460 X = J
470 PRINT "File 4 sub-total: ", X, "statements read"
480 FOR J = 39 TO 76
490 INPUT@5:A
500 Y = Y + 1
510 NEXT J
520 PRINT "File 4 sub-total: ", Y, "numbers read"
530 FOR J = 77 TO 114
540 INPUT@5:A$
550 Z = Z + 1
560 NEXT J
570 PRINT "File 4 sub-total: ", Z, "items read"
580 T = X + Y + Z
590 PRINT "File 4 total: ", T, "lines read"
600 END

What happened was that it finished running up to line 200 but hung. on line 220. Hitting break twice resulted in this error message being displayed:

Quote
GP INTERFACE BUS I/O ERROR IN LINE 220 - MESSAGE NUMBER 69

I did manage to repeat the process and capture the result on the logic analyser but have not had time to analyse it properly yet. A quick look shows the INPUT loop running and finishing normally, but the subsequent FIND statement does not run.

Good news on identifying the problem with your 4052! I take it that the biasing resistors around Q162 were OK then? What voltage did you get at the emitter?
« Last Edit: September 04, 2021, 07:10:45 pm by WaveyDipole »
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #264 on: September 04, 2021, 06:28:24 pm »
I think I saw the same error message when I tried running the full Adventure program (file 51).

I'll try your longer test program on my 4052.

Monty
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #265 on: September 04, 2021, 06:55:51 pm »
I had the same result on my 4052 - although I can't see the error message - the program stopped immediately after the line 160 "File 1 total" was printed.

I have enabled DEBUG_SERIAL_INPUT and DEBUG_CMD_PARSER and I see "EOF reached!" after the last data pair.

All the data pairs prior print out the two data numbers with a comma between, then there is a print of a single digit on the next line.  This digit happens to be the same as the first digit of the first data number - weird.

In addition - every data pair is followed by "ATN or ERR during send!!" although the data was received by TEK BASIC.
The following line is "stgc_0x6D_h: done." message

Except on the last data pair - there is no "ATN or ERR during send" message, but there is an "EOF reached!" message with a blank line and then the "ATN or ERR during send!!" message, followed by the stgc message - and no other messages.

Here is a snippet of the end of the serial debug output:

Code: [Select]
stgc_0x6D_h: done.
Executing secondary address command: 6D
stgc_0x6D_h: started INPUT handler...
stgc_0x6D_h: reading /Adventure/1      ASCII   DATA [ADVKEYS  ]   8...
308,108970
3
ATN or ERR during send!!
stgc_0x6D_h: done.
Executing secondary address command: 6D
stgc_0x6D_h: started INPUT handler...
stgc_0x6D_h: reading /Adventure/1      ASCII   DATA [ADVKEYS  ]   8...
309,117759
3
ATN or ERR during send!!
stgc_0x6D_h: done.
Executing secondary address command: 6D
stgc_0x6D_h: started INPUT handler...
stgc_0x6D_h: reading /Adventure/1      ASCII   DATA [ADVKEYS  ]   8...
309,8321691
3
ATN or ERR during send!!
stgc_0x6D_h: done.
Executing secondary address command: 6D
stgc_0x6D_h: started INPUT handler...
stgc_0x6D_h: reading /Adventure/1      ASCII   DATA [ADVKEYS  ]   8...
310,405501
3
ATN or ERR during send!!
stgc_0x6D_h: done.
Executing secondary address command: 6D
stgc_0x6D_h: started INPUT handler...
stgc_0x6D_h: reading /Adventure/1      ASCII   DATA [ADVKEYS  ]   8...
311,3426
3
ATN or ERR during send!!
stgc_0x6D_h: done.
Executing secondary address command: 6D
stgc_0x6D_h: started INPUT handler...
stgc_0x6D_h: reading /Adventure/1      ASCII   DATA [ADVKEYS  ]   8...
312,2150731
3
ATN or ERR during send!!
stgc_0x6D_h: done.
Executing secondary address command: 6D
stgc_0x6D_h: started INPUT handler...
stgc_0x6D_h: reading /Adventure/1      ASCII   DATA [ADVKEYS  ]   8...
313,319778
3
ATN or ERR during send!!
stgc_0x6D_h: done.
Executing secondary address command: 6D
stgc_0x6D_h: started INPUT handler...
stgc_0x6D_h: reading /Adventure/1      ASCII   DATA [ADVKEYS  ]   8...
313,2707727
3
ATN or ERR during send!!
stgc_0x6D_h: done.
Executing secondary address command: 6D
stgc_0x6D_h: started INPUT handler...
stgc_0x6D_h: reading /Adventure/1      ASCII   DATA [ADVKEYS  ]   8...
314,1233737
EOF reached!
                                                               
ATN or ERR during send!!
stgc_0x6D_h: done.

I'm adding a screenshot of the RealTerm display of ALL the characters at the end of the debug log:



Notice that all the data pairs except the last one are terminated by CR.

The last data pair has a different termination of CRLF.

I'll bet there is an output statement with an LF prior to the EOF reached?
« Last Edit: September 04, 2021, 07:02:07 pm by mmcgraw74 »
 

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: Tektronix 4924 Tape Drive Emulator
« Reply #266 on: September 04, 2021, 07:22:39 pm »
The output on the serial console here is identical:

Code: [Select]
Executing secondary address command: 6D

stgc_0x6D_h: started INPUT handler...

stgc_0x6D_h: reading /Adventure/1      ASCII   DATA [ADVKEYS  ]   8...

313,319778
3

ATN detected or ERR during send!!

stgc_0x6D_h: done.

Executing secondary address command: 6D

stgc_0x6D_h: started INPUT handler...

stgc_0x6D_h: reading /Adventure/1      ASCII   DATA [ADVKEYS  ]   8...

313,2707727
3

ATN detected or ERR during send!!

stgc_0x6D_h: done.

Executing secondary address command: 6D

stgc_0x6D_h: started INPUT handler...

stgc_0x6D_h: reading /Adventure/1      ASCII   DATA [ADVKEYS  ]   8...

314,1233737

EOF reached!



ATN detected or ERR during send!!

stgc_0x6D_h: done.

After the last ATN, the one after 'EOF reached!' the interface should be going back into a listen state to receive the next command but something is going wrong here. If one breaks out and the FIND command is run manually it works. I am going to update the writeByte() function to separate out the detection of the ERR and ATN conditions so we can see which one is actually occurring.

The weird repetition of the first character is because the loop has read the next character after the CR, but the Tek has interrupted the transmission. That's why the fuction goes back a char before the next read. I am thinking that maybe it should be programmed to send and stop at the CR rather than waiting for the Tek to interrupt. The Tek should perhaps only interrupt when its buffer of 74 chars have been filled. I don't think that explains it sticking on the next FIND command though.
« Last Edit: September 04, 2021, 08:04:29 pm by WaveyDipole »
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #267 on: September 04, 2021, 08:12:08 pm »
I commented out the Store_Tek_4924.cpp line 705 to suppress the ATN or ERR messages in the INPUT command and uncommented the line 696 close function.

This is allowing the file 1 to be closed and the next loop on file 2 starts to run:

Code: [Select]
Executing secondary address command: 6D
                                       
stgc_0x6D_h: started INPUT handler...
                                         
stgc_0x6D_h: reading /Adventure/1      ASCII   DATA [ADVKEYS  ]   8...
       
313,319778
                                                                     
3stgc_0x6D_h: done.
                                                           
Executing secondary address command: 6D
                                       
stgc_0x6D_h: started INPUT handler...
                                         
stgc_0x6D_h: reading /Adventure/1      ASCII   DATA [ADVKEYS  ]   8...
       
313,2707727
                                                                   
3stgc_0x6D_h: done.
                                                           
Executing secondary address command: 6D
                                       
stgc_0x6D_h: started INPUT handler...
                                         
stgc_0x6D_h: reading /Adventure/1      ASCII   DATA [ADVKEYS  ]   8...
       
314,1233737
                                                                 
EOF reached!
                                                                 
stgc_0x62_h: started CLOSE handler...
                                         
stgc_0x62_h: closing: 1      ASCII   DATA [ADVKEYS  ]   8...
                 
stgc_0x62_h: done.
                                                           
stgc_0x6D_h: done.
                                                           
Executing secondary address command: 7B
                                       
stgc_0x7B_h: started FIND handler...
                                         

stgc_0x7B_h: received parameter:  2
                                         
searchForFile: searching /Adventure/...
                                       
searchForFile: found file 2
                                                   
searchForFile: done.
                                                         
/Adventure/2      ASCII   DATA [ADVSHOR  ]   20
                               
stgc_0x7B_h: found: 2      ASCII   DATA [ADVSHOR  ]   20
                     
stgc_0x7B_h: type:  D
                                                         
Executing secondary address command: 6D
                                       
stgc_0x6D_h: started INPUT handler...
                                         
stgc_0x6D_h: reading /Adventure/2      ASCII   DATA [ADVSHOR  ]   20...
       
You're in open forest near both a vstgc_0x6D_h: done.
                       
Executing secondary address command: 6D
                                       
stgc_0x6D_h: started INPUT handler...
                                         
stgc_0x6D_h: reading /Adventure/2      ASCII   DATA [ADVSHOR  ]   20...
       
valley and a road.
                                                             
 101
                                                                         
Ystgc_0x6D_h: done.
                                                           
Executing secondary address command: 6D
                                       
stgc_0x6D_h: started INPUT handler...
                                         
stgc_0x6D_h: reading /Adventure/2      ASCII   DATA [ADVSHOR  ]   20...
       
You're in open forest.
                                                         
 stgc_0x6D_h: done.
                                                           
Executing secondary address command: 6D
                                       
stgc_0x6D_h: started INPUT handler...
                                         
stgc_0x6D_h: reading /Adventure/2      ASCII   DATA [ADVSHOR  ]   20...
       
 101
                                                                         
Ystgc_0x6D_h: done.
                                                           

However - this loop does not finish.

I have gotten to loop2 of 38, then 79, then it just stopped before the loop2 began :(

 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #268 on: September 04, 2021, 08:15:59 pm »
And I just tried it again and loop 1 and 2 completed, but loop 3 stopped but Tek is still busy.

And I pressed BREAK several times and the Tek (or Emulator) must be hung.

Here is the debug log finishing loop2 and starting loop3:

Code: [Select]
Executing secondary address command: 6D
                                       
stgc_0x6D_h: started INPUT handler...
                                         
stgc_0x6D_h: reading /Adventure/2      ASCII   DATA [ADVSHOR  ]   20...
       
You're at ne end.
                                                             
 stgc_0x6D_h: done.
                                                           
Executing secondary address command: 6D
                                       
stgc_0x6D_h: started INPUT handler...
                                         
stgc_0x6D_h: reading /Adventure/2      ASCII   DATA [ADVSHOR  ]   20...
       
 33
                                                                           
Ystgc_0x6D_h: done.
                                                           
Executing secondary address command: 6D
                                       
stgc_0x6D_h: started INPUT handler...
                                         
stgc_0x6D_h: reading /Adventure/2      ASCII   DATA [ADVSHOR  ]   20...
       
You're at sw end.
                                                             
 stgc_0x6D_h: done.
                                                           
Executing secondary address command: 6D
                                       
stgc_0x6D_h: started INPUT handler...
                                         
stgc_0x6D_h: reading /Adventure/2      ASCII   DATA [ADVSHOR  ]   20...
       
 33
                                                                           
     EOF reached!
                                                             
stgc_0x62_h: started CLOSE handler...
                                         
stgc_0x62_h: closing: 2      ASCII   DATA [ADVSHOR  ]   20...
                 
stgc_0x62_h: done.
                                                           
stgc_0x6D_h: done.
                                                           
Executing secondary address command: 7B
                                       
stgc_0x7B_h: started FIND handler...
                                         

stgc_0x7B_h: received parameter:  3
                                         
searchForFile: searching /Adventure/...
                                       
searchForFile: found file 3
                                                   
searchForFile: done.
                                                         
/Adventure/3      ASCII   DATA [ADVMAP   ]   16
                               
stgc_0x7B_h: found: 3      ASCII   DATA [ADVMAP   ]   16
                     
stgc_0x7B_h: type:  D
                                                         
Executing secondary address command: 6D
                                       
stgc_0x6D_h: started INPUT handler...
                                         
stgc_0x6D_h: reading /Adventure/3      ASCII   DATA [ADVMAP   ]   16...
       
,2,2,5,5,3
                                                                     
,stgc_0x6D_h: done.
                                                           
Executing secondary address command: 6D
                                       
stgc_0x6D_h: started INPUT handler...
                                         
stgc_0x6D_h: reading /Adventure/3      ASCII   DATA [ADVMAP   ]   16...
       
,3,8,8,0,0
                                                                     
,stgc_0x6D_h: done.
                                                           
Executing secondary address command: 6D
                                       
stgc_0x6D_h: started INPUT handler...
                                         
stgc_0x6D_h: reading /Adventure/3      ASCII   DATA [ADVMAP   ]   16...
       
,3,3,6,6,1
                                                                     
,stgc_0x6D_h: done.
                                                           
Executing secondary address command: 6D
                                       
stgc_0x6D_h: started INPUT handler...
                                         
stgc_0x6D_h: reading /Adventure/3      ASCII   DATA [ADVMAP   ]   16...
       
,1,4,4,0,0
                                                                     
,stgc_0x6D_h: done.
                                                           
Executing secondary address command: 6D
                                       
stgc_0x6D_h: started INPUT handler...
                                         
stgc_0x6D_h: reading /Adventure/3      ASCII   DATA [ADVMAP   ]   16...
       
,5,5,1,1,4
                                                                     
,stgc_0x6D_h: done.
                                                           
 

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: Tektronix 4924 Tape Drive Emulator
« Reply #269 on: September 04, 2021, 08:19:59 pm »
That's interesting to note. It would affect the timing of things I suppose, but strange.
Will hopefully have some time to investigate things further tomorrow.
 

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: Tektronix 4924 Tape Drive Emulator
« Reply #270 on: September 06, 2021, 12:04:35 pm »
I have been making a bit of progress and the program now runs through all files without a problem, but I had to make a couple of modifications to the original program. There was en error in line 350 and line 450 needed an amendment. Here is the full program listing:

Code: [Select]
100 REM Adventure File 1
110 PRINT@5,19:"Adventure"
120 FIND@5:1
130 FOR J=1 TO 131
140 INPUT@5:A,B
150 NEXT J
160 PRINT "File 1 total: ", J-1, "pairs of numbers read"
200 REM Adventure File 2
220 FIND@5:2
230 FOR J=1 TO 114
240 INPUT@5:A$
250 INPUT@5:B
260 NEXT J
270 PRINT "File 2 total: ", J-1, "string/number pairs read"
300 REM Adventure file 3
320 FIND@5:3
310 REM Note empty var before comma = 6 vars
330 DIM K0(5)
340 FOR J=1 TO 228
350 INPUT@5:K0
360 NEXT J
370 PRINT "File 3 total: ",J-1, "groups of 5 numbers read"
400 REM Adventure file 4
410 T = 0
415 X = 0
417 Y = 0
418 Z = 0
420 FIND@5:4
430 FOR J=1 TO 38
440 INPUT@5:A$
450 NEXT J
460 X = J - 1
470 PRINT "File 4 sub-total: ", X, "statements read"
480 FOR J = 39 TO 76
490 INPUT@5:A
500 Y = Y + 1
510 NEXT J
520 PRINT "File 4 sub-total: ", Y, "numbers read"
530 FOR J = 77 TO 114
540 INPUT@5:A$
550 Z = Z + 1
560 NEXT J
570 PRINT "File 4 sub-total: ", Z, "items read"
580 T = X + Y + Z
590 PRINT "File 4 total: ", T, "lines read"
600 END

Naturally a bit more tweaking was required to the emulator code.

I also wanted to check something. This is an excerpt from file 3 of the adventure program:

Code: [Select]
,2,2,5,5,3
,3,8,8,0,0
,3,3,6,6,1
,1,4,4,0,0
,5,5,1,1,4
,4,2,2,0,0
,3,3,2,2,8
,8,5,5,0,0
,1,1,6,6,4
,4,3,3,0,0

Why does INPUT still treat this as 5 variables, not 6? Wouldn't the preceding comma imply a null variable in the first position? Setting K0 to 5 elements works, but setting it to 6 fails.
 
I have pushed up the updated code.
« Last Edit: September 06, 2021, 01:22:32 pm by WaveyDipole »
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #271 on: September 06, 2021, 01:30:28 pm »

I also wanted to check something. This is an excerpt from file 3 of the adventure program:

Code: [Select]
,2,2,5,5,3
,3,8,8,0,0
,3,3,6,6,1
,1,4,4,0,0
,5,5,1,1,4
,4,2,2,0,0
,3,3,2,2,8
,8,5,5,0,0
,1,1,6,6,4
,4,3,3,0,0

Why does INPUT still treat this as 5 variables, not 6? Wouldn't the preceding comma imply a null variable in the first position? Setting K0 to 5 elements works, but setting it to 6 fails.
 
I have pushed up the updated code.

Check out the 4050 BASIC Reference manual page 7-88 section on the INPUT command.

Every INPUT command brings in one ASCII string that is CR delimited.  Then Tek BASIC looks for the variable parameters in that INPUT statement.  If it cannot satisfy all the variables within that string - Tek BASIC will automatically issue another INPUT command.

Top of page 7-89 indicates ANY non-numeric characters preceding a numeric value are ignored.

That is why Tek BASIC finds 5 numeric variables in each ASCII string in file 3.

Monty
 

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: Tektronix 4924 Tape Drive Emulator
« Reply #272 on: September 06, 2021, 02:18:27 pm »
Ah, that makes sense. I would be interested to know how 0.05.37 works out on your 4054.
« Last Edit: September 06, 2021, 03:12:10 pm by WaveyDipole »
 

Offline mmcgraw74

  • Regular Contributor
  • *
  • Posts: 242
  • Country: us
Re: Tektronix 4924 Tape Drive Emulator
« Reply #273 on: September 06, 2021, 04:21:13 pm »
I have been trying v37 on my 4052 first.

I can't make it through your latest test program.  It stops at random INPUT statements, I run from that statement and it goes farther, but still can't complete the test after restarting a half-dozen or so times.

Also - the debug output of the actual file data is getting clobbered by CRLF.

I edited your v37 Store_Tek_4924.cpp debugStream statements in the INPUT command so I can see the data.

Line 757 - I added a new line after 757:
debugStream.print("\r ");

This prevents the CRLF of the line 757 println from clobbering the first two data characters in the RealTerm output.

I also changed the debugStream.println(F("receiver requested stop!")); and the ATN detected statement to print with trailing \r

Now - as an example the debug output looks like this.

Note that I intentionally added a space in front of the single data statements.
Sometimes the INPUT statement reads multiple strings without calling out "receiver requested stop" like the first INPUT in the trace below.
The printing of those subsequent data statements has no leading space - since there are not leading spaces in those files

Code: [Select]
Executing secondary address command: 6D
stgc_0x6D_h: started INPUT handler...
stgc_0x6D_h: reading /Adventure/4  ASCII   DATA [ADVITM   ]   12...
 There are fresh batteries here.
 Dead batteries are lying here.
A burly troll stands in front of you.
 A huge fierce green dragon bars the way!
A huge fierce green snake bars the way!
A 20-ton dead dragon lies here.
receiver requested stop!
stgc_0x6D_h: done.
Executing secondary address command: 6D
stgc_0x6D_h: started INPUT handler...
stgc_0x6D_h: reading /Adventure/4  ASCII   DATA [ADVITM   ]   12...
  18 receiver requested stop!
stgc_0x6D_h: done.
Executing secondary address command: 6D
stgc_0x6D_h: started INPUT handler...
stgc_0x6D_h: reading /Adventure/4  ASCII   DATA [ADVITM   ]   12...
  25 receiver requested stop!
stgc_0x6D_h: done.
Executing secondary address command: 6D
stgc_0x6D_h: started INPUT handler...
stgc_0x6D_h: reading /Adventure/4  ASCII   DATA [ADVITM   ]   12...
  23 receiver requested stop!
stgc_0x6D_h: done.
Executing secondary address command: 6D
stgc_0x6D_h: started INPUT handler...
stgc_0x6D_h: reading /Adventure/4  ASCII   DATA [ADVITM   ]   12...
  24 receiver requested stop!
stgc_0x6D_h: done.
Executing secondary address command: 6D
stgc_0x6D_h: started INPUT handler...
stgc_0x6D_h: reading /Adventure/4  ASCII   DATA [ADVITM   ]   12...
  21 receiver requested stop!
stgc_0x6D_h: done.
Executing secondary address command: 6D
stgc_0x6D_h: started INPUT handler...
stgc_0x6D_h: reading /Adventure/4  ASCII   DATA [ADVITM   ]   12...
  52 receiver requested stop!
stgc_0x6D_h: done.
Executing secondary address command: 6D
stgc_0x6D_h: started INPUT handler...
stgc_0x6D_h: reading /Adventure/4  ASCII   DATA [ADVITM   ]   12...
  0
 receiver requested stop!
stgc_0x6D_h: done.
------------Line 490 j=47
 Executing secondary address command: 73
stgc_073_h: started CD handler...
venturestgc_0x73_h: received directory name: Adventure
stgc_0x73_h: set directory name: /Adventure/
 stgc_0x62_h: started CLOSE handler...
stgc_0x62_h: closing: 4  ASCII   DATA [ADVITM   ]   12...
 stgc_0x62_h: done.
stgc_0x73_h: end CD handler.
 Executing secondary address command: 7B
stgc_0x7B_h: started FIND handler...
 
stgc_0x7B_h: received parameter:  1
 searchForFile: searching /Adventure/...
searchForFile: found file 1
searchForFile: done.
 /Adventure/1  ASCII   DATA [ADVKEYS  ]   8
stgc_0x7B_h: found: 1  ASCII   DATA [ADVKEYS  ]   8
stgc_0x7B_h: type:  D
Executing secondary address command: 6D
stgc_0x6D_h: started INPUT handler...
stgc_0x6D_h: reading /Adventure/1  ASCII   DATA [ADVKEYS  ]   8...
 1,133488
 receiver requested stop!
stgc_0x6D_h: done.
Executing secondary address command: 6D
stgc_0x6D_h: started INPUT handler...
stgc_0x6D_h: reading /Adventure/1  ASCII   DATA [ADVKEYS  ]   8...
 1,6771679
receiver requested stop!
stgc_0x6D_h: done.
Executing secondary address command: 6D
stgc_0x6D_h: started INPUT handler...
stgc_0x6D_h: reading /Adventure/1  ASCII   DATA [ADVKEYS  ]   8...
 2,36315
receiver requested stop!
stgc_0x6D_h: done.
Executing secondary address command: 6D
stgc_0x6D_h: started INPUT handler...
stgc_0x6D_h: reading /Adventure/1  ASCII   DATA [ADVKEYS  ]   8...
 2,8849417
receiver requested stop!
stgc_0x6D_h: done.
Executing secondary address command: 6D
stgc_0x6D_h: started INPUT handler...
stgc_0x6D_h: reading /Adventure/1  ASCII   DATA [ADVKEYS  ]   8...
 3,4673330


My 4054A couldn't get as far as the 4052.

In fact it had error 69 on the PRI@5,19:"adventure" directory command.
I had saved the test program to file 52 in the adventure directory, and manually accessed that directory and OLDed the program successfully.


After commenting out the directory line 110:

Upon running the program it always posted GPIB error 69 after reading two pairs.
I even added PRINT A,B and it printed the two pairs of numbers then posted a GPIB error 69.




« Last Edit: September 06, 2021, 04:25:36 pm by mmcgraw74 »
 

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: Tektronix 4924 Tape Drive Emulator
« Reply #274 on: September 07, 2021, 07:14:42 pm »
Ok, so not much progress on the 4052 and 4054.

I tried to do a little work on the MARK function today and got so far and the ran into a problem. Seems I can't create a new file on the SD for some reason.... If I can get this function done then I will have the elements for deleting, renaming and creating files that might be needed for other functions such as KILL and SAVE.

I am scratching my head as to what else to do with INPUT.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf