Go Down

Topic: Serial Monitor Data - how to access in MATLAB (Read 1 time) previous topic - next topic

alirazaviarduino

Hi

I am using Arduino Due. Maybe my question be unrelated or not an Arduino question....

Consider two cases:

1- Using UART port: When using UART port to send data to PC (Using Serial object in Arduino code), the data I sent from Arduino can be seen on the Serial Monitor.
When I want to use MATLAB to receive the data, I use serial('COMx') command in MATLAB to connect to the serial port, and exactly see the same data which is appeared on Serial Monitor (At this time, the Serial Monitor should be closed, or the MATLAB does not recognize the serial port.)

2- Using Native USB port: When using USB port to send data to PC (Using SerialUSB object in Arduino code), the data I sent from Arduino can be seen on the Serial Monitor.
But, in this case, I am not able to see the data on MATLAB. I test various settings and search through the forums and MATLAB website and found nothing to solve the problem.

My questions is clearly as follows:

1- Is there a simple way to send the data on Serial Monitor to MATLAB in real time?
2- If no, what is the way to see the data sent from Arduino (using SerialUSB object) in MATLAB?

Thanks in advance.

UnderJollyRogers

You can try using Simulink Real-Time Desktop. You can send information to Matlab using serial.print, and use one of the blocks available to interpretate the signal. I did a small program and I reached a stable transmission speed of 25 ms.

alirazaviarduino

You can try using Simulink Real-Time Desktop. You can send information to Matlab using serial.print, and use one of the blocks available to interpretate the signal. I did a small program and I reached a stable transmission speed of 25 ms.
I used serial.print to send data and I didn't have any problem with it in MATLAB (I mentioned it in my post....)

Because the baud rate of the UART is limited to 115200bps, and I want a substantially higher baud rate, I tried using USB Native port

dquintero98

Did you solve it alirazaviarduino? I am trying to use the MATLAB library addon transmitting serial data simultanously but have been unable to get it to work. What work around did you use?

Go Up