I am trying to read values from a FTDI device. I am using loadlibrary and calllib functions.
ptr_handle = libpointer('voidPtrPtr',handle);
[err] = calllib('ftd2xx64', 'FT_Open', int32(0), ptr_handle);
temp_req = [int8(temp_req_id) 0];
size_temp_req = uint32(strlength(temp_req_id));
bytes_written = libpointer('uint32Ptr',0);
err = calllib('ftd2xx64', 'FT_Write',ptr_handle,temp_req,size_temp_req,bytes_written);
queue_size = libpointer('uint32Ptr',99);
[err] = calllib('ftd2xx64', 'FT_GetQueueStatus', ptr_handle, queue_size);
Photo from program documentation
When I do write command i expect to receive the temperature value from the device using read command. But after write the status of queue buffer remains 0 so I have nothing to read from the queue. But the device acknowledges that number of bytes written was 13.
To check is the value of queue_size is getting updated i tried to initialize the value of queue_size to 99. but the output was 0.
What could be wrong with the code?
I have attached the header an library for reference. any help is kindly appreciated.