Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Rs-422 Live Data manipulation

mrcoding
2022-01-16
2022-01-20
  • mrcoding - 2022-01-16

    Hello everyone,

    This is my first time on this forum and I'm new to the world of codesys.

    I am currently working on a project which uses RS-422 protocol. The plan is to read the data off of the
    RS-422 protocol and manipulate the live data.

    I am having trouble with dealing with live data. There is data coming through and put into a buffer and it is observed on a STRING output.

    I would like help/advice on whether it is possible to detect a start bit and an end bit? If this is possible, then how can I pick out certain packages and store them in different buffers?

    Thank you for reading post, I hope I can get a solution soon.

     
  • matthijs vs - 2022-01-20

    Which protocol do you use?
    packages are usually separated by a pause or a special character.

     
  • mrcoding - 2022-01-20

    Hello,

    It is an RS-422 protocol which consists of
    - 3 consecutive bytes in a sub-frame/package.
    - baud 9600
    - odd parity
    - 1 stop bit

    This data is coming in as Ascii characters.

     
  • matthijs vs - 2022-01-20

    The Stop bit / Parity bit are only used by hardware and not read into the STRING.
    You need to find a patern (for example, start byte is always x or has x bit set?) and create a counter that is reset on each match

     

Log in to post a comment.