Sending data from RAM to USB
#15
Here is the code I used in Visual Basic for opening and closing the FTDI device, using the .dll:


Code:
Public Sub OpenFTDI()
    strDescription = "SuperCard Pro" + Chr$(0)          ' null terminated name string
    ftStatus = FT_OpenEx(strDescription, FT_OPEN_BY_DESCRIPTION, lngHandle) ' open device with specified name and store handle
    If ftStatus = FT_OK Then
        HasSCP = True
        If FT_SetTimeouts(lngHandle, 100, 0) <> FT_OK Then GoTo BadFTDI     ' set timeout to 100ms

        ftStatus = FT_SetLatencyTimer(lngHandle, 2)     ' set lowest latency possible
        If ftStatus <> FT_OK Then GoTo BadFTDI
        
        ftStatus = FT_SetUSBParameters(lngHandle, &H10000, &H10000) ' set USB receive/transmit buffer to 64K * 2
        If ftStatus <> FT_OK Then GoTo BadFTDI
        
    End If
    Exit Sub

BadFTDI:
    Call CloseFTDI
End Sub


' This routine closes the FTDI device driver, if it was opened.

Public Sub CloseFTDI()
    If lngHandle <> 0 Then FT_Close (lngHandle)         ' close device if open
    HasSCP = False                                      ' no SuperCard Pro
    lngHandle = 0                                       ' release handle
End Sub
Reply


Messages In This Thread
Sending data from RAM to USB - by dfstudios - 01-18-2016, 02:41 PM
RE: Sending data from RAM to USB - by admin - 01-18-2016, 03:04 PM
RE: Sending data from RAM to USB - by dfstudios - 01-18-2016, 04:18 PM
RE: Sending data from RAM to USB - by admin - 01-18-2016, 09:54 PM
RE: Sending data from RAM to USB - by dfstudios - 01-19-2016, 02:31 PM
RE: Sending data from RAM to USB - by admin - 01-19-2016, 08:32 PM
RE: Sending data from RAM to USB - by dfstudios - 01-27-2016, 01:59 PM
RE: Sending data from RAM to USB - by admin - 01-27-2016, 02:45 PM
RE: Sending data from RAM to USB - by dfstudios - 01-27-2016, 03:23 PM
RE: Sending data from RAM to USB - by admin - 01-27-2016, 04:30 PM
RE: Sending data from RAM to USB - by dfstudios - 01-27-2016, 04:36 PM
RE: Sending data from RAM to USB - by dfstudios - 01-27-2016, 04:31 PM
RE: Sending data from RAM to USB - by admin - 01-27-2016, 04:35 PM
RE: Sending data from RAM to USB - by dfstudios - 01-27-2016, 04:47 PM
RE: Sending data from RAM to USB - by admin - 01-27-2016, 04:41 PM
RE: Sending data from RAM to USB - by dfstudios - 01-27-2016, 04:50 PM
RE: Sending data from RAM to USB - by admin - 01-27-2016, 04:44 PM
RE: Sending data from RAM to USB - by dfstudios - 01-27-2016, 04:52 PM
RE: Sending data from RAM to USB - by admin - 01-27-2016, 05:02 PM
RE: Sending data from RAM to USB - by admin - 01-27-2016, 05:04 PM
RE: Sending data from RAM to USB - by dfstudios - 01-27-2016, 05:36 PM



Users browsing this thread: 2 Guest(s)