SERIN2 digit parsing


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Dude!! Move to southern California.

    At the Worst, we get maybe 1 or 2 days that might freeze a thin layer of ice on the puddles from the overnight drizzle.

    As a kid, I lived for a short time in Cedar Rapids Iowa. I've seen -80 degree wind chill factor. NEVER, I mean NEVER again. I'll jump in a volcano first. Never!

    OK, so back to the serin....

    Yup, you're reading too much into it. And I should also mention that on page 135 it says...
    "BIN, DEC and HEX may be followed by a number. Normally, these modifiers receive as many digits as are in the input. However, if a number follows the modifier, SERIN2 will always receive that number of digits, skipping additional digits as necessary.
    Don't take me too seriously here.

    So, You have the data...

    49 02 01 00 00 00 31

    and you've waited for "49 02 01 " (note: includes a space)

    That means the first thing that HEX2 sees is "00 ", and since the HEX2 stops after receiving the first 2 digits, the next parameter will start with a space, and another "00". The space will be discarded, and the following 2 digits will be parsed. Continuing the process unabated.

    Even if you used the HEX without the 2, it would still work, as the terminating character (space) would be discarded, leaving the next parameter to start with a hex digit, instead of a space. Again proceeding on without error.

    So it all boils down to, YES, what you've shown, should work.
    <br>
    DT

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    Dude!! Move to southern California.

    At the Worst, we get maybe 1 or 2 days that might freeze a thin layer of ice on the puddles from the overnight drizzle.

    As a kid, I lived for a short time in Cedar Rapids Iowa. I've seen -80 degree wind chill factor. NEVER, I mean NEVER again. I'll jump in a volcano first. Never!

    OK, so back to the serin....

    Yup, you're reading too much into it. And I should also mention that on page 135 it says...
    Don't take me too seriously here.

    So, You have the data...

    49 02 01 00 00 00 31

    and you've waited for "49 02 01 " (note: includes a space)

    That means the first thing that HEX2 sees is "00 ", and since the HEX2 stops after receiving the first 2 digits, the next parameter will start with a space, and another "00". The space will be discarded, and the following 2 digits will be parsed. Continuing the process unabated.

    Even if you used the HEX without the 2, it would still work, as the terminating character (space) would be discarded, leaving the next parameter to start with a hex digit, instead of a space. Again proceeding on without error.

    So it all boils down to, YES, what you've shown, should work.
    <br>
    So-CAL - What?! And pay silly amounts of cha-ching for practically nothing?
    The way I figure it, you can always light something on fire to stay warm. When was the last time a person lit something on fire to stay cool? And I got 1.5acres & 2400sq.ft., 30ft x 80ft garage, 20x50 bldg w/basement that's about to become my PIC-Shop, 'bout a hundred trees, a burn pit (great for keggars), deer, turkeys, eagles, etc. all over the place, I can drive my junker '94 Geo Metro like an idiot (and I do!) all day almost anywhere, neighbors are great, and I don't have to lock my door when I leave if I don't want to...and I don't worry at all about being shot for no reason...all for $80K. I've been to SoCal for a time (Long Beach/LA, ok, haven't been to Northern end, can't judge that)...I'll pass...thank you...please drive thru...

    And now back to our regularly scheduled program....

    I kinda figured I was reading too much into it, but, you know how it is...just when you think you know how something works, and it ain't workin', it's probably because you didn't know how it really worked in the first place . I guess it goes back to that updated manual thread, adding in a couple more examples and things like that.
    We'll find out how well it works when I get the nerve up to hook the OBD up to my truck and chance burning out the ECU.

  3. #3
    Join Date
    Mar 2005
    Location
    Iowa, USA
    Posts
    216


    Did you find this post helpful? Yes | No

    Default O.t.

    Quote Originally Posted by Darrel Taylor
    As a kid, I lived for a short time in Cedar Rapids Iowa. I've seen -80 degree wind chill factor. NEVER, I mean NEVER again. I'll jump in a volcano first. Never!
    Aw 'cmon Darrel... Iowa isn't so bad.
    Quote Originally Posted by Skimask
    The way I figure it, you can always light something on fire to stay warm.
    I broke down and bought a corn burner this year. Never thought I would be burning corn to heat my house! Ofcourse, as soon as I do, the corn prices start climbing... damn ethanol plants!
    Wisdom is knowing what path to take next... Integrity is taking it.
    Ryan Miller

Similar Threads

  1. GPS $GPRMC to PIC16F684. Need help with SERIN2
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 27th November 2009, 09:47
  2. Getting SERIN2 to work?
    By BobPigford in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 22nd July 2009, 20:10
  3. Single digit 7 Seg LED clock - PIC16F88
    By thirsty in forum Code Examples
    Replies: 4
    Last Post: - 17th July 2009, 08:42
  4. need help in lookup
    By malwww in forum mel PIC BASIC Pro
    Replies: 27
    Last Post: - 6th June 2009, 14:30
  5. 7 segment digit problem (using Mister E's code)
    By jmgelba in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 9th September 2005, 20:25

Members who have read this thread : 0

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