フィルターのクリア

Check output of MATLAB at serial port

4 ビュー (過去 30 日間)
Sagar Damle
Sagar Damle 2014 年 2 月 23 日
コメント済み: Walter Roberson 2014 年 2 月 23 日
For studying purpose, I want to just check whether MATLAB can send some data to serial port (COM1) or not. Can anyone suggest me a simple program to do this? Also, if I want to check whether the received data is correct or not, how can I do that? Should I connect probe of a DSO(digital storage oscilloscope) between Rx(Receive data) and GROUND pins of the port and check the received pattern bit by bit? Or is there any other simple method to check the output (which does not require a device such as a microcontroller as a receiver?) Thank you for your answer in advance.

回答 (1 件)

Walter Roberson
Walter Roberson 2014 年 2 月 23 日
Connecting a probe in the way you suggest is not likely to work. Serial ports use a data framing protocol that you data is unlikely to match. Or is the output you are referring to already in RS232 serial form?
  2 件のコメント
Sagar Damle
Sagar Damle 2014 年 2 月 23 日
編集済み: Walter Roberson 2014 年 2 月 23 日
Yes,I want the output in RS232 serial form. Actually, I want to give that output to some microcontroller. But before that,I want to check whether the output is correct or not.
(In our project, MATLAB will give some output for one condition and some other output for another condition. This should be detected by a microcontroller and then it should perform further actions.)
I will read the page you have referred and ask questions if there is a need.
Thank you!
Walter Roberson
Walter Roberson 2014 年 2 月 23 日
If your output is one bit at a time, then you would need to package the bit inside a byte in order to send it over RS232 in normal form.
To send individual bits you can also toggle the DTR pin, but that is not recommended; it has an unspecified latency and you are unlikely to be able to make clean pulses.
If you have a true parallel port (not a USB parallel port) then it would be better suited to sending individual bits.
Better, though, is to use a D/A convertor or a DAQ with a digital output.

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

カテゴリ

Help Center および File ExchangeData Acquisition Toolbox Supported Hardware についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by