Hello,
I'm busy with software to receive RS232 (ASCII) from a PC.
The software what i made works BUT...
My sofware is based on receiving frame by frame like:
Frame1: <EOT>1155<STX>06151<ETX>0
<wait>
Frame2: <EOT>2255<STX>06150<ETX>3
<wait>
etc.
I check the length of the message and filter the message. No problem with that.
BUT, sometimes the PC sends in one frame more messages like:
<EOT>1155<STX>06151<ETX>0<EOT>2255<STX>06151<ETX>3<EOT>3311<STX>0121234<ETX>2<space?><EOT>2255<STX>06151<ETX>3..... etc.
When the PC sends this frame i know the length of the total frame but i don't know the information what's in the frame.
My question is, what is the best way to handle those frames?
I was thinking to make a pointer in a loop and scan for a <EOT> and extract the information till the next <ETX> and use the message length as limit of the scan pointer.
Ps. i need the information between the <EOT> / <STX> and <STX> / <ETX>
Maybe other people here got some better solutions?
Best regards
I'm busy with software to receive RS232 (ASCII) from a PC.
The software what i made works BUT...
My sofware is based on receiving frame by frame like:
Frame1: <EOT>1155<STX>06151<ETX>0
<wait>
Frame2: <EOT>2255<STX>06150<ETX>3
<wait>
etc.
I check the length of the message and filter the message. No problem with that.
BUT, sometimes the PC sends in one frame more messages like:
<EOT>1155<STX>06151<ETX>0<EOT>2255<STX>06151<ETX>3<EOT>3311<STX>0121234<ETX>2<space?><EOT>2255<STX>06151<ETX>3..... etc.
When the PC sends this frame i know the length of the total frame but i don't know the information what's in the frame.
My question is, what is the best way to handle those frames?
I was thinking to make a pointer in a loop and scan for a <EOT> and extract the information till the next <ETX> and use the message length as limit of the scan pointer.
Ps. i need the information between the <EOT> / <STX> and <STX> / <ETX>
Maybe other people here got some better solutions?
Best regards