Converting HSERIN Data to Number


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Converting HSERIN Data to Number

    Now if you only wanted to grab say byte 2 (beginning counting from zero).

    Code:
    counter var byte
    counter = 0
    
    'oh looky here.. a serial byte arrived
    
    if serialbyte = “S” then
    counter = 0
    else
    counter = counter + 1
    endif
    
    if counter = 2 then
    byteyoucareabout = serialbyte
    endif
    A lot of this will fall apart if another byte of the command can be the same value as the “S” or the termination character,
    which is why it’s better to go something close to the first way, and check both start and end chars if they are always the same.
    Last edited by Art; - 18th November 2015 at 05:29.

Similar Threads

  1. Replies: 3
    Last Post: - 22nd June 2015, 16:15
  2. read bytes number in Hserin
    By Rony in forum Serial
    Replies: 13
    Last Post: - 13th August 2010, 10:32
  3. Unable to use the number 8 in DATA statement
    By dbachman in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 7th December 2008, 06:34
  4. Problem converting data to what I need
    By oldcarguy85 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 23rd November 2007, 22:43
  5. Need help converting NMEA data
    By tcbcats in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 21st August 2004, 08:28

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