필터 지우기
필터 지우기

Serial Data signal Generation

조회 수: 8 (최근 30일)
Ibnul Feraji Alam
Ibnul Feraji Alam 2022년 3월 9일
댓글: Benjamin Thompson 2022년 3월 15일
How to generate a signal of fixed length of 6 bytes. The massage are transfered in 15ms cycle. Baud rate 38400, data bits 8, parity none, stop bits 1, CRC 16.
Example signal : AA 20 AA 02 IC IE.
Serial Data Format

채택된 답변

Benjamin Thompson
Benjamin Thompson 2022년 3월 9일
See if one of the examples on the File Exchange will work for you:
Then if you run into problems ask a specific question and post your work.
  댓글 수: 8
Ibnul Feraji Alam
Ibnul Feraji Alam 2022년 3월 15일
I am having trouble over sending the signal over serial send block.
Which generator signal I need to use. Like if I want to send hex "AA" or decimal "170" or binary "10101010" which "create and connect generator" I need to use. Also If you could tell me the parameters that would be helpful.
Is there anything needed to be changed for the header and terminator?
Thank you.
Benjamin Thompson
Benjamin Thompson 2022년 3월 15일
I don't know what the "create and connect generator" does. Connect a constant source block to your Serial Send Block input. Give the constant block a value of 170 decimal, and configure its output data type to uint8.
As for the other parameters, it is your device. The header and terminator could be your STX and ETX characters. Blocking mode, you may have to try it with and without that checked to see what works best for timing.
Then when you are sure the serial port is sending out three bytes (STX + 170 + ETX), then make the middle part the full six bytes long using the mux block like I showed in my example.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Direct Interface Communication in Simulink에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by