problems on reordering data from serial

조회 수: 1 (최근 30일)
Danilo NASCIMENTO
Danilo NASCIMENTO 2013년 11월 14일
답변: Walter Roberson 2013년 11월 15일
Is there anyway of reordering the signals that have been received through serial? For example, I'm sending 1 2 3 and it is coming 3,1,2 or 1,3,2 or even 1,2,3. I want always the same sequence.
  댓글 수: 2
Walter Roberson
Walter Roberson 2013년 11월 14일
Please show the command you are using to write the signals, and the command you are using to read the signals.
Danilo NASCIMENTO
Danilo NASCIMENTO 2013년 11월 15일
I'm not using commands, only blocks in simulink. I'm sending 3 constant signals, 1 2 and 3 and I am putting a serial receive connected to a demux so I can view these three different signals. The problem is everytime I run the simulation the signals appear in different orders. That might some block so I can reorder these signals received..

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2013년 11월 15일
It sounds like you are not mux'ing the signals before they get to the transmitter block.
Alternately you are not using a switch block clocked by time to select which signal is going to reach the transmitter block.
Remember to check that the datatype for the values being transmitted is the same as what you are pulling out. For example if your signals are double precision numbers that encode integers, then do not pull them off the receive port as if they are bytes.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Modeling에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by