RS232 Scope V1.02

Serial Data Capture with Microsoft Excel 97 on Windows 95/98/ME/NT


Table of Contents [Toc]

   Supported Operating Systems
Input data format
Major extracts
Available resources

Concept   [Toc] [Top]

This Excel Worksheet has been designed to visualize data sent from microcontrollers in a very convenient way.
There are the following advantages:

The Worksheet activates a Visual Basic macro, which opens the specified ComPort and reads data as long as specified in the drop-down menu "Duration". The "sampling time" can be selected in the drop-down menu "Interval".
At the end of each interval, the macro calculates the average of all data received during this interval. Afterwards, the graph is updated automatically.

The data transmitted is enclosed by a frame: A Frame-Header (TX) and a Frame-Tail (/T) ensure, that the data is identified properly. At the moment, there is no automatic resynchronisation built in, but the tests showed, that there is no urgent need for that.
Maybe this feature will be necessary, if longer data streams are transmitted within one frame.

The software has been tested under Windows 95 - Excel 97 on a Pentium I 166 MHz, and under Windows 98 - Excel 97 on a Pentium III 500 MHz and an Athlon 700 MHz.
The transmitted pattern comes from a 16 bit table implemented in a PIC16C84 and was transmitted with the m_rs096.asm. The table has been generated with the "Automatic Table Generator for MPLAB Assembler".
The assembler source code for the test pattern is available under projects / 16 bit table read.

Supported Operating Systems   [Toc] [Top]

According to the DLL author: Win95, Win98, WinMe, WinNT

Unfortunately, it does not run on WinXP
The RS232 driver DLL (RSAPI_70.DLL) can not successfully open the ComPort on WinXP (although it is designed to run also on Win NT). I tried hard, but this DLL does not succeed on WinXP. If someone knows/is able to write a nice RS232 DLL running also on WinXP, I would be very graceful - and I assume a lot of other people too...

But recently, I obtained a different version of the RSAPI.DLL for WinXP, which you can download and try yourself. I've named it RSAPI_71.DLL, you can rename it to RSAPI_70.DLL and install it in your WinXP C:\WINDOWS\system32\ directory. The Visual Basic sources refer currently to the name RSAPI_70.DLL, but you can change this, if desired.

I haven't had enough free resources to test it thoroughly so far...

Input Data Format   [Toc] [Top]

Major Extracts of Visual Basic Source Code   [Toc] [Top]

Current configuration, in Visual Basic module 'Data_Fetch':

Option Explicit            'force explicit variable declaration
Private Const sheet1 As String = "RS232-Scope"
Private Const sheet2 As String = "RS232-Data"
Private Const FrameHeader As String = "TX"
Private Const FrameTail As String = "/T"
Private Const FrameLength As Byte = 6

Data acquisition & processing, in Visual Basic module 'Data_Fetch':

'check if data is valid: 
If Mid$(RecString, 1, 6) <> "Fehler" Then 
  'check if frame header is correct: 
  If Mid$(RecString, 1, 2) = FrameHeader And Mid$(RecString, 5, 2) = FrameTail Then 
    HI = Asc(Mid$(RecString, 3, 1))          'extract HI Byte 
    ThisWorkbook.Sheets(sheet1).HiByteBox.Text = HI 
    LO = Asc(Mid$(RecString, 4, 1))          'extract LO Byte 
    ThisWorkbook.Sheets(sheet1).LoByteBox.Text = LO 
    value = value + 256 * HI + LO 
    n = n + 1 
    ErrorString = "No data with valid frame." 
  End If 
  ErrorString = "No data input on serial port." 
End If


Available Resources   [Toc] [Top]

  Item Size File
RS232 Scope V1.02     (Excel 97 Worksheet) 156 kB
ComCtl drivers, if they are missing in Win9x and Windows complains (located in C:\windows\system\: comctl32.dll, comctl32.ocx, comctllib.twd)  568 kB


Last updated: 08.11.2005

[Toc] [Top]

If you see only this page in your browser window,
click here
to get the entire site.