in reply to Re^4: deal data transfer
in thread deal data transfer

let's focus on perl programming.

I was. Specifically, the IEC 60870-5-101 telegram structure.

But I guess you misunderstood me.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Replies are listed 'Best First'.
Re^6: deal data transfer
by xiaoyafeng (Deacon) on May 18, 2011 at 03:37 UTC
    eh, well, I thought whatever protocol the program runs over, the basic procedure would be the same, listen the port, receive request, fetch data somewhere, pack etc. Maybe I was wrong. any suggestions if protocol is IEC 101?




    I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction

      In general, when looking to try and help someone, it is easier to read actual documentation, than go through an extended question and answer trying to tie down the details.

      Questions like: are the numeric values little or big-endian; how are the checksums calculated; are the packets fixed or variable length; if variable, are they length prefixed or post-delimited; etc. All of this is clear from the documentation.

      Which brings me to the question: what is it that you are really asking for help with? What is it that you are having trouble doing?


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

        Thanks! BrowserUk. Actually I have no any idea about data transfer in perl. Now first thing I'm a little confused is how to check a variable length data packet correctly. It seems I can use 2 ways below to treat it:

        1. read 4bytes to know size of packet, reset length parameter, read rest of it and check end char and checksums
        2. read data in a loop, if there is no any data received in a time (e.g 3 sec) or read function return 0, check if last 2 bytes are correct checksum and end char.
        So am I on the right way? Which way above is better or correct? Is there any codes in modern perl about data transit in network or serial for reference? Please help

        Again, apologies for my poor english I hope i express my question clear enough.





        I am trying to improve my English skills, if you see a mistake please feel free to reply or /msg me a correction