Anyone with any experience doing this?
I can use the Matlab serial command to open COM4, I'm just not sure how to open the acutal device using serial commands and then how to set up the device and send commands. Any examples that may help?
Thanks.
loadlibrary('ftd2xx.dll', 'ftd2xx.h');
h=libpointer('uint32Ptr', uint32(0));
disp('opening');
s=calllib('ftd2xx', 'FT_Open', 0, h);
if (s ~= 0)
disp('open error');
return;
end
disp('set baud rate');
s=calllib('ftd2xx', 'FT_SetBaudRate', h, 9600);
if (s ~= 0)
disp('set baud rate error');
return;
end
I'm doing the same kind of thing and having lots of trouble communicating too. The VCP commands I've tried are:
USB = serial('COM3');
fopen(USB);
fwrite(USB, 5, uint8); // defaults to uchar
fclose(USB);
Now this did work for me when I tested it before Christmas but I can't for the life of me get a response now... though the TXE and RXF lines do respond to the commands and stay low allowing data through I never see anything on the data bits.
The second lot of code you used with the libraries requires the driver files to be installed, but at the same time I can't quite get that working either, there's another thread that insinuated the header file that comes with the drivers isn't correct, but I had no response on that thread about an actual correct header file and I don't know enough to re-write one myself.
"Allen Hill" <allena...@yahoo.com> wrote in message <ho7u35$nb3$1...@fred.mathworks.com>...