Main Content
Binary Encoding/Decoding Loopback Test
This model shows how to send Binary data over a serial link.
The transmitted data are: [8,5,170,1,N,170,2,44,M]
. This byte stream contains two messages along with other elements:
The first byte, 8, is a count of the remaining number of bytes in the stream.
The second byte, 5, is an extraneous value (EV).
[170,1,N]
is message 1 (M1).[170,2,44,M]
is message 2 (M2).N and M are numbers between 0 and 255 that are incrementing and decrementing, respectively.
Even though the data stream includes extraneous bytes (5 in this case), the FIFO Read BINARY block can handle and ignore this extra information. Scope 1 displays the received message 1 data. Scope 2 displays the received message 2 data.
model = 'slrt_ex_serialbinarytest';
open_system(model);
bdclose(model);