FTD2XX.h & Linux Tumbleweed & LIBFTD2XX.so.1.4.27

7 ビュー (過去 30 日間)
Gaston Melo
Gaston Melo 2023 年 4 月 19 日
Hi to all, Im using Matlab on linux OS and Im trying to use the FTD2XX.h with matlab. I download the source code from FTDI home pag for linux and follow the instruccion to copy libraries on /usr/local/lib. Also I use modprobe to stop the ftdi_sio in linux and be able to use the ftd2xx.h with the device attached.
Im able to run examples like Read EEPROM of the device but with the matlab code I can't make it work. What I tried:
1) Loadlibrary from /usr/local/lib
2)Copy libraries and header in the folder where I have the m file
If I run the FTDI examples like read or write EEPROM from folder examples of FTDI, Im able to run it with problems. But with Matlab I can't even open the device. Could it be that the path to libraries is wrong?
the full code:
genpath(fullfile('/home/gaston/Matlab_mfiles'));
loadlibrary('libftd2xx.so.1.4.27','ftd2xx.h','alias','d2xx');
libfunctionsview ('d2xx')
device = 0;
nullp=libpointer('voidPtr',0);
%%%%%%
pid=libpointer('uint32Ptr',0);%DWORD is uint32
vid=libpointer('uint32Ptr',0);
%%%%%library
libraryV=libpointer('uint32Ptr',0);
%%%%%deviceinfo
ptrType=libpointer('uint32Ptr',0);
ptrID=libpointer('uint32Ptr',0);
arrayA=libpointer('cstring',blanks(20));
arrayB=libpointer('cstring',blanks(20));
%%%%%
ft_handle=libpointer('voidPtr',0);
ft_status=calllib('d2xx','FT_GetLibraryVersion',libraryV);
version=libraryV.value;
dec2hex(version,6)
ft_status=calllib('d2xx','FT_GetVIDPID',vid,pid);
get(vid)
get(pid)
ft_status=calllib('d2xx','FT_GetDeviceInfo',ft_handle,ptrType,ptrID,arrayA,arrayB,nullp);
ptrType.value
ptrID.value
arrayA.value
arrayB.value

回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import and Analysis についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by