Using XBEE Explorer with D2XX drivers

I am trying to use the D2XX drivers at http://www.ftdichip.com with my Xbee Explorer and Xbee Pro chip. So far I have been working through the examples in the D2XX Programmers Guide.

I can do a FT_CreateDeviceInfoList and FT_Open but when I then try to do an FT_Write I get an access violation. I’ve checked my code and am pretty sure that the arguments are correct.

I’ve attached what I think is the relevant code.

typedef FT_STATUS (*t_Write)(FT_HANDLE, LPVOID, DWORD, LPDWORD);

int main(array<System::String ^> ^args)
{
	FT_STATUS ftStatus;
	FT_HANDLE ftHandle;
	DWORD BytesWritten;
	DWORD numDevs;
	DWORD EventDWord;
	DWORD TxBytes;
	DWORD RxBytes;
	DWORD BytesReceived;
	char RxBuffer[256];
	char TxBuffer[2];

	t_Write Write;

	// Get function pointer
	Write = (t_Write)GetProcAddress(hinstLib, "FT_Write");
	if (Write == NULL) {
		printf("ERROR: unable to find DLL function FT_Write\n");
		FreeLibrary(hinstLib);
		return 1;
	}

and the offending bit of code

	ftStatus = Write(ftHandle, TxBuffer, sizeof(TxBuffer), &BytesWritten);
	if (ftStatus == FT_OK) {
		// FT_Write OK
		std::cout << "FT Write OK\n";
	}
	else {
		// FT_Write Failed
	}

The call to ‘Write’ causes an access violation. I’ve checked that ftHandle is being populated.

It’s ten years since I coded day to day and I’ve never coded under windows but I don’t think I’ve forgotten that much! I wondered if it could be something to do with installation of the drivers but I’ve been through that twice and all appears to install correctly. Also, as other calls to the library work.

Any ideas where to look next would be appreciated. Has anyone else used these libraries with Visual C++ with success?

J

Dear jmckee,

I am almost in the same situation as you were in January. Did you have any succes in resolving this issue?

I am also curious if your explorer turns up as a device any way. In my case it does not while for example Arduino boards turn up just fine using the D2XX driver.

I checked in MAX/MSP and with Arduino software which with the VCP driver works fine (I try to change because of latency issues).

Maybe somebody else has an idea?

Best, Hans.