I'm quite new with using ScriptCommunicator. I need to get whole data
packet and then process it. The packet is coming over uart and it is
delimited by STX and ETX characters (so it is easy to recognize the data
packet). I'm using function dataReceivedSlot(data) to get the data, but
this function is called asynchronously, so sometimes I'm getting just part
of the packet and then in next call is available the other part, etc. Could
you please advise how to get remaining data in case that the
dataReceivedSlot returns just part of incoming data packet and on the other
hand how to left the data coming from next packet in the input buffer (to
be processed next time, when whole next packet is available).
Hi,
I'm quite new with using ScriptCommunicator. I need to get whole data
packet and then process it. The packet is coming over uart and it is
delimited by STX and ETX characters (so it is easy to recognize the data
packet). I'm using function dataReceivedSlot(data) to get the data, but
this function is called asynchronously, so sometimes I'm getting just part
of the packet and then in next call is available the other part, etc. Could
you please advise how to get remaining data in case that the
dataReceivedSlot returns just part of incoming data packet and on the other
hand how to left the data coming from next packet in the input buffer (to
be processed next time, when whole next packet is available).
Thank you in advance for any hint.
Regars, Martin
Hi Martin,
you can find an example script in the attachment which prints all data between STX and ETX.
I Hope this helps.
Regards,
Stefan
Last edit: Stefan Zieker 2019-05-28
Hi Stefan,
It helps a lot!
Thank you for quick and perfect answer.
Regards, Martin