exact output format of Packet output
1 次查看(过去 30 天)
显示 更早的评论
In the following attached model, I send a command ('*00P'+CR) from terminal(COM1) and receive the data in simulink model through packet input. and after doing some comparision I send out 7 bytes of data through packet output and zero when no command is being sent. COM1 is connected to COM8(simulink - PacketIO). I receive the data in the terminal as soon as I send the command. I want to know the exact format of the received data through Packet output because now I want to receive command through a micro controller and send the data back to it. Currently my micro controller is coded in such a way :
while(1) { send_command('*00P\r') // through UART for i = 1 to 7 { receive a byte and print on the terminal } delay_ms(1000) }
now the received bytes are scrambled up and not in the same order as I am sending through simulink ( and also the loopback test that I did). Is it a problem of using delay in the code or output format of the Packet output block is different than I am thinking ?
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Block Libraries 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!