Message Boards Message Boards

Interface a computer with a USB device, say a wired mouse from Dell?


Dear friends,

We are trying to learn how to interface with devices over USB. For a start, we thought about trying to interface with a wired mouse of Dell make. We proceeded as per the following steps.. Where there is "FTD2XX.dll", we entered the path of the "dinput8.dll" on our system.


        FTListDevices =  DefineDLLFunction["FT_ListDevices", "FTD2XX.dll",   "unsigned long", {"unsigned long", "System.Text.StringBuilder",   "unsigned long"}]

        FTOpenEx =  DefineDLLFunction["FT_OpenEx", "FTD2XX.dll",   "unsigned long", {"string", "unsigned long", "out unsigned long"}]

        FTClose = DefineDLLFunction["FT_Close", "FTD2XX.dll",   "unsigned long", {"unsigned long"}]

        FTSetBaudRate =  DefineDLLFunction["FT_SetBaudRate", "FTD2XX.dll",   "unsigned long", {"unsigned long", "unsigned long"}]

        FTSetBitMode =  DefineDLLFunction["FT_SetBitMode", "FTD2XX.dll",   "unsigned long", {"unsigned long", "unsigned char", "unsigned char"}]

        FTWrite = DefineDLLFunction["FT_Write", "FTD2XX.dll",   "unsigned long", {"unsigned long", "char[]", "unsigned long", "out unsigned long"}]

        FTGetBitMode =  DefineDLLFunction["FT_GetBitMode", "FTD2XX.dll",   "unsigned long", {"unsigned long", "out unsigned char"}]

        st = NETNew["System.Text.StringBuilder", 100];

However, when we typed in: FTListDevices[0, st, BitOr[2, 16^^40000000]]; we did not get a '0' as expected, when there is no error.

Please help. Have we not used the correct .dll or is there any other issue, we are missing out? How do we know the correct .dll of our mouse?

POSTED BY: Shishir Sahay
3 months ago

Group Abstract Group Abstract