String Seperation


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Jun 2005
    Location
    Up the bush, Western Plains, NSW Au
    Posts
    216


    Did you find this post helpful? Yes | No

    Default

    Unless I got the string wrong and it is EXACTLY "t=00 b=000 r=00 st=00000 sp=00000"

    Then I would try something like:

    SERIN2 1,N2400,[SKIP2, DEC 2 T, SKIP 3, DEC3 B, SKIP 3, DEC2 R, SKIP 4, DEC5 ST, SKIP 4,DEC5 SP]


    So, that should skip the "t=" grab the 00 into T, skip the " b=" grab the 000 into B, skip the " r=" grab the 00 into R, skip the " st=" grab the 00000 into ST, skip the " sp=" grab the 00000 into SP

    Once again the numerical sizes would apply as would the experimenting.
    Anyway, that's where I would start playing.
    Peter Moritz.
    Up the bush, Western Plains,
    New South Wales,
    Australia.

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    Did you find this post helpful? Yes | No

    Default

    SKIP is good but the Serin2 must be well synchronized at the beginning of the transmision.
    CASE Else the variables will me messed up!

    Is there a start sentinel before the "t=00 b=000 r=00 st=00000 sp=00000" so that a WAIT modifier can be used?

    Ioannis

  3. #3
    Join Date
    Mar 2006
    Location
    Pennsylvania, USA.
    Posts
    130


    Did you find this post helpful? Yes | No

    Default

    Ioannis,

    I was assuming that not all of the bytes would be in ascii, I have a device that I communicate with that sends ascii labels like "b=" and then sends hex values as the variables change. That's why I suggested that he might want to send the buffer[3] byte out to an lcd, just to make sure. I know I went nuts testing with hyper-terminal, because it kept taking the hex values and converting them to ascii characters and printing out nonsense.

    Jerry.
    If your oscilloscope costs more than your car...

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,139


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by b1arrk5 View Post
    ...
    I know I went nuts testing with hyper-terminal, because it kept taking the hex values and converting them to ascii characters and printing out nonsense.
    ...
    Yes, I understand what you mean... 8-)

    Ioannis

Similar Threads

  1. How about String Variables?
    By mytekcontrols in forum PBP Wish List
    Replies: 40
    Last Post: - 20th January 2015, 12:53
  2. How to convert HEX Value as formatted BIN String ?
    By Robson in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 19th August 2007, 02:16
  3. Visual Basic 6 & Access 2000
    By Demon in forum Off Topic
    Replies: 33
    Last Post: - 7th September 2006, 04:39
  4. String Parsing
    By eoasap in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 18th February 2006, 17:20
  5. Message String Table using Readcode
    By mytekcontrols in forum Code Examples
    Replies: 2
    Last Post: - 10th July 2005, 23:17

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts