RTWin serial packet input: package start is wrong

1 view (last 30 days)
Hello! I am using RTWin to communicate via serial port with a microcontroller for Hardware-in-the-loop simulation purposes. The microcontroller sends packets with 200Hz frequency which are received in Simulink with the Serial Packet Input Block. The packet is something like {'5*uint8','16*int16','int32'}. In most cases communication works great, however in random situations the Serial Packet Input Block does not find the beginning of the packet correctly. For example it takes the 3rd int16 and starts making the 5 uint8s from there, so in the end the information does not make any sense. Is there a way to counteract this behaviour? How exactly is the Serial Packet Input Block supposed to find the beginning of a serial message?
Any help will be greatly appreciated.

Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!