Problem: SERIN2 and long arrays...


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: Problem: SERIN2 and long arrays...

    Same thing with PBP 3...
    I'm not sure what difference it make if I add another array, or change order when defining variables...

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: Problem: SERIN2 and long arrays...

    What MCU are you using? Maybe you are running low on memory?
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: Problem: SERIN2 and long arrays...

    PIC18F255, this issue i also had on PIC18LF1xK50.
    It's not low on memory, because if I add some dummy var everything works fine.
    Now I'm testing and if I tray this
    Code:
    Some vars...
    Mail_Pass var byte[36]
    Mail_User var byte[36]
    etc
    And problem move to Mail_User.
    Now I'll try to put serin2...[mail_pass[0],mail_pass[1],...mail_pass[34]], instant of str mail_pass...

  4. #4
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: Problem: SERIN2 and long arrays...

    Now I try this
    Code:
    ...
    Mail_User var byte[36]
    Mail_Pass var byte[36]
    ....
    serin2 PC_RX,8588,1000,PC_Data_Mail,[wait("Mail:"), str dat\5, str MailServer\20, str Mail_port\6, str Mail_User\35,_
    Mail_Pass[0],Mail_Pass[1],Mail_Pass[2],Mail_Pass[3],Mail_Pass[4],Mail_Pass[5],_
    Mail_Pass[6],Mail_Pass[7],Mail_Pass[8],Mail_Pass[9],Mail_Pass[10],Mail_Pass[11],_
    Mail_Pass[12],Mail_Pass[13],Mail_Pass[14],Mail_Pass[15],Mail_Pass[16],Mail_Pass[17],_
    Mail_Pass[18],Mail_Pass[19],Mail_Pass[20],Mail_Pass[21],Mail_Pass[22],Mail_Pass[23],_
            Mail_Pass[24],Mail_Pass[25],Mail_Pass[26],Mail_Pass[27],Mail_Pass[28],Mail_Pass[29],_
            Mail_Pass[30],Mail_Pass[31],Mail_Pass[32],Mail_Pass[33],Mail_Pass[34],_   
            str Mail_Adr\30, str Mail_Subj\20, str Mail_Msg\50, str Mail_FileName\20, Mail_Name_Tip,_
            str Mail_RCPT1\35, str Mail_RCPT2\35, str Mail_RCPT3\35 ]
    And this also won't work... I'm shure that problem is in serin2 because i try If mail_pass[0]=0 then HSEROUT["empty",13,10] and without adding additional array I always got empty.
    But If i try to put something in array eg mail_pass[0]="a", it;s ok.
    For now I can add just some arrays, but I want to know what causing this problem...
    And it's not first time to bump into this...

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,626


    Did you find this post helpful? Yes | No

    Default Re: Problem: SERIN2 and long arrays...

    Hi,
    It sounds to me like one array is "spilling over" into the next. PBP doesn't have perform boundry checking on arrays so you can easily write outside it of its "space". When you add your dummy array the data from operation A spills over into the dummy array instead of into the "real" array where you see the zeros.

    That'a a theory....

    /Henrik.

  6. #6
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: Problem: SERIN2 and long arrays...

    I send fixed len. strings from vb, and it doesn't matter where I put dummy variable. I try to to add dummy after mail_pass, and again everything it's ok. So now I don't have clue what it is happening...
    I have 661 byte 2 words and 4bits before Mail_user.
    And if I swap place of Mail_Pass and any array, _pass is ok, and that replaced array isn't ok...

  7. #7
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,626


    Did you find this post helpful? Yes | No

    Default Re: Problem: SERIN2 and long arrays...

    Hi,
    Preload your dummy array with all 255's or whatever, then after your SERIN statement, dump the content of the dummy array and see if IT now has your zeros. Then you KNOW that something is writing outside of where it should.

    /Henrik.

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