Problem and Solution running QB45 Program on

Transcription

Problem and Solution running QB45 Program on
Problem and Solution running QB45 Program on Windows 7 Dec. 17, 2011 By D. Michael Bailey Having written a program to test the C/MRI DOUT 32 and DIN32 I/O boards it was discovered that the output test worked correctly. However the input test would not run due to multiple errors and maximum retries. Figure 1 shows the test environment. This notebook uses Windows 7 for its OS. Fig 1 The C/MRI “USER’S MANUAL” version 3.1 includes an input test called “SUSIC INPUT DISPLAY PROGRAM”, which is named fig13‐9. It was compiled, launched, and the same generation of multiple input errors occurred. These are shown via screen shot in figure 2. Fig 2 1 At this point the USB to Serial port converter was in question. So a temporary serial cable was made up to stretch from an older desktop PC running under Win XP was made. This PC also contains a motherboard COM1 port, which would answer the question about the USB/Serial port. The input test fig13‐9 was launched on this computer with the same resulting errors. Don Wood at Easee Interfaces was telephoned. He said that the SUSIC RS232 IC was probably OK and that the issue was likely due to the Windows OS interfering with the QB45 DOS window communication with the COM port. He suggested downloading a program named DOSBox, which he heard people were using successfully to run QB45 programs. I did and it did, Thank you Don! Now a few details on using DOSBox. Looking at the directory containing DOSBox.exe program reveals a number of helpful documents. This directory is shown in figure 3. Fig 3 The document with the highlighted bar is named dosbox and is the configuration file for DOSBox. It can be opened and edited with Windows’ “Notepad”. Near the bottom of the file is the area that needs to be edited in order for DOSBox to communicate with the PC’s serial COM port. This is shown in figure 4. 2 Fig 4 The # symbols indicate comment statements. Therefore the line that must be changed did read “serial1=disabled”. It was changed as shown above to “serial1=directserial realport:COM1” If the above edit is not done to the configuration document then the last line displayed in the DOSBox Status Window will not be seen, and the program that is eventually launched in the DOSBox window will not communicate with the PC’s serial port. Now when DOSBox is launched the Status Window for DOSBox and its program windows appear as shown in figure 5. Notice the last line in the status window shows “Serial1: Opening COM1. Another possible change to the configuration file is setting the DOSBox window to open as a full screen display. This should not be done until the QB45 program is running perfectly in the small window size. 3 Fig 5 The next important procedure to follow is to point DOSBox to the directory containing the QB45 program that is to be run. This process is just three steps. 1. Type “mount c C:\(directory path)” enter key or (CR). 2. Type “C:”(CR). If DIR/p is typed in all the files in the target directory will be displayed. 3. Type the name of the QB45 program to run (CR). Note the program to run can be any *.exe program, i.e. a favorite DOS game. These steps are shown in figure 6. 4 Fig 6 When any key is pressed the program continues and begins monitoring the input bits on the first DIN32 and sending related output bits to the first DOUT32 board. The DOSBox status and program windows are shown in figure 7 after the space bar was pressed. Note The DOSBox Status Window is a very nice tool in that it provides feedback concerning the status of communication between the QB45 program and the COM serial port. This can be seen in figure 7 as the program was running successfully. This feature was useful in adjusting the DL parameter for 'USIC TRANSMISSION DELAY’ in the fig13‐9.bas program, which is discussed on the next page. 5 Fig 7 Initially the QB45 program did not work even in DOSBox because the Framing errors were in the 400 to 1000 range. The fig13‐9.bas program was edited with the following change. (Also the I/O board configurations and the total number of each type of port was modified.) REM**INITIALIZE SUSIC UA = 0 'USIC NODE ADDRESS COMPORT = 1 'PC COM PORT = 1, 2, 3 or 4 BAUD100 = 96 'BAUD RATE OF 9600 DIVIDED BY 100 DL = 500 'USIC TRANSMISSION DELAY The DL value was increased in steps of 100, compiled, and launched in DOSBox until the Framing errors were low enough that the C/MRI input error traps stopped tripping. It appears Framing errors below 200 are OK at 9600 BAUD with the C/MRI serial hardware. 6 Once the DL was satisfactory then all the first DIN32 bits were reflected by the corresponding LED glowing on the first DOUT32 bits with the program displaying the bit changes. This was accomplished with the modified connectors and grounded test lead attached to one input at a time as shown in figures 8 through 11. Fig 8 Fig 9 7 Fig 10 Fig 11 8 To complete the testing of the QB45 test program, the fig13‐9.exe program was launched without DOSBox to determine if the DL parameter adjustment was the only fix needed for the input problem. It was discovered that it will now run but with multiple maximum retry errors. This is show in figure 12. Fig 12 It was also observed that the LEDs on the output card occasionally were turned on with no grounding of inputs on the DIN32 card. My conclusion is that DOSBox is a much safer environment to run QB45 programs in when Windows 7 is the OS. 9