Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Event log analyzing tool

2005-04-26 by Alex Rodriguez

Hey,

what about Labview? I have done some nice DSO in the
past using serial/parallel/USB and works really
well... obviously you need to place big bucks to get
that kind of software...

alex.


--- Varuzhan Danielyan <dan@...> wrote:

> Hello!
> 
> Here is the link
>
http://www.edaboard.com/viewtopic.php?t=115101&highlight=excel
> but I want to warn you, that first you have to
> register, and, maybe wait
> some time for Free Mirror, or active take part in
> discussions, to earn
> some points for download.
> The requirements for Excel and how to make a user
> form with the
> MSComm communication module in Excel'c VBA one can
> find in the
> book.
> My code is very simple, so I decided to put it
> directly into this message.
> See it below with some notes.
> If somebody succeed in this way with the better
> functionality, I will be
> very interested to know about his results.
> Best wishes,
> 
> Varuzhan
> 
> Module 1 code:
> 
>  Public ADCCode As Integer
>  Public Evens As Integer
>  Public Ch As Byte
>  Public Buffer As Variant
> 
> 
> Sub DataAcquisition()
> 
>   Sheets("Sheet1").Select
> 
>   Dim i As Integer
>   'UserForm1.InBufferSize = 8192
>   UserForm1.MSComm1.CommPort = 4
>   UserForm1.MSComm1.PortOpen = True
>   UserForm1.MSComm1.Handshaking = comNone
>   UserForm1.MSComm1.Settings = "115200,N,8,1"
>   'set for 115200 baud, no parity, 8 bits, 1 stop
> bit
>   UserForm1.MSComm1.InputMode = comInputModeBinary
>   'binary data returned in variant array
>   UserForm1.MSComm1.InputLen = 1
>   'set to one character when read by Input
>   UserForm1.MSComm1.RThreshold = 0
>   'number of characters to receive before
>   'generating on comm event
>   UserForm1.MSComm1.DTREnable = True
>   UserForm1.MSComm1.RTSEnable = False
> 
>   UserForm1.MSComm1.InputLen = 1
>   'transfer all received bytes when read
>   UserForm1.MSComm1.RThreshold = 0
>   'interrupt after 1 byte
> 
>   ADCCode = 0
> 
>   While bEndFlag = False
>     DoEvents
> 
>     If UserForm1.MSComm1.InBufferCount > 0 Then
> 
>       Buffer = UserForm1.MSComm1.Input
> 
>       Ch = CByte(Buffer(0))
>       If (Ch >= 48) And (Ch < 58) Then
>         ADCCode = (10 * ADCCode) + Ch - 48
>       ElseIf Ch = 13 Then
>         ADCCode = ADCCode + 2
>         Events = Events + 1
>         Cells(1, 1) = Events
>         Cells(ADCCode, 1) = Cells(ADCCode, 1) + 1
>         ADCCode = 0
>       End If
> 
>     End If
>   Wend
> End Sub
> 
> Sub ForceStop()
>   'UserForm1.MSComm1.RThreshold = 0
>   'disable interrupts- sometimes the click happens
>   'while the inrerrupt is being serviced
>   'if this isn't here the click may have no effect
>   'in those circustances
>   UserForm1.MSComm1.PortOpen = False
>   'close the port
>   Sheet1.cmdStart.Enabled = True
>   Sheet1.cmdStop.Enabled = False
>   bEndFlag = True
> 
> End Sub
> 
> Private Sub Workbook_Open()
> Sheet1.cmdStart.Enabled = True
> Sheet1.cmdStop.Enabled = False
> End Sub
> 
> UserForm1 Code:
> 
> Private Sub MSComm1_OnComm()
> 
> Static ADCCode As Integer
> Static Ch As Byte
> Static Buffer As Variant
> 
>   Select Case MSComm1.CommEvent
>     Case comEvReceive
> 
>       Buffer = MSComm1.Input
> 
>       Ch = CByte(Buffer(0))
>       If (Ch >= 48) And (Ch < 58) Then
>         ADCCode = (10 * ADCCode) + Ch - 48
>       ElseIf Ch = 10 Then
>         Cells(1, 1) = ADCCode
>         Cells(ADCCode + 2, 1) = Cells(ADCCode + 2,
> 1) + 1
>         ADCCode = 0
>       End If
> 
>     Case Else
>   End Select
> 
> End Sub
> 
> Private Sub UserForm_Click()
> 
> End Sub
> 
> Notes:  The readout code in the OnComm() newer
> works, because
> I assign 0 to the  UserForm1.MSComm1.RThreshold.  I
> gust preserve
> it for eperiments.
> It is strange, but the interrupt driven (I suppose)
> code in the OnComm()
> function works much more slowly, than the same code
> being polled in the
> Module 1.
> 
> 
> 
> ----- Original Message ----- 
> From: "Michael Anburaj" <embeddedeng@...>
> To: <lpc2000@yahoogroups.com>
> Sent: Tuesday, April 26, 2005 2:27 AM
> Subject: Re: [lpc2000] Event log analyzing tool
> 
> 
> >
> > Great!
> >
> > Thanks a lot Robert & Varuzhan for sharing these
> info.
> > with me. Now I need to try them.
> >
> > Varuzhan,
> > Could you also send me a link for this ebook? And
> if
> > possible more info. on your work.
> >
> > Thanks a lot & have a nice evening,
> > -Mike.
> >
> > --- Varuzhan Danielyan <dan@...> wrote:
> > > To the Robert's advice to use a spreadsheet I
> want
> > > to add, that Excel can
> > > be used even on-line, to read and visualize (as
> a
> > > scope) the data directly from
> > > ports, both COM and LPT.  This is described in a
> > > very nice book of Aubrey Kagan "Excel by
> Example",
> > > which is available also
> > > as e-book on www.edaboard.com site.
> > > I have used this feature of Excel to make a very
> > > simple, but very efficient
> > > multichannel pulse width analyzer, which
> consists of
> > > a Keil MCB2100
> > > evaluation board, direct serial port cable and
> PC.
> > > The Keil board sends
> > > data through its COM0 port and Excel reads and
> shows
> > > the spectrum in
> > > real time.
> > >
> > > Varuzhan
> > >
> > >   ----- Original Message ----- 
> > >   From: Robert Adsett
> > >   To: lpc2000@yahoogroups.com
> > >   Sent: Monday, April 25, 2005 9:09 PM
> > >   Subject: Re: [lpc2000] Event log analyzing
> tool
> 
=== message truncated ===


----
Regards,
Alex Rodriguez

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.