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...

    Add this before serin2
    for i = 0 to 34
    MAil_123[i]="A"
    next i
    hserout [str mail_123,13,10]
    and after serin2
    hserout [str mail_123,13,10]
    From first HSEROUT got AAA... then CrLf, second Hserout got just CrLf...
    I try to move Mail_123 var byte[36], and that array is always cleared...

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,615


    Did you find this post helpful? Yes | No

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

    Hi,
    Are you SURE you're sending the correct length strings from your VB program? Have you verified that?
    Have you tried breaking it up in several SERIN statements?

    I still think something is either writing outside of "its space" or not getting enough bytes so the next input "spans" two arrays or something...

    /Henrik.

  3. #3
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

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

    I'm 100% sure that i send correct length... I check this several time's.
    Now I'll try.

  4. #4
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

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

    serin2 PC_RX,8588,1000,PC_Data_Mail,[wait("Mail:"), str Mail_Alrm\5]
    serin2 PC_RX,8588,1000,PC_Data_Mail,[str MailServer\20]
    serin2 PC_RX,8588,1000,PC_Data_Mail,[str Mail_port\6]
    serin2 PC_RX,8588,1000,PC_Data_Mail,[str Mail_User\35]
    serin2 PC_RX,8588,1000,PC_Data_Mail,[str Mail_Pass\35]
    serin2 PC_RX,8588,1000,PC_Data_Mail,[str Mail_Adr\30]
    serin2 PC_RX,8588,1000,PC_Data_Mail,[str Mail_Subj\20]
    serin2 PC_RX,8588,1000,PC_Data_Mail,[str Mail_Msg\50]
    serin2 PC_RX,8588,1000,PC_Data_Mail,[str Mail_FileName\20]
    serin2 PC_RX,8588,1000,PC_Data_Mail,[Mail_Name_Tip]
    serin2 PC_RX,8588,1000,PC_Data_Mail,[str Mail_RCPT1\35]
    serin2 PC_RX,8588,1000,PC_Data_Mail,[str Mail_RCPT2\35]
    serin2 PC_RX,8588,1000,PC_Data_Mail,[str Mail_RCPT3\35]I try to use Mail_pass in another serin2 statement, and same problem. I try to put another var, before and after in serin2 statement and same...
    It won't to work without dummy var...

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


    Did you find this post helpful? Yes | No

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

    And you have all your arrays declared properly, ie Arrayname VAR BYTE[Lenght] ?
    I once forgot the [] around the length and it led to quite a bit of headache untill I posted the code here and someone spotted it right away.

    /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'll just leave dummy array, and continue...
    Thank anyway.

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


    Did you find this post helpful? Yes | No

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

    OK, I can understand that but I have a feeling that doing so will come back and bite you you sooner or later.

  8. #8


    Did you find this post helpful? Yes | No

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

    since you have 1 long array and you know where the smaller arrays are in the longer array,

    serin2 PC_RX,8588,1000,PC_Data_Mail,[wait("Mail:") ]
    ........RCVint on....... 'turn on rcv interrupt to take your 200 (more or less) chars into your array
    continue............................
    .
    .
    .
    RCVint:
    place rcv chr to array[x]
    char count +1
    char indx +1...[x]
    turn off when count = chars to rcv

    Don
    Last edited by amgen; - 13th November 2011 at 12:31.

  9. #9
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

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

    Problem (probably) solved.
    I needed bigger array for RCPT mails. And when I change size of those array from 36 to 45 bytes, I remove dummy array and it work without it
    Then I just change in serin2 to receive 45 bytes and everything work well.
    I always leave 1 byte longer array, and set last byte to 0...
    I'm not sure what last 3 array have with pass array...

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