Shop OBEX P1 Docs P2 Docs Learn Events
PropTerminal and Propeller from command line — Parallax Forums

PropTerminal and Propeller from command line

lfreezelfreeze Posts: 174
edited 2008-05-18 16:30 in Propeller 1
I am not sure if this post belongs in the propeller forum or the sand box.

I am·using a simple batch file on my desktop and using windows xp, task scheduler,
starting propterminal and downloading data from the propeller to the desktop at a fixed time each day. I was successfull with this, but now I want to start the propterminal from the command line
with the data being saved to a file on the desktop. I am not sure if this possible and would appreciate
any suggestions.··Below is the batch file.

echo off
cd c:\program files\parallax inc\propeller tool v1.1\my programs
propterminal.exe

Thanks in advance////
Larry

Comments

  • AribaAriba Posts: 2,685
    edited 2008-05-16 08:02
    Hello Larry

    It should be doable.
    First you need a Spin program that uses PropTerminal to saves the data to a File on the Desktop. Here is a simple example, which produces a small textfile and save it (path is for my computer and a Swiss Window version, so change it to your Desktop path):
    {{ Save to Desktop Test }}
    
    CON
            _clkmode        = xtal1 + pll16x
            _xinfreq        = 5_000_000
    
    VAR
           long filename
           
    OBJ
      pc   :       "PC_Text" 
    
    PUB main  | i
      pc.start(12)
    
    ' path and filename (customize it for your Desktop location)
      filename := string("C:\Dokumente und Einstellungen\insonix\Desktop\TEST2.TXT")
    
    ' produce some Text data lines (max 32kByte)
      pc.out(0)                               
      repeat i from 1 to 40
        pc.str(string("Save-Test Line: "))
        pc.dec(i)
        pc.out(13)
    
    ' save it to Desktop  
      pc.out(1)                        'save file command sequence                  
      pc.str(filename)                 'for PropTerminal
      pc.out(5)
      pc.out($82)
      pc.out(strsize(filename))
      pc.out("s")
      
      repeat
    
    


    If it works in the Propeller Tool, you can save it as .binary (F8 and then "Save Binary"). Save the binary in the same Directory as the PropTerminal is. Now Edit the PropTerminal.ini file. Write the filename of your binary behind the entry Autoload= (for example: Autoload=SaveTest.binary.
    When you now start PropTerminal, the binary is automatically uploaded to the Propeller RAM and started. The Propeller then saves the data to the Desktop. This works also if you start PropTerminal from Commandline, in this case you can have a special .ini file, only for that Desktop saving, and start PropTerminal with this ini-filename as parameter:
    PropTerminal.exe Inifilename.ini
    
    



    Andy
  • lfreezelfreeze Posts: 174
    edited 2008-05-16 12:29
    Andy,

    Thank you very much for your help. I will try this today.

    Larry
  • datac99datac99 Posts: 15
    edited 2008-05-16 17:37
    Pretty sure you need to put " around the string to launch the propterminal in your .bat.

    Nope... I take it back... Since you CD in before running the command it should work just fine... My mistake...

    Post Edited (datac99) : 5/16/2008 5:43:08 PM GMT
  • lfreezelfreeze Posts: 174
    edited 2008-05-17 17:12
    Hello Andy,

    I had time this morning to test the program and ran into some problems.
    I took your sample program and changed the address of the save file to my directory (copy below). I then saved
    it as binary file in the same directory as propterminal. I then edited and saved the ini to autoload
    the saved binary file. I ran propterminal and it produced the following result:

    Start Upload
    Time Out
    Code Error -> Abort˜™ݻ™ݻ™
  • AribaAriba Posts: 2,685
    edited 2008-05-17 17:37
    Do you have a PropTerminal version 0.4 or higher? And have you set the right COM Port in the INI file? It seems the Binary upload to the Propeller does not work!
    Have you tried to upload the code example from the PropellerTool (with F10), with that you should also get the Text File on your PC.
    If this works, remove the filename behind "Autoload=", and try to Upload the binary with PropTerminal manually (Menu: File -> Upload).

    If the Upload with PropTerminal really not works, then perhaps it works with the code stored to the EEPROM and only start PropTerminal
    with the batch file. At start normally a Reset happens, and so your code ist executed from the EEPROM, sends the data to PropTerminal, which stores it as textfile.

    Andy
  • lfreezelfreeze Posts: 174
    edited 2008-05-17 19:11
    Andy,

    I am using propterminal ver 0.4.1. Here is the INI I am using:

    /* PropTerminal Settings v0.1 */'
    [noparse][[/noparse]Config]
    ComNr=1
    FT232R=0
    BinPath=
    AutoDis=1
    VKeys=0
    TxtCurs=0
    MsMoveOff=1
    BaudRate=4
    Rows=20
    Cols=50
    Autoload=savetest.binary
    [noparse][[/noparse]Colors]
    pal_0=#FFFFFF
    pal_1=#FFFF00
    pal_2=#0000FF
    pal_3=#FF00FF
    pal_4=#FF0000
    pal_5=#00FF00
    pal_6=#00FFFF
    pal_7=#C0C0C0

    I believe I have the correct com port setting as I am getting a result when I call Propterminal. For purposes of testing
    I will now use only "save to desktop test" program you sent me and forget about starting it from the command line until
    this it is fixed.
    I am really confused about why it does not work. I am
    thinking that perhaps the path I have for the save file is not valid. I will try some variations and see if that will
    solve it .
    Thanks again for spending your time to help me solve this.
    Larry
  • lfreezelfreeze Posts: 174
    edited 2008-05-18 12:18
    Andy,

    Success ! I went over everything and found that I had the "normal terminal Mode" option checked on the Propterminal
    screen. When I unchecked it, the program ran without problem. I then plugged the entire application into windows
    task scheduler and ran several tests every few minutes. It worked without problem. I can now schedule routine timed
    downloads of what the propeller is doing and save this information to a file on the desktop. From this point I can
    create an e-mail messages and broadcast the saved file as an attachment, all under program control.

    Thank you again for all your help. It would not have been possible for me to create this application
    without your assistance.

    Larry
  • AribaAriba Posts: 2,685
    edited 2008-05-18 16:30
    Gern geschehen wink.gif
Sign In or Register to comment.