data from serial connection to pc command line
lfreeze
Posts: 174
I would like to use the serial connection from the propeller chip to the desktop pc
To run a batch file resident on the PC C drive.· The batch file will be run when
The propeller sends serial data commands on the link to the PC. After experimenting
For Several hours with various code combination, I think that this is either, not possible,
or is beyond my skills, or requires some additional software. I did a number of
google searches and found Many commercial software packages for serial port
monitoring but none seemed· right for my purpose.· I would appreciate any
help that can be provided. Here are a few of the failed propeller code examples:
·
“filename is a variable created earlier in the program”
·
·FILENAME := STRING("%SystemRoot%\system32\cmd.exe")
·waitcnt (80_000_000 + cnt )
·FILENAME := STRING("test.bat")
·
·FILENAME := STRING("c:\windows\system32\svchost.exe")·
·waitcnt (80_000_000 + cnt )
·FILENAME1 := STRING("test.bat")· ·.
·
I am using windows xp sp2 on the desktop.
·
A sincere thank you for any help that may be provided
·
Larry
To run a batch file resident on the PC C drive.· The batch file will be run when
The propeller sends serial data commands on the link to the PC. After experimenting
For Several hours with various code combination, I think that this is either, not possible,
or is beyond my skills, or requires some additional software. I did a number of
google searches and found Many commercial software packages for serial port
monitoring but none seemed· right for my purpose.· I would appreciate any
help that can be provided. Here are a few of the failed propeller code examples:
·
“filename is a variable created earlier in the program”
·
·FILENAME := STRING("%SystemRoot%\system32\cmd.exe")
·waitcnt (80_000_000 + cnt )
·FILENAME := STRING("test.bat")
·
·FILENAME := STRING("c:\windows\system32\svchost.exe")·
·waitcnt (80_000_000 + cnt )
·FILENAME1 := STRING("test.bat")· ·.
·
I am using windows xp sp2 on the desktop.
·
A sincere thank you for any help that may be provided
·
Larry
Comments
gives mode a brief description. I will investigate this option. The first suggestion of developing
a visual basic routine appears to be a working option as I am finding some examples of vb
programs which do read serial data from the com port and take action based on the vb·program.
I had hoped to avoid the learning process with visual basic but it seems to be the way to go.
Larry
There is not a lot of error checking and I have not had chance to try it out but it should work straight out the box. If there are problems it might need a little more code, the application form itself for instance can be hidden from the user and run in the background.
Jeff T.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Andrew Williams
WBA Consulting
IT / Web / PCB / Audio
into learning the fundamentals of visual basic. Having ·a simple working example makes
it so much easier. I plan on spending some time with the online vb tutorials this morning,
hopefully it will be a useful tool to use in conjunction with the propeller. Can you suggest
a manual that describes VB basics? ··
Based on Andy’s response, I will do some searching of the forums to see if I can locate the
other· process.
·
Larry
·
·
That is an application I wrote years back - a crude version is available here ..
http://forums.parallax.com/showthread.php?p=627711
basically anything received on the serial port is converted into a keyboard scan code and injected into the keyboard buffer as if it was typed on the PC ..
e.g. Set the ini file to your required com settings ..Run the application .. open a text doc and highlight it (top bar blue!) send some text from stamp - it appears on your text doc ... or what ever is highlighted ...even your command screen....enjoy !
Rgds,
John Twomey
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
Those who can, do.Those who can’t, teach.
Post Edited (QuattroRS4) : 10/17/2008 2:02:38 PM GMT
http://www.theabramgroup.com/basicstamp/
Attached is a snip of the serial port settings I'm using successfully.
1/ Shows how to set up a serial port, works for the Prop as well as the Stamp http://forums.parallax.com/showthread.php?p=671804
2/ A discussion on setting up an array for communication with a Prop http://forums.parallax.com/showthread.php?p=751258
Jeff T.
More than enough for me to get a real head start on my project. All of the
Examples were great. I had already started the VB learning process with the
Microsoft tutorials, after looking at the post from sylvie369, I quit the
Tutorials and used the link http://www.theabramgroup.com/basicstamp/
I found the instruction on the link straight forward and very
easy to follow and would suggest it to anyone attempting to interface
Stamp or Propeller chips via the serial port.
·
Larry
I have another question about propeller to command line programming. I have been successful
In getting the propeller to open wordpad and download data to it (see below). My problem is
I cannot determine how to save and close the file from within wordpad using keyboard commands.
I think using a command line/dos based text editor may solve the problem but I am not sure which one
To use. A quick search revealed very many free text editors. Can anyone suggest a simple one that
Can be run using only keyboard commands?
·
Thanks· again……..
·
·
I have been using the vb program provided by QuatroRS4, it works flawlessly. I can use the
Propeller to open wordpad and download data directly to it. ·My desktop is is running windows xp.
I am using a serial cable to a propplug
·
- Download the following spin file to the propeller
- from the desktop run neokbwi.exe·· (exe and ini provided by QuattroRS4, see previous posts)
- open command line window
- ·reset the propeller
- wordpad should open and the test data should appear
·· Here is the spin file
·
CON
· _clkmode····· = xtal1 + pll16x
· _xinfreq····· = 5_000_000
'VAR
'OBJ
··· ser··········· : "FULLDUPLEXSERIAL"
·pub Start
·· ser.start(31, 30, 0, 9600)
·· waitcnt (80_000_000 + cnt)
·· senddata
pub senddata····························································
··· ser.str(string("cd c:\ "))
··· ser.tx(10)
··· ser.tx(13)···
··· waitcnt (80_000_000 + cnt)········································································
··· ser.str(string("cd\Program Files\Windows NT\Accessories>wordpad"))
··· ser.tx(10)
··· ser.tx(13)
··· ser.str(string("wordpad.exe"))
··· ser.tx(10)
··· ser.tx(13)···············
··· waitcnt (80_000_000 + cnt)·
··· ser.str(string("the quick brown fox jumps over the lazy dogs back 1234567890"))
··· ser.tx(10)
··· ser.tx(13)
·Thank you
Larry
Nice app. if you like I can modify the program to send multiple key strokes etc .. or write a simple editor to react to a cetain sequence of keystrokes or F buttons .. Let me know.. I also have an application which logs data received on a serial port·to a text or html file.
You can get·it here ..
http://www.igniteautomation.com/IA_Logger.html
Regards,
John Twomey
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
Those who can, do.Those who can’t, teach.
Post Edited (QuattroRS4) : 11/6/2008 6:49:54 PM GMT
·
Thank you for the link to the data logger. I haven’t downloaded it yet But will give
it a ride later today. I think it may be just what I need. My Objective is to create an
Application that will trigger specific text, based On the condition of various ·sensors
connected to propeller. The text will be sent to a txt file on the desktop
(from the propeller) via the serial link.
·
The second part of the project is to get to the desktop command line again from the
serial link (via the propeller),· and generate a command at the desktop command line.
The command I want to generate will run a batch file. The batch file will contain
the code to generate an email/text ·message. I know I could probably accomplish
this with the Parallax “PINK” module, But ·I don’t want to add additional hardware
and costs.
·
This ·is the batch file, it uses BLAT software (free)
·
@echo off
·set to=-to someone@comcast.net
·set from=-f anyone@comcast.net
·set subject=-subject "Message file attachment from Propeller"
·set body=-body "Message from propeller is attached"
·set attach=-attach "c:\program files\propeller stuff\propeller.txt
·set server=-server smtp.comcast.net -debug
·
·blat - %body% %to% %from% %subject% %server% %attach%
·
I have gotten most of this to work with some significant help from Andy Schenk (Propterminal) Basically he created a routine which when prop terminal is opened it creates a Txt file on the desktop and writes whatever you send to propterminal to the save file.
·
This works well if you want to send emails on a routine schedule. I am using windows
Xp task scheduler to accomplish this part. I want to be able to generate email/text messages on the fly based on the condition of the various sensors connected to the
Propeller, and eliminate the task scheduler.
·
This ·is the batch file
·
@echo off
·set to=-to someone@comcast.net
·set from=-f anyone@comcast.net
·set subject=-subject "Message file attachment from Propeller"
·set body=-body "Message from propeller is attached"
·set attach=-attach "c:\program files\propeller stuff\propeller.txt
·set server=-server smtp.comcast.net -debug
·
·blat - %body% %to% %from% %subject% %server% %attach%
·
I used the routine you provided ·NeoKBWI.exe ·and spent some significant time With PERL software. I found that I could run compiled programs thas way but Could not do a
line by line process. If you have a suggestion that will help with This I would really
appreciate it.
Thanks……
Larry
·