Shop OBEX P1 Docs P2 Docs Learn Events
How do you transfer data from a prop tp a pc file/excel? — Parallax Forums

How do you transfer data from a prop tp a pc file/excel?

swampie777swampie777 Posts: 33
edited 2009-10-07 20:22 in Propeller 1
The title ask it all. I am measuring data with a prop and wish to send to to a pc file. Hyperterminal aint too hyper. Tera term is similar. Any help is appreciated.

Thanks,

Swampie

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2009-10-05 22:45
    IIRC, Ariba's Prop Terminal has a capture option.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade, RetroBlade,·TwinBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80) , MoCog (6809)
    · Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • localrogerlocalroger Posts: 3,452
    edited 2009-10-05 22:50
    I use terminal.exe from Windows 3.1 for this. Even though it's the old API and only knows com1-com4, it is much more stable and reliable than hyperterminal, and the text capture and send functions work very well.

    Unfortunately, there aren't any good standard methods of just hitting transfer and making it go over serial; everything requires setup and a coordinated start at both ends. I'd probably consider putting a SD card on the system and using fsrw to write the data, and physically transfer the SD card to the PC at upload time.
  • RaymanRayman Posts: 14,853
    edited 2009-10-05 22:54
    I posted some YMODEM code a while ago that will send data to hyperterminal as a file...
    I think that's really the easiest and most reliable way...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • jazzedjazzed Posts: 11,803
    edited 2009-10-05 23:54
    swampie777 said...
    The title ask it all. I am measuring data with a prop and wish to send to to a pc file. Hyperterminal aint too hyper. Tera term is similar. Any help is appreciated.

    Thanks,

    Swampie
    Propalyzer will let you export captured data to a .txt file. The date is just a list of hexadecimal longs one long per line. You could use Hanno's Viewport to put data into an excel application for a price.
  • HannoHanno Posts: 1,130
    edited 2009-10-06 00:22
    Thanks for the referral jazzed- busy day for both of us today! (Separate question- what gave you problems porting Propalyzer to Mono? My limited experiments suggest that apart from Propellent, it shouldn't be bad- so far I've gotten ViewPort/PropScope/12Blocks to at least show up natively on Ubuntu with Mono.net... Lots of path fixing and testing to go)

    Ok, back on topic- data from Propeller to Excel/File with ViewPort.
    ViewPort gives you a 2mbps connection to share data from the Propeller to the PC program. You can combine different types of data- for example, arrays, variables, streaming video, and samples of the IO pins. The connection is full-duplex, so you can also change data on the Propeller from the PC's side- using intuitive controls like dials, sliders, and textboxes. ViewPort gives you lots of tools to analyze your data, but can also save data to files in .txt, .csv, and even matlab. It can "stream" the data, where it saves it to file periodically. It can also periodically call an application, so you could script things together. And, it can upload your files periodically to an ftp server...

    ViewPort also acts as a DDE server, so to get the value of a variable into an Excel cell, you just have to type a formula- like this: "=vp!get|rpm" This will continually stream the value of the "rpm" variable into your cell- where it can then be used for calculations or live graphs. There's a client kit for ViewPort that has samples that show how to read/write data from the Propeller for vb.net, c#, matlab, excel, and python.

    If you want to read more about ViewPort, check out this review from Robot magazine: www.parallax.com/Portals/0/Downloads/docs/article/ROBOT_ViewPort.pdf
    Or, just download the free eval from my signature...
    Enjoy!
    Hanno

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Download a free trial of ViewPort- the premier visual debugger for the Propeller
    Includes full debugger, simulated instruments, fuzzy logic, and OpenCV for computer vision. Now a Parallax Product!
  • ElectricAyeElectricAye Posts: 4,561
    edited 2009-10-06 02:43
    Has anyone mentioned the PLX-DAQ?

    I think it's still free.

    www.parallax.com/tabid/393/Default.aspx

    I played with it a year or so ago but moved to recording on SD cards (and then transferring data to the PC by plugging the SD card into the computer).

    hope that helps,
    Mark
  • edited 2009-10-06 02:58
    One more for the list: Display numbers as text separated by commas in the Parallax Serial Terminal then copy/paste into a .txt file. Then import into Excel as comma delimited.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Andy Lindsay

    Education Department
    Parallax, Inc.
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-10-06 03:54
    What happened to the good ole days?

    MODE COM1:9600,N,8,1
    CTTY COM1
    
    



    That used to be all you needed to do to take an external RS232 'feed' and re-route it as if it were being typed directly on the console.

    MODE still works, but Microsoft removed CTTY ... bummer

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • jazzedjazzed Posts: 11,803
    edited 2009-10-06 06:32
    Hanno said...
    (Separate question- what gave you problems porting Propalyzer to Mono? My limited experiments suggest that apart from Propellent, it shouldn't be bad- so far I've gotten ViewPort/PropScope/12Blocks to at least show up natively on Ubuntu with Mono.net... Lots of path fixing and testing to go)
    All the widgets work perfectly as far as I can tell (I'm using the latest mono from badgerports for Hardy Heron). Everything also loads/builds/runs fine with MonoDevelop except for a few inconsequential warnings (I miss the VS GUI tools and debugger though). Amazingly, even the registry database features work.

    The biggest problem is related to serial port operation ... mono.net does not generate "events" which I use for data receive. I was able to use a Thread to poll and collect data on Windows, but that approach utterly failed when I tried it on mono. I have never seen a linux box freeze so badly. I'm thinking about creating a network/port server to solve the problem.

    I've considered creating a shell script that calls bstc to handle the Propellent business with System.Diagnostic.blah. I use bstc for debug symbols and fast compile all the time. The bst with a good font choice and bstc tools are truly superior to the Propeller Tool and loader.

    We can take this off line or otherwise if you want to chat in more detail.
  • RaymanRayman Posts: 14,853
    edited 2009-10-06 09:34
    Ok, well Andy points out the actual "easiest" way...
    Andy Lindsay (Parallax) said...
    One more for the list: Display numbers as text separated by commas in the Parallax Serial Terminal then copy/paste into a .txt file. Then import into Excel as comma delimited.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
  • HannoHanno Posts: 1,130
    edited 2009-10-07 03:03
    Jazzed,
    Your "private messages" is disabled and I can't easily find your email- but would like to compare notes on porting .net using mono. Feel free to pm me or gmail- I'm hsander.
    Hanno

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Download a free trial of ViewPort- the premier visual debugger for the Propeller
    Includes full debugger, simulated instruments, fuzzy logic, and OpenCV for computer vision. Now a Parallax Product!
  • SamMishalSamMishal Posts: 468
    edited 2009-10-07 05:08
    Hi Swampie,

    I you can program and can adapt example code then read this document which has
    4 programs that show how to do what you want.
    http://www.robotbasic.org/resources/RobotBASIC_To_PropellerChip_Comms.pdf

    The programs do not show how to save the data to a file but it is EASILY done
    with a few extra lines of code. If you want me to show you how I can do so
    but reading the help file of the programming language should be enough if you
    can program.

    If you give me template SPIN program that shows what the data is and how
    you want it to be in the Excel sheet I can make a program for you to start with
    and modify as needed.

    To download the programming language go to www.RobotBASIC.com


    Regards

    Samuel
    ·
  • ErNaErNa Posts: 1,752
    edited 2009-10-07 05:36
    Good morning,
    I also like to talk about "good ole times", but they are gone. We just should do, what we could do then. What about having a little framework on PC-side, that just works as a server in waiting for commands from the propeller and mapping them to very basic operation system functions, like file-I/O. We could use C-like commands, for example.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    cmapspublic3.ihmc.us:80/servlet/SBReadResourceServlet?rid=1181572927203_421963583_5511&partName=htmltext
    Hello Rest Of The World
    Hello Debris
    Install a propeller and blow them away wink.gif
  • SamMishalSamMishal Posts: 468
    edited 2009-10-07 06:23
    ErNa said...
    I also like to talk about "good ole times", but they are gone. We just should do, what we could do then. What about having a little framework on PC-side, that just works as a server in waiting for commands from the propeller and mapping them to very basic operation system functions, like file-I/O. We could use C-like commands, for example.
    Again at the risk of sounding quite pushy.....if you can program you can do this in ANY language available for a PC.

    BUT.....if you would like a very EASY IDE and language (interpreter/compiler) for doing this with ALL that you need to do it in a VERY simple
    language try RobotBASIC· (www.RobotBASIC.com) see the document I mention in my previous posting for an example for how to do it.

    ALSO...see this posting for a CONCRETE example.· http://forums.parallax.com/showthread.php?p=846138

    If you are programming SPIN and/Or PBASIC RobotBASIC will be VERY easy for you to figure out. EVEN IF you are C++
    or Java programmer you will find that RobotBASIC can achieve things with a LOT LESS EFFORT than would be required
    using these languages, and Even Python. I am not very familiar with Perl and I have been surprised at some things that
    can be done in Perl so I would not comment on Perl.

    As an example I am going to describe a thing I did not too long ago and I will give the RobotBASIC program that achieved
    the solution.

    I have multiple computers that I use and I have various development environments on them. IT gets so that I may work on
    one computer for a few days and then I may work on the other for other days.

    For Parallax stuff for example I have all things under a directory called Parallax Inc and this directory has numerous sub-directories
    with files in each but also with sub-sub and even sub-sub-sub and so forth directories. This directory TREE·is similar on all machines.

    The problem is that as I work on one computer I may do some programs, or download some things. I may reorganize and
    create new directories, but not the same on the other computer, and things get out od SYNCH.

    Often these changes are minimal and I can duplicate the changes by hand on ALL other computers. BUT....more often my memory
    fails (old age) and also I get lazy and so the files on the computers get out of SYNCH and I end up with sub-directories that are not
    on the other computer or NEWER files, or files that are on one computer but not the others etc.

    I tried windows SYNCHRONIZE FILES.....but....it did not do it for me....it more often than not missed files and directories and
    did not quite do the job. ALSO.....I needed a REPORT to figure out what changes there are etc.

    What I needed was a program that can take the two Parallax Inc folders from two computers and MERGE them. So that MERGED
    Parallax Inc would have all sub-directories and sub-sub....
    · 1- When there is a sub-directory that is in one but not the other then create it in the final merge.
    · 2- If there is a file that is in both then copy only the newer one.
    · 3- Preserve the directory TREE (merged or grafted).

    Also I wanted the program to report on what it did for example
        124 Directories were merged with 583,113,521 Bytes in 1,267 Files.
          1 Files were newer in one source than the other (ones with  *)
        114 Files were in one source but not the other    (ones with **)
    ================================================================================
      c:\data\temp\RobotBASIC_Stuff_20091001\Articles\Networking\Pictures\BS2.jpg  [noparse][[/noparse]32,331]
      c:\data\temp\RobotBASIC_Stuff_20091001\Articles\Others\WiredRobotArticle.doc  [noparse][[/noparse]28,160]
      c:\data\temp\RobotBASIC_Stuff_20091001\Articles\Others\WiredRobotArticle.pdf  [noparse][[/noparse]71,244]
    **c:\data\temp\RobotBASIC_Stuff_20091001\Articles\PropelledByThePropeller\Pictures\Figure_01.bmp  [noparse][[/noparse]1,277,154]
    **c:\data\temp\RobotBASIC_Stuff_20091001\Articles\PropelledByThePropeller\Pictures\Figure_02.JPG  [noparse][[/noparse]1,099,195]
      c:\data\temp\RobotBASIC_Stuff_20091001\Articles\SerialIO\Pictures\Prop2.jpg  [noparse][[/noparse]53,765]
      c:\data\temp\RobotBASIC_Stuff_20091001\RobotBASIC_B\Games\TempFiles\MatchUp_TopTen.RBA   [noparse][[/noparse]82]
     *c:\data\temp\RobotBASIC_Stuff_20091001\RobotBASIC_B\Games\TempFiles\Reaction_Scores.RBA  [noparse][[/noparse]173]
      c:\data\temp\RobotBASIC_Stuff_20091001\RobotBASIC_B\Games\Tiles_.BAS  [noparse][[/noparse]10,306]
    

    I use this program on a regular basis to keep track of all my folders and now I do not worry about becoming out of synch no matter for how long
    since all I need is to put the two folders on a Flash drive and MERGE them and I end up with a ONE directory that has ALL files and that
    preserves the directory tree and also that has the newer files. I also do not lose the original two directories since the MERGE is in a separate directory
    thus I can always refer to the older files if I need to.

    Here is the program (just 92 lines). Notice all the File functions and also notice the Clipboard functions. The report for instance
    is created on the Clipboard so that you can put it in any program you want. Also notice how the Data statement is used to create
    a QUEUE using an array. This queue makes it VERY simple to process the directory TREE without resorting to RECURSION which makes
    the program SIMPLE. Try to do this in Java or C++ or even Python.

    When you read the code you should get a taste for how RB works.
    Main:
       olddir = DirCurrent()
       TotalDirs = 0 \ TotalFiles = 0 \ UniqueFiles = 0 \ NewerFiles = 0 \ TotalBytes = 0
       data roots;"f:\ParallaxStuff_HP_20090901\"             //first source root directory
       data roots;"f:\ParallaxStuff_Toshiba_20090915\"        //second source root directory
       data roots;"f:\ParallaxStuff_20090916\"      //destination merged root directory
       GoSub GetFileNames
       GoSub Merge_Sort_Copy_Files
       x = DirSet(olddir)
       clearscr
       print "All done....the report is on the Clipboard..."
       s = Format(TotalDirs,"###,###")+" Directories were merged with "+format(TotalBytes,"#,#")+" Bytes in "+format(TotalFiles,"#,#")+" Files."
       print s  \ ss = s
       s = Format(NewerFiles,"###,###")+ " Files were newer in one source than the other (ones with  *)"
       print s \ ss = ss+crlf()+s
       s = Format(UniqueFiles,"###,###")+" Files were in one source but not the other    (ones with **)"
       print s \ tts = ss+crlf()+s+crlf()+srepeat("=",80)+crlf()+tts
       setcbtext tts    //put report on the clipboard
    end
    //===================================================================================
    GetFileNames: //create an array with file names from both sources
       for k=0 to 1
          dim dirs[noparse][[/noparse]0] \ data dirs;roots[noparse][[/noparse]k] \ dc = 0 \ L = Length(roots[noparse][[/noparse]k])+1
          repeat
             x = DirSet(dirs[noparse][[/noparse]dc])
             filsl = FilesList() \ x = numparts(filsl,"|")
             if x > 0
               for i=1 to x
                  data AllFilesList;roots[noparse][[/noparse]k],substring(dircurrent()+"\",L,0)+extract(filsl,"|",i)
               next
             elseif filsl != ""
               data AllFilesList;roots[noparse][[/noparse]k],substring(dircurrent()+"\",L,0)+filsl
             endif  
             dirsl = Dirlist() \ x = numparts(dirsl,"|")
             if x > 0
                for i=1 to x
                   data dirs;dircurrent()+"\"+extract(dirsl,"|",i)
                next
             elseif dirsl != ""   
                data dirs;dircurrent()+"\"+dirsl
             endif   
             dc = dc+1
          until !mType(dirs[noparse][[/noparse]dc])
       next
    Return
    //===================================================================================
    Merge_Sort_Copy_Files: 
    //----------------
    // sort the files by name and select the newest if duplicates exist
    // a report on the clipboard will show the names of the files created in the
    // merge directory and also how many bytes it is.
    //  * means the file existed in both the sources and the newer was selected
    // ** means the file was only in one source and not the other
    // no * or ~ means the file was in both the sources and both files were the
    // same the date. The file from roots[noparse][[/noparse]0] was the one copied to the merge directory
    //----------------
       dim FList[noparse][[/noparse]maxdim(AllFilesList,1)/2,2]
       mcopy AllFilesList,FList //copy 1D-array to 2D-array
       mTranspose FList,fList   //transpose so as to sort by row
       mSort fList,1            //sort it by the filename with sub-directory but excluding root directory name
       fc = maxdim(fList,2)-1
       settextbuff "" \ tts = ""
       for i= 0 to fc
         j = i \ mm="**"
         if i+1 <= fc
           if upper(fList[noparse][[/noparse]1,i]) == upper(fList[noparse][[/noparse]1,i+1])  //duplicate file
             d1 = FileDate(fList[noparse][[/noparse]0,i]+fList[noparse][[/noparse]1,i]) \ d2=FileDate(fList[noparse][[/noparse]0,i+1]+fList[noparse][[/noparse]1,i+1])
             mm = "  "
             if d1< d2  then j = i+1 //select newer one
             if d1 <> d2  then mm = " *" //if not same date then * in report
             i = i+1
           endif
         endif
         fd = fList[noparse][[/noparse]0,j] \ fn = fList[noparse][[/noparse]1,j]
         gosub CreateFile
       next
    Return
    //===================================================================================
    CreateFile:
       sf = fd+fn             //source file name
       df = roots[noparse][[/noparse]2]+fn       //destination file name roots[noparse][[/noparse]2] holds the merge directory root
       ddir = FileDir(df)     
       if !DirExists(ddir) then TotalDirs = TotalDirs+1 \ x = DirCreate(ddir)   //if destination dir not exist create it
       x = FileCopy(sf,df) \ TotalBytes = TotalBytes+x  //copy the file and get actual bytes copied
       ts =  mm+df+"  "+format(x,"[noparse][[/noparse]#,#]")    //create the report
       print ts              //display progress
       tts = tts+ts+crlf()   //add to final report
       if mm == " *" then NewerFiles = NewerFiles+1
       if mm == "**" then UniqueFiles = UniqueFiles+1
       TotalFiles = TotalFiles+1
    Return
    //===================================================================================
     
    




    Post Edited (SamMishal) : 10/7/2009 10:06:22 AM GMT
  • swampie777swampie777 Posts: 33
    edited 2009-10-07 20:20
    ElectricAye;

    Thanks for the suggestion. I tried the PLX-DAQ software, but no results, so I'm obviously missing something obvious. I have the professional board. How did you connect to the PC?
  • swampie777swampie777 Posts: 33
    edited 2009-10-07 20:22
    BTW; thanks to all for great help!

    swampie777
Sign In or Register to comment.