Serin parameters ??


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2007
    Posts
    33

    Question Serin parameters ??

    Hi all,

    i want to read serial data using serin but the trame i am receiving is not always with the same size and it has not always the same bytes at the end (to wait for and stop reading).

    i want to use it as when using hserin ( hserin timeout,label,[str buffer\80] ) if possible, but i noticed that i can't use "str variable\x", any help ??

    Thank you

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Serin parameters ??

    perhaps SERIN2 or DEBUGIN?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Feb 2007
    Posts
    33


    Did you find this post helpful? Yes | No

    Default Re: Serin parameters ??

    i think serin2 will work, i didn't pay attention for that before
    thank you Steve

  4. #4
    Join Date
    Feb 2007
    Posts
    33


    Did you find this post helpful? Yes | No

    Default Re: Serin parameters ??

    i am trying with serin2, the timeout is working properly,
    but i faced another problem which is the [str varname\n]

    serin2 IN_PIN,84,[str buffer\2] ' baud 9600
    if buffer[0] = "A" and buffer[1] = "B" then
    LED1 = 1
    LED2 = 0
    else
    LED1 = 0
    LED2 = 1
    endif

    The above code makes LED2 ON when sending "AB" to the microcontroller (which is wrong) while the below code makes LED1 ON (which is correct)

    serin2 IN_PIN,84,[buffer[0],buffer[1]]
    if buffer[0] = "A" and buffer[1] = "B" then
    LED1 = 1
    LED2 = 0
    else
    LED1 = 0
    LED2 = 1
    endif

    where is the problem in my code ???
    i have a buffer of around 50 bytes, so it is preferable to use the [str buffer\50]

    Note that i tested the debugin instead of serin2, but same problem !!!

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Serin parameters ??

    mmm... weird, will test it here. Which PBP version do you have?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Serin parameters ??

    No issue here...
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7
    Join Date
    Feb 2007
    Posts
    33


    Did you find this post helpful? Yes | No

    Default Re: Serin parameters ??

    My version is PBP 2.50C

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