PC to BS2 communication.
Boris
Posts: 81
I am building a·fault downloader· (BS2sx) that would connect to a serial port on an electronic device, send a command to that device, receive and then interpret the errors received.
Here is the problem, i do not currenly have access to that device and would like to simulate its error code output. I know what the error codes look like, but what·i need is to connect the basic stamp serial port to PCs serial port and then write some software on the PC that will send one of 10-15 pre-recorded text files to the serial port depending on the received command.
Basically:
Basic Stamp sends "cmd1"
PC replies "some pre recorded text 1"
Basic Stamp sends "cmd2"
PC replies "some pre recorded text 2"
etc...
Any idea how i can write such software?
Thank you,
Boris.
Post Edited (Boris) : 10/14/2004 5:56:45 PM GMT
Here is the problem, i do not currenly have access to that device and would like to simulate its error code output. I know what the error codes look like, but what·i need is to connect the basic stamp serial port to PCs serial port and then write some software on the PC that will send one of 10-15 pre-recorded text files to the serial port depending on the received command.
Basically:
Basic Stamp sends "cmd1"
PC replies "some pre recorded text 1"
Basic Stamp sends "cmd2"
PC replies "some pre recorded text 2"
etc...
Any idea how i can write such software?
Thank you,
Boris.
Post Edited (Boris) : 10/14/2004 5:56:45 PM GMT
Comments
Maybe there is an easy solution rather than writing a PC program.
One idea is that you can use a second BASIC Stamp for this purpose. If you want it to have a terminal use an LCD or the debug window. Alternatively, if a lack of automation is acceptable from the PC replies then perhaps you could use the Stamp's debug terminal white pane to send the data back to the BASIC Stamp by typing it in the window. This is pretty easy with DEBUGIN and DEBUG or SERIN/SEROUT (your choice).
Or, you could write a PC program (not my specialty) like you said.
Ken Gracey
Parallax, Inc.
Currently, in order to test and trouble shoot the PBasic program on the BS2sx, i use the serialin command and the debug window included·in parallax's software. So every time I run the code it sends the "request" command for specified set of errors, and i·have to sit there and type in the error message in the debug window as if the transceiver is sending it. Well that error message is 4-5 lines of text, and if i make a mistake i have to start over, because it could have messed up the format of the error code, and·BasicStamp will not be able to interpret it correctly. For example the basic stamp expects part of the error code to read: elm_poi:5, if i type ekm_poi:5, i have to reset the basic stamp and start the trouble shooting over.
SO: what im trying to do is make the PC automatically send a certain chunk of text every time it receives the "request" command.
Sorry to make this message so long, i hope people read the entire message [noparse]:)[/noparse]
····· What programming language do you want to use on the PC?
·· I have some samples in QuickBasic which would show you how to use the techniques.
··· Also, you could just set up another Stamp to act as the device under test and store your error messages with the 'data' command. I can show you a few samples if it would help.
· Cheers
·· Tom Sisk
You'll have to create some strings in VB, then send those
strings to the BS2.
http://www.ubasics.com/adam/electronics/ha/software/software.shtml