Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MATLAB (on Windows) unable to read from NanoVNA V2_2 #153

Open
amritzoad opened this issue Jul 13, 2022 · 0 comments
Open

MATLAB (on Windows) unable to read from NanoVNA V2_2 #153

amritzoad opened this issue Jul 13, 2022 · 0 comments

Comments

@amritzoad
Copy link

Dear everyone,

I found it to be very confusing to make the NanoVNA V2_2 to work with MATLAB.

On Matlab, a serialport object is to be used for serial port communication.

I am quite certain that I can send commands to the NanoVNA V2_2 like sweepStartHz, sweepStepHz, and swepPoints followed by the respective number, and the device responds to these commands by going into USB Mode.

The problem comes when I try to read the data from the device. I am just not able to do so. The MATLAB has commands like read and readline but how to use them with the NanoVNA V2_2? Is it the limited Matlab functionality of something else? I just cannot understand.

The code that works so far in my opinion is as follows:

port = 'COM4';
BaudRate = 9600;
device = serialport(port, BaudRate);
start = 100e6;
stop = 2e9;
points = 101;
step = (stop-start)/(points);
writeline(device,"sweepPoints"+ num2str(typecast(points,'uint16')));
writeline(device,"sweepStartHz"+ num2str(typecast(step,'uint64')));
writeline(device,"sweepStepHz"+ num2str(typecast(step,'uint64')));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant