Shop OBEX P1 Docs P2 Docs Learn Events
Identifying ASCII character ? — Parallax Forums

Identifying ASCII character ?

BorisBoris Posts: 81
edited 2005-03-01 15:11 in BASIC Stamp
I have communication between a PC (for now,·Basic Samp later)·and another device via RS232 port. Using HyperTerminal I send a command to the device and it sends out a string of text. How can I find out if there is any specific character (ASCII code) at the end of transmission, and if there is one I need to know what it is.
Is there any software that will receive info from serial port but display just ASCII codes, not letters.

Thank you,

Boris.

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-03-01 13:43
    Do a search on "serial sniffer" using Google -- that should help you find the kind of program you're looking for.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • BorisBoris Posts: 81
    edited 2005-03-01 14:04
    Hello, thank you for the info. I actually just copy-pasted text from HyperTerminal into excel and used excel's MID and CODE functions to find that there is always Line Feed ASCII code 10 at the end of each line.
    Now how would I go about making stamp SERIN untill it encounters Char 10?
    In the line below I am trying to receive data, BaudRT is a set constant, NoData is a label. Receive maximum of 20 characters.
    But how do I define "stop if reached ASCII 10"

    SERIN 16,BaudRT,10000,NoData,[noparse][[/noparse]STR Faults\20\????]
  • achilles03achilles03 Posts: 247
    edited 2005-03-01 14:18
    That should be pretty simple.· How long is the text string coming from the device and what does it start with?· I would just use the SERIN command, use the text sentence start character to que the SERIN command, skip the first X characters, and debug the last character in ASCII format.

    Dave
  • BorisBoris Posts: 81
    edited 2005-03-01 14:30
    I need from the 1st character of the string up to 20 characters OR ASCII code 10, which ever happens 1st.
  • PaulPaul Posts: 263
    edited 2005-03-01 15:11
    SERIN 16,BaudRT,10000,NoData,[noparse][[/noparse]STR Faults\20 \10] should work.
Sign In or Register to comment.