Simulink - Serial Receive - Header

3 ビュー (過去 30 日間)
Kai
Kai 2013 年 12 月 11 日
回答済み: wt s 2021 年 3 月 27 日
Hey,
I'm reading serial data from a Interial Measurement Unit and dont know how to define a header properly. One frame is 56byte long (with 48byte of data). On the picture you can see the Block Parameters on the left and the Data on the right. The first 2 bytes (255 2) are the header, ending is 3.
I don't know the synatx to define the header, when i simply type 255 into header, i get only zeros for data.
Thanks for helping!

回答 (6 件)

Suneesh
Suneesh 2013 年 12 月 13 日
Try HEX. For example 'FF' for 255

Kai
Kai 2013 年 12 月 13 日
Already tried that. Dont work. But i saw unter Terminator you can choose: CR('\r') for Carriage Return (ASCII). I have a start of text STX and ETX at the end, but there is no c code for it like \r.

nabeel Fattah
nabeel Fattah 2015 年 11 月 5 日
hello Kai, I have the same problem with the header in serial receive block. did you solve your problem? if, yes. could you please let me know what syntax (format) of header did you use? thanks

tjh t
tjh t 2016 年 5 月 11 日
Hello, I have the same problem with you.Have you solved the problem yet? Can you help me? Thanks.

xie jiaxin
xie jiaxin 2017 年 4 月 26 日
Header Specify data that marks the beginning of your data block. The header indicates the beginning of a new data block and the simulation will disregard data that occurs before the header. The header data is not sent to the output port. Only data that occurs between the header and the terminator is sent to the output port. By default none or no header is specified.
Anything entered in the header is treated as a character. If you want to specify numbers, you need to use the corresponding ascii characters for them. For example, to specify [40 41], you can enter () in the field. Note that single quotes are also treated as characters. You can use the corresponding ascii characters for the numbers between 32 and 126.

wt s
wt s 2021 年 3 月 27 日
hi,Kai,did you solve this problem? may you help me get the correct synatx of the header that corresponded ascii characters more than 127.

カテゴリ

Help Center および File ExchangeDiscrete-Event Simulation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by