SerialUSB object - how to receive data in PC

Hi

I am using Arduino Due, and I want to send a large amount of data to PC.
For the sake of higher data rates, I use SerialUSB object to send data over the Native USB port of the Due. In the product page of Due, It is mentioned that it sends the data over Native USB port supporting CDC serial communication.

In MATLAB, for example, what is the way to receive data?

If it is not possible to receive data in MATLAB, how can I do that in another programming environment, like C or Python?

(I know maybe it's a programming/software question and not an Arduino/Due question....)

Thanks in advance.

https://forum.arduino.cc/index.php?topic=154424.0

When I get home I'll post the code I used to send data to Matlab with, I used DMA to fill a buffer to send over USB as 2 uint8_t and then made them into a uint16_t in Matlab, the DMA part I got from this forum.

In the meantime, in Matlab you communicate with the due like a ordinary COM port, in Windows at least, read up upon Matlab COM port communication, it's really easy.

This is just a quick version of the code I used in Matlab:

s = serial('COM10');
set(s, 'DataBits', 8);
set(s, 'StopBits', 1);
set(s, 'BaudRate', 115200);
set(s, 'Parity', 'none');
set(s, 'InputBufferSize', 3000000);
fopen(s);

b_data = fread(s, 3000000, 'uint8');
LSB = b_data(1:2:end);
MSB = b_data(2:2:end);
result = ((MSB .* 256) + LSB);

fclose(s);
delete(s);
clear s;
clear b_data LSB MSB;

Hi Microzod_,
Is there any way to do this on labview?
Thanks you,
Ruoi

Microzod_:
This is just a quick version of the code I used in Matlab:

s = serial('COM10');

set(s, 'DataBits', 8);
set(s, 'StopBits', 1);
set(s, 'BaudRate', 115200);
set(s, 'Parity', 'none');
set(s, 'InputBufferSize', 3000000);
fopen(s);

b_data = fread(s, 3000000, 'uint8');
LSB = b_data(1:2:end);
MSB = b_data(2:2:end);
result = ((MSB .* 256) + LSB);

fclose(s);
delete(s);
clear s;
clear b_data LSB MSB;