フィルターのクリア

serial communication device without driver

5 ビュー (過去 30 日間)
Ibnul Feraji Alam
Ibnul Feraji Alam 2022 年 3 月 2 日
コメント済み: Walter Roberson 2022 年 3 月 3 日
I want to send a signal or generate a signal for a serial control device connecting via RS232.
point to point link, Baud rate 38400, data bits 8, parity none, stop bits 1, CRC 16.
I want to generate or use matlab function or simulink to get a signal of fixed length of 6 bytes. The massage are transfered in 15ms cycle.
Example signal : AA ID AA 02 IC IE.
I want to generate or send a signal (AA ID AA 02 IC IE) keeping in mind all the parameters.

回答 (1 件)

Walter Roberson
Walter Roberson 2022 年 3 月 2 日
That uses the Instrument Control Toolbox.
You could also use MATLAB Function Block, and code in calls to serialport() and related functions; https://www.mathworks.com/help/matlab/ref/serialport.html
  6 件のコメント
Ibnul Feraji Alam
Ibnul Feraji Alam 2022 年 3 月 3 日
To create the Signal Vector which blocks can I use? Is their any signal block in matlab to send fixed length data or I have to build one? A demo or a link will be very helpful.
Also is it possible to send the Signal Vector through "write();" command if I want to use "serialportObj" with STX...Data...ETX?
Thank You
Walter Roberson
Walter Roberson 2022 年 3 月 3 日
There is no particular block in Simulink to send fixed length signals. The serial send block will send whatever shows up on its input port. Most signals in Simulink are fixed-length signals.
In theory you could be feeding the output of a triggered system or an if/then block into the serial send block. It will not care: it will send whatever is in the input port when it gets triggered (it only makes sense to use such a block with a discrete section rather than a continuous section.)
Generally speaking if you were wanting to send a block of calculated results not all created at the same time, and it was important that they be transferred at regular times or with a regular header for the block, then you could use a buffer block.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeBlock Libraries についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by