Stream Data from serial port device to screen

조회 수: 12 (최근 30일)
Jason Riley
Jason Riley 2020년 10월 16일
답변: Nitin Kapgate 2020년 10월 28일
I have a serial device, that turns up on COM6. It i sending data continuously to an app, it sends in groups of 4 comma separated values. (with the potential for non-conformal data-points as interupts- e.g. start/stop.)
what i would like to do is stream this directly to the app screen as either a plot of 4 lines, or 4 gauges or four boxes with numbers in, not really too bothered about the format on screen as long as its readable, i would obviously also like to store said data as it comes in.
I was looking for some poitners on how to do this, but using searches didn't find anything useful in the answered questions here.
Thanks
JR
p.s. i have base matlab and instrument control, if i need other toolboxes to enable this please advise

답변 (1개)

Nitin Kapgate
Nitin Kapgate 2020년 10월 28일
You can refer the guide about Serial Port Devices to learn about communicating between two MATLAB and devices connected to a serial port.
The communication through a serial port is established with a serialport object created in the MATLAB workspace.
Before you can write or read data, the serialport object and the instrument must have identical communication settings. You can refer the documentation to Configure Serial Port Communication Settings.
You can get this functionality in the base MATLAB itself, so no other additional toolbox is needed.

카테고리

Help CenterFile Exchange에서 Serial and USB Communication에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by