caramoan tour package

caramoan tour package

Author Topic: Automatic data transfer from hyperterminal to excel?  (Read 5784 times)

Offline zer0w1ng

  • Technical People
  • Gas Turbine
  • *****
  • Posts: 2179
  • Pogi/Ganda Points: 305
  • Gender: Male
  • Enter any 11-digit prime number to continue...
    • The Cebuano Geek
Re: Automatic data transfer from hyperterminal to excel?
« Reply #20 on: February 28, 2008, 06:06:35 PM »
Snippet from an old vb proj using mscomm.

Code: [Select]

Private Sub MSComm1_OnComm()
Dim t As String, i As Long, tline As String
    Select Case MSComm1.CommEvent
        Case comEvReceive:
            t = MSComm1.Input
            'ShowText t
            rxbuffer = rxbuffer & t
           
            Do While True
                'parse receive data here
                i = InStr(1, rxbuffer, vbCr)    'look for enter
                If i > 0 Then
                    tline = Mid(rxbuffer, 1, i)
                    rxbuffer = Mid(rxbuffer, i + 1)
                    ser_parse2 tline
                Else
                    Exit Do
                End If
            Loop
           
    End Select
End Sub


Private Sub connect_comm()
Dim t As Integer

On Error GoTo err

    m_busy = False
   
    'Debug.Print "Port:", CommPort
   
    If MSComm1.PortOpen = False Then
        t = CInt(Trim("0" & Mid(CommPort, 4)))
        Debug.Print "COM PORT: " & t
        With MSComm1
            .CommPort = t
            .Settings = "115200,n,8,1"
            .Handshaking = comNone
            .InBufferSize = 1024
            .OutBufferSize = 0
            .RThreshold = 1
            .SThreshold = 0
            .InputLen = 0
            .EOFEnable = False
            .NullDiscard = False
            .RTSEnable = True
            .DTREnable = True
            .PortOpen = True
        End With
    End If
   
    rxbuffer = ""
    'CmdReset_Click
   
    Exit Sub

err:
    MsgBox "Communications Error!"
    Exit Sub
End Sub

The Cebuano Geek

Philippine Electronics Forum

Re: Automatic data transfer from hyperterminal to excel?
« Reply #20 on: February 28, 2008, 06:06:35 PM »

Offline FliPhony

  • CR2032 Battery
  • **
  • Posts: 44
  • Pogi/Ganda Points: 0
  • Gender: Male
  • RelaX!
Re: Automatic data transfer from hyperterminal to excel?
« Reply #21 on: February 28, 2008, 09:12:14 PM »
Snippet from an old vb proj using mscomm.

Code: [Select]

Private Sub MSComm1_OnComm()
Dim t As String, i As Long, tline As String
    Select Case MSComm1.CommEvent
        Case comEvReceive:
            t = MSComm1.Input
            'ShowText t
            rxbuffer = rxbuffer & t
           
            Do While True
                'parse receive data here
                i = InStr(1, rxbuffer, vbCr)    'look for enter
                If i > 0 Then
                    tline = Mid(rxbuffer, 1, i)
                    rxbuffer = Mid(rxbuffer, i + 1)
                    ser_parse2 tline
                Else
                    Exit Do
                End If
            Loop
           
    End Select
End Sub


Private Sub connect_comm()
Dim t As Integer

On Error GoTo err

    m_busy = False
   
    'Debug.Print "Port:", CommPort
   
    If MSComm1.PortOpen = False Then
        t = CInt(Trim("0" & Mid(CommPort, 4)))
        Debug.Print "COM PORT: " & t
        With MSComm1
            .CommPort = t
            .Settings = "115200,n,8,1"
            .Handshaking = comNone
            .InBufferSize = 1024
            .OutBufferSize = 0
            .RThreshold = 1
            .SThreshold = 0
            .InputLen = 0
            .EOFEnable = False
            .NullDiscard = False
            .RTSEnable = True
            .DTREnable = True
            .PortOpen = True
        End With
    End If
   
    rxbuffer = ""
    'CmdReset_Click
   
    Exit Sub

err:
    MsgBox "Communications Error!"
    Exit Sub
End Sub


sir,

sa excel po b mismo mkikita ung ms comm?
"Success is never a destination - it is a journey"

Philippine Electronics Forum

Re: Automatic data transfer from hyperterminal to excel?
« Reply #21 on: February 28, 2008, 09:12:14 PM »

Offline zer0w1ng

  • Technical People
  • Gas Turbine
  • *****
  • Posts: 2179
  • Pogi/Ganda Points: 305
  • Gender: Male
  • Enter any 11-digit prime number to continue...
    • The Cebuano Geek
Re: Automatic data transfer from hyperterminal to excel?
« Reply #22 on: February 29, 2008, 08:19:29 AM »
sa excel po b mismo mkikita ung ms comm?
MsComm is an ActiveX object for UART communications for Visual Studio.
Install Visual Studio, use ver. 6 not the .NET version.

There are other ActiveX communications objects you could download also. But some of them are not free. You could use the time-limited versions though. Other comm objects are much easier to use than mscomm.

But I really think this is not the right solution your original problem.
As I said on my earlier post, just save/log the serial stream to a text file.
Then parse them in Excel after.

I could even help you parse it into CSV (comma separated Variables) if I know the stream format.
CSV is direcly downloadable in Excel.
The Cebuano Geek

Philippine Electronics Forum

Re: Automatic data transfer from hyperterminal to excel?
« Reply #22 on: February 29, 2008, 08:19:29 AM »

Offline FliPhony

  • CR2032 Battery
  • **
  • Posts: 44
  • Pogi/Ganda Points: 0
  • Gender: Male
  • RelaX!
Re: Automatic data transfer from hyperterminal to excel?
« Reply #23 on: February 29, 2008, 10:07:55 AM »
paran gnito po ung lumalabas na stream sa hyperterminal na gsto po sna nmin dalhin sa excel....

7179-717908234-234576238904-7179-717908234-234576238904

prang ganyan po sya. example ko lng po ung bnigay bnigay ko. nsa laptop po kc ng grupm8 ko ung data.


"Success is never a destination - it is a journey"

Philippine Electronics Forum

Re: Automatic data transfer from hyperterminal to excel?
« Reply #23 on: February 29, 2008, 10:07:55 AM »

Offline zer0w1ng

  • Technical People
  • Gas Turbine
  • *****
  • Posts: 2179
  • Pogi/Ganda Points: 305
  • Gender: Male
  • Enter any 11-digit prime number to continue...
    • The Cebuano Geek
Re: Automatic data transfer from hyperterminal to excel?
« Reply #24 on: February 29, 2008, 10:30:31 AM »
paran gnito po ung lumalabas na stream sa hyperterminal na gsto po sna nmin dalhin sa excel....

7179-717908234-234576238904-7179-717908234-234576238904

prang ganyan po sya. example ko lng po ung bnigay bnigay ko. nsa laptop po kc ng grupm8 ko ung data.


Ok. How is the stream processed or how do you like it columnize in Excel?
Like this?
Code: [Select]
Example
  A       B            C
7119   717908234   234576238904
7179   717908234   234576238904
The Cebuano Geek

Philippine Electronics Forum

Re: Automatic data transfer from hyperterminal to excel?
« Reply #24 on: February 29, 2008, 10:30:31 AM »

Offline FliPhony

  • CR2032 Battery
  • **
  • Posts: 44
  • Pogi/Ganda Points: 0
  • Gender: Male
  • RelaX!
Re: Automatic data transfer from hyperterminal to excel?
« Reply #25 on: February 29, 2008, 03:05:41 PM »
i think sa isang column lng po..

7179
7878
7179
7878
"Success is never a destination - it is a journey"

Offline FliPhony

  • CR2032 Battery
  • **
  • Posts: 44
  • Pogi/Ganda Points: 0
  • Gender: Male
  • RelaX!
Re: Automatic data transfer from hyperterminal to excel?
« Reply #26 on: February 29, 2008, 03:06:54 PM »
sorry for the late reply..
"Success is never a destination - it is a journey"

Offline zer0w1ng

  • Technical People
  • Gas Turbine
  • *****
  • Posts: 2179
  • Pogi/Ganda Points: 305
  • Gender: Male
  • Enter any 11-digit prime number to continue...
    • The Cebuano Geek
Re: Automatic data transfer from hyperterminal to excel?
« Reply #27 on: February 29, 2008, 03:23:08 PM »
What about these numbers?
717908234-234576238904-

Is this included in the column?

This is easy to make, the parser done by just to replacing "-" to CRLF then the file is ready for excel.
The Cebuano Geek

Offline FliPhony

  • CR2032 Battery
  • **
  • Posts: 44
  • Pogi/Ganda Points: 0
  • Gender: Male
  • RelaX!
Re: Automatic data transfer from hyperterminal to excel?
« Reply #28 on: February 29, 2008, 03:27:39 PM »
172231572-2059-269233035024677-613623649210451722315722-6155-2                                                                               
69233038224677-101623649184885173234132-6155-269233038224677-1016236491848851732                                                                               
34132-6155-269233038224677-101623649184885173234132-6155-269233038224677

sir e2 po ung data na nkukuha nmin sa hyperterminal..

e2 po ung ilalagay nmin sa excel n nsa isang column lng po.. khit sa column "A" lng..

"Success is never a destination - it is a journey"

Offline FliPhony

  • CR2032 Battery
  • **
  • Posts: 44
  • Pogi/Ganda Points: 0
  • Gender: Male
  • RelaX!
Re: Automatic data transfer from hyperterminal to excel?
« Reply #29 on: February 29, 2008, 03:29:33 PM »
2059-269233035024677-613623649210451722315722-6155-2                                                                               
69233038224677-101623649184885173234132-6155-269233038224677-1016236491848851732                                                                             
34132-6155-269233038224677-101623649184885173234132-6155-269233038224677


e2 po pala..may sobra po dun sa nauna eh..
"Success is never a destination - it is a journey"

Offline zer0w1ng

  • Technical People
  • Gas Turbine
  • *****
  • Posts: 2179
  • Pogi/Ganda Points: 305
  • Gender: Male
  • Enter any 11-digit prime number to continue...
    • The Cebuano Geek
Re: Automatic data transfer from hyperterminal to excel?
« Reply #30 on: February 29, 2008, 03:33:49 PM »
A quick code of the parser in python:
Code: [Select]
#!/usr/bin/python

import sys

s = sys.stdin.read()
ls = s.split('-')

for line in ls:
        print line;

Open a text file and save as "parse.py"
Download python.

To run this just type: "python parse.py < saved_log.txt > output.txt"

The "output.txt" file can be loaded directly to excel. And values will be in column "A".

This just basically transforms "-" to crlf.

The Cebuano Geek

Offline FliPhony

  • CR2032 Battery
  • **
  • Posts: 44
  • Pogi/Ganda Points: 0
  • Gender: Male
  • RelaX!
Re: Automatic data transfer from hyperterminal to excel?
« Reply #31 on: February 29, 2008, 04:02:19 PM »
sir e kung sa python n po kmi kya mg plot, pwede kya un?

 :'(
"Success is never a destination - it is a journey"

Offline zer0w1ng

  • Technical People
  • Gas Turbine
  • *****
  • Posts: 2179
  • Pogi/Ganda Points: 305
  • Gender: Male
  • Enter any 11-digit prime number to continue...
    • The Cebuano Geek
Re: Automatic data transfer from hyperterminal to excel?
« Reply #32 on: February 29, 2008, 04:26:33 PM »
Pwede.

You need wxpython for the gui. It may not be easy on your part.

Better stick to excel for now.
The Cebuano Geek

Offline FliPhony

  • CR2032 Battery
  • **
  • Posts: 44
  • Pogi/Ganda Points: 0
  • Gender: Male
  • RelaX!
Re: Automatic data transfer from hyperterminal to excel?
« Reply #33 on: February 29, 2008, 05:12:12 PM »
i think so sir, we need dis tomorrow eh, badly needed n lng po tlaga eh..

nghahanap n din po kmi ng software ng python, kso d po kmi mkita eh..

my alam po b kau kng san nmin mkakuha ng free....?

 :(
"Success is never a destination - it is a journey"

Offline zer0w1ng

  • Technical People
  • Gas Turbine
  • *****
  • Posts: 2179
  • Pogi/Ganda Points: 305
  • Gender: Male
  • Enter any 11-digit prime number to continue...
    • The Cebuano Geek
Re: Automatic data transfer from hyperterminal to excel?
« Reply #34 on: February 29, 2008, 05:21:53 PM »
python is always FREE and open-source  :) .
http://www.python.org
The Cebuano Geek

Offline zer0w1ng

  • Technical People
  • Gas Turbine
  • *****
  • Posts: 2179
  • Pogi/Ganda Points: 305
  • Gender: Male
  • Enter any 11-digit prime number to continue...
    • The Cebuano Geek
Re: Automatic data transfer from hyperterminal to excel?
« Reply #35 on: February 29, 2008, 05:33:26 PM »
Parser in C.
Code: [Select]
#include <stdio.h>

int main(void)
{
    int c;

    while ((c=getc(stdin))!=EOF)
    {
       if (c=='-')
       {
          putchar('\r');
          putchar('\n');
       }
       else
          putchar(c);
    }

}

Compile and then run as: "parser < saved_data_log.txt > output.txt"
The Cebuano Geek

Offline FliPhony

  • CR2032 Battery
  • **
  • Posts: 44
  • Pogi/Ganda Points: 0
  • Gender: Male
  • RelaX!
Re: Automatic data transfer from hyperterminal to excel?
« Reply #36 on: February 29, 2008, 05:53:31 PM »
tnx po...

salamat po sa mga tumutulong sa amin... :)

sir try po muna uit nmin, ngloko po bla ug hrdware nmin eh....

 :(
"Success is never a destination - it is a journey"

Offline zer0w1ng

  • Technical People
  • Gas Turbine
  • *****
  • Posts: 2179
  • Pogi/Ganda Points: 305
  • Gender: Male
  • Enter any 11-digit prime number to continue...
    • The Cebuano Geek
Re: Automatic data transfer from hyperterminal to excel?
« Reply #37 on: February 29, 2008, 07:04:07 PM »
tnx po...

salamat po sa mga tumutulong sa amin... :)

sir try po muna uit nmin, ngloko po bla ug hrdware nmin eh....

 :(

You're welcome.
Good luck on your project!
The Cebuano Geek

Offline Siramiko

  • Lead Acid Battery
  • *******
  • Posts: 797
  • Pogi/Ganda Points: 35
  • thank you elab
Re: Automatic data transfer from hyperterminal to excel?
« Reply #38 on: February 29, 2008, 07:36:00 PM »
tnx po...

salamat po sa mga tumutulong sa amin... :)

sir try po muna uit nmin, ngloko po bla ug hrdware nmin eh....

 :(
pasyal ka dito http://www.electronicslab.ph/forum/index.php?topic=641.0 pag okey na ang project mo  :)
I shall return

Offline andromeda30

  • CR2032 Battery
  • **
  • Posts: 36
  • Pogi/Ganda Points: 0
Re: Automatic data transfer from hyperterminal to excel?
« Reply #39 on: January 19, 2011, 01:19:38 AM »
nagamit ko sa C# .NET (pwede rin sa VB.net) using COM objects... yung data na dumeretcho sa excel... may serialport class na din ang .NET... possible yan...

Ms. 7, parang ikaw na makakatulong talaga samin sa aming project..like sa gsm module sim 900D ..hehe... Ms. 7, meron kaba code for C#, we'r still learning the C# as our elective course and we know its possible for plotting... pwede po ba ako mag ask sa program nyo Ms. 7..i paplot din kasi namin yung data namin from the hyperterminal eh...thank you po Ms. 7...

Philippine Electronics Forum

Re: Automatic data transfer from hyperterminal to excel?
« Reply #39 on: January 19, 2011, 01:19:38 AM »

 

Privacy Policy

Contact Us: elabph@yahoo.com