PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197

PHP User Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: bbcode_highlight in ..../includes/functions.php on line 4197
i want my code to perpect-VBForums
Results 1 to 31 of 31

Thread: i want my code to perpect

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    i want my code to perpect

    hello, my code here is almost perpect...

    but....

    the problem is how to update the serial number of my box

    this code can change the sn already...

    VB Code:
    1. Private Declare Function FT_Open Lib "FTD2XX.DLL" (ByVal intDeviceNumber As Integer, ByRef lngHandle As Long) As Long
    2. Private Declare Function FT_Close Lib "FTD2XX.DLL" (ByVal lngHandle As Long) As Long
    3. Private Declare Function FT_Read Lib "FTD2XX.DLL" (ByVal lngHandle As Long, ByVal lpszBuffer As String, ByVal lngBufferSize As Long, ByRef lngBytesReturned As Long) As Long
    4. Private Declare Function FT_Write Lib "FTD2XX.DLL" (ByVal lngHandle As Long, ByVal lpszBuffer As String, ByVal lngBufferSize As Long, ByRef lngBytesWritten As Long) As Long
    5. Private Declare Function FT_SetBaudRate Lib "FTD2XX.DLL" (ByVal lngHandle As Long, ByVal lngBaudRate As Long) As Long
    6. Private Declare Function FT_SetDataCharacteristics Lib "FTD2XX.DLL" (ByVal lngHandle As Long, ByVal byWordLength As Byte, ByVal byStopBits As Byte, ByVal byParity As Byte) As Long
    7. Private Declare Function FT_SetFlowControl Lib "FTD2XX.DLL" (ByVal lngHandle As Long, ByVal intFlowControl As Integer, ByVal byXonChar As Byte, ByVal byXoffChar As Byte) As Long
    8. Private Declare Function FT_ResetDevice Lib "FTD2XX.DLL" (ByVal lngHandle As Long) As Long
    9. Private Declare Function FT_SetDtr Lib "FTD2XX.DLL" (ByVal lngHandle As Long) As Long
    10. Private Declare Function FT_ClrDtr Lib "FTD2XX.DLL" (ByVal lngHandle As Long) As Long
    11. Private Declare Function FT_SetRts Lib "FTD2XX.DLL" (ByVal lngHandle As Long) As Long
    12. Private Declare Function FT_ClrRts Lib "FTD2XX.DLL" (ByVal lngHandle As Long) As Long
    13. Private Declare Function FT_GetModemStatus Lib "FTD2XX.DLL" (ByVal lngHandle As Long, ByRef lngModemStatus As Long) As Long
    14. Private Declare Function FT_Purge Lib "FTD2XX.DLL" (ByVal lngHandle As Long, ByVal lngMask As Long) As Long
    15. Private Declare Function FT_GetStatus Lib "FTD2XX.DLL" (ByVal lngHandle As Long, ByRef lngRxBytes As Long, ByRef lngTxBytes As Long, ByRef lngEventsDWord As Long) As Long
    16. Private Declare Function FT_GetQueueStatus Lib "FTD2XX.DLL" (ByVal lngHandle As Long, ByRef lngRxBytes As Long) As Long
    17. Private Declare Function FT_GetEventStatus Lib "FTD2XX.DLL" (ByVal lngHandle As Long, ByRef lngEventsDWord As Long) As Long
    18. Private Declare Function FT_SetChars Lib "FTD2XX.DLL" (ByVal lngHandle As Long, ByVal byEventChar As Byte, ByVal byEventCharEnabled As Byte, ByVal byErrorChar As Byte, ByVal byErrorCharEnabled As Byte) As Long
    19. Private Declare Function FT_SetTimeouts Lib "FTD2XX.DLL" (ByVal lngHandle As Long, ByVal lngReadTimeout As Long, ByVal lngWriteTimeout As Long) As Long
    20. Private Declare Function FT_SetBreakOn Lib "FTD2XX.DLL" (ByVal lngHandle As Long) As Long
    21. Private Declare Function FT_SetBreakOff Lib "FTD2XX.DLL" (ByVal lngHandle As Long) As Long
    22.  
    23. Private Declare Function FT_EE_Program Lib "FTD2XX.DLL" (ByVal lngHandle As Long, ByRef lpData As FT_PROGRAM_DATA) As Long
    24. Private Declare Function FT_EE_Read Lib "FTD2XX.DLL" (ByVal lngHandle As Long, ByRef lpData As FT_PROGRAM_DATA) As Long
    25. Private Declare Function FT_EE_UASize Lib "FTD2XX.DLL" (ByVal lngHandle As Long, ByRef lpdwSize As Long) As Long
    26. Private Declare Function FT_EE_UAWrite Lib "FTD2XX.DLL" (ByVal lngHandle As Long, ByVal pucData As String, ByVal dwDataLen As Long) As Long
    27. Private Declare Function FT_EE_UARead Lib "FTD2XX.DLL" (ByVal lngHandle As Long, ByVal pucData As String, ByVal dwDataLen As Long, ByRef lpdwBytesRead As Long) As Long
    28.  
    29. Private Type FT_PROGRAM_DATA
    30.     VendorId As Integer
    31.     ProductId As Integer
    32.     Manufacturer As Long
    33.     ManufacturerId As Long
    34.     Description As Long
    35.     SerialNumber As Long
    36.     MaxPower As Integer
    37.     PnP As Integer
    38.     SelfPowered As Integer
    39.     RemoteWakeup As Integer
    40.     Rev4 As Boolean
    41.     IsoIn As Boolean
    42.     IsoOut As Boolean
    43.     PullDownEnable As Boolean
    44.     SerNumEnable As Boolean
    45.     USBVersionEnable As Boolean
    46.     USBVersion As Integer
    47. End Type
    48.  
    49. Const FT_OK = 0
    50. Const FT_INVALID_HANDLE = 1
    51. Const FT_DEVICE_NOT_FOUND = 2
    52. Const FT_DEVICE_NOT_OPENED = 3
    53. Const FT_IO_ERROR = 4
    54. Const FT_INSUFFICIENT_RESOURCES = 5
    55. Const FT_INVALID_PARAMETER = 6
    56. Const FT_INVALID_BAUD_RATE = 7
    57.  
    58. Const FT_DEVICE_NOT_OPENED_FOR_ERASE = 8
    59. Const FT_DEVICE_NOT_OPENED_FOR_WRITE = 9
    60. Const FT_FAILED_TO_WRITE_DEVICE = 10
    61. Const FT_EEPROM_READ_FAILED = 11
    62. Const FT_EEPROM_WRITE_FAILED = 12
    63. Const FT_EEPROM_ERASE_FAILED = 13
    64. Const FT_EEPROM_NOT_PRESENT = 14
    65. Const FT_EEPROM_NOT_PROGRAMMED = 15
    66. Const FT_INVALID_ARGS = 16
    67. Const FT_OTHER_ERROR = 17
    68.  
    69. Dim bManufacturer(32) As Byte
    70. Dim bManufacturerID(16) As Byte
    71. Dim bDescription(64) As Byte
    72. Dim bSerialNumber(16) As Byte
    73.  
    74. 'Command Button
    75. Private Sub cmdReadSN_Click()
    76. Dim lngHandle As Long
    77. Dim lngRetVal As Long
    78. Dim lngCount As Long
    79. Dim EEData As FT_PROGRAM_DATA
    80. Dim strDescription As String
    81. Dim strSerialNumber As String
    82.  
    83. LoggerList.AddItem "------------------------------------"
    84.  
    85. If FT_Open(0, lngHandle) <> FT_OK Then
    86.     LoggerList.AddItem "Can't find SarasSoft Boxes"
    87.     LoggerList.AddItem "------------------------------------"
    88.     Exit Sub
    89. End If
    90.  
    91. EEData.Description = VarPtr(bDescription(0))
    92. EEData.SerialNumber = VarPtr(bSerialNumber(0))
    93.  
    94. lngRetVal = FT_EE_Read(lngHandle, EEData)
    95. If RetVal <> FT_OK Then
    96.     LoggerList.AddItem "EE_Read Failed: code " & Str(lngRetVal)
    97.     Exit Sub
    98. End If
    99.  
    100. strManufacturer = StrConv(bManufacturer, vbUnicode)
    101. strManufacturer = Left(strManufacturer, InStr(strManufacturer, Chr(0)) - 1)
    102.  
    103. strManufacturerID = StrConv(bManufacturerID, vbUnicode)
    104. strManufacturerID = Left(strManufacturerID, InStr(strManufacturerID, Chr(0)) - 1)
    105.  
    106. strDescription = StrConv(bDescription, vbUnicode)
    107. strDescription = Left(strDescription, InStr(strDescription, Chr(0)) - 1)
    108.  
    109. strSerialNumber = StrConv(bSerialNumber, vbUnicode)
    110. strSerialNumber = Left(strSerialNumber, InStr(strSerialNumber, Chr(0)) - 1)
    111.  
    112. LoggerList.AddItem "S/N : " & strSerialNumber & ""
    113.  
    114. If FT_Close(lngHandle) <> FT_OK Then
    115.     LoggerList.AddItem "Close Failed"
    116. End If
    117. LoggerList.AddItem "------------------------------------"
    118. cmdReadSN.Enabled = False
    119. cmdChangeSN.Enabled = True
    120. End Sub
    121.  
    122. 'Command Button
    123. Private Sub cmdChangeSN_Click()
    124. Dim lngHandle As Long
    125. Dim lngRetVal As Long
    126. Dim lngCount As Long
    127. Dim EEData As FT_PROGRAM_DATA
    128. Dim strManufacturer As String
    129. Dim strManufacturerID As String
    130. Dim strDescription As String
    131. Dim strSerialNumber As String
    132.  
    133. Dim bOLDSerialNumber(16) As Byte
    134. Dim MyValue
    135. MyValue = InputBox("Edit S/N, if needed", "SarasSoft Boxes (Serial Number) Changer", txtSerialNumber.Text, 5000, 4670)
    136. txtSerialNumber.Text = MyValue
    137.  
    138. If FT_Open(0, lngHandle) <> FT_OK Then
    139.     LoggerList.AddItem "Can't find SarasSoft Boxes"
    140.     Exit Sub
    141. End If
    142. EEData.Manufacturer = VarPtr(bManufacturer(0))
    143. EEData.ManufacturerId = VarPtr(bManufacturerID(0))
    144. EEData.Description = VarPtr(bDescription(0))
    145. EEData.SerialNumber = VarPtr(bSerialNumber(0))
    146.  
    147. lngRetVal = FT_EE_Read(lngHandle, EEData)
    148. If RetVal <> FT_OK Then
    149.     LoggerList.AddItem "EE_Read Failed: " & Str(lngRetVal)
    150.     Exit Sub
    151. End If
    152.  
    153. CopyByteArray bSerialNumber, bOLDSerialNumber
    154.  
    155. StringToByteArray txtSerialNumber.Text, bSerialNumber
    156.  
    157. lngRetVal = FT_EE_Program(lngHandle, EEData)
    158. If lngRetVal <> FT_OK Then
    159.     LoggerList.AddItem "EE_Program FAILED: code " & Str(lngRetVal)
    160.     Exit Sub
    161. End If
    162.  
    163. LoggerList.AddItem "Successfully Change. . ."
    164. LoggerList.AddItem "------------------------------------"
    165.  
    166. If FT_Close(lngHandle) <> FT_OK Then
    167.     LoggerList.AddItem "Close Failed"
    168. End If
    169.  
    170. CopyByteArray bOLDSerialNumber, bSerialNumber
    171. cmdChangeSN.Enabled = False
    172. cmdReadSN.Enabled = True
    173. Call MsgBox("Please Disconnect USB Cable and Connect Back Again !!!  ", vbOKOnly + vbInformation + vbApplicationModal, "Information")
    174. End Sub

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: i want my code to perpect

    i mean........ after writing new serial number to the device

    i want to Iniatilise...........

    Thanks....

  3. #3
    Frenzied Member Devion's Avatar
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    1,049

    Re: i want my code to perpect

    Well...
    "Please Disconnect USB Cable and Connect Back Again" would work, other then that.. try FT_ResetDevice ?

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: i want my code to perpect

    @Devion

    still the same... i think it needs to initialise?

    how to code an FT_ResetDevice?

    need help......

    Thanks......

  5. #5
    Frenzied Member Devion's Avatar
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    1,049

    Re: i want my code to perpect

    FT_Open gives back a long. This is the handle you need to do FT_ResetDevice.

    VB Code:
    1. Public Sub ResetDevice()
    2.       dim lngHandle as long
    3.  
    4.       If FT_Open(0, lngHandle) <> FT_OK Then
    5.           FT_ResetDevice lngHandle
    6.           If FT_Close(lngHandle) <> FT_OK Then
    7.                 LoggerList.AddItem "Close Failed"
    8.           End If
    9.       End If
    10. End Sub

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: i want my code to perpect

    @Devion

    still the same........

    i get no luck..........

    the code posted above is already working......

    when changing box sn... but when i run this into the other software its still not detected the new sn...

    example:

    ORIG. 12345

    then i will change the sn using my program.....

    S/N Writen: 00000

    when i press read.........

    it will read the

    ORIG. 00000

    now when i try this into another program that also supported with my box...

    it will say ORIG. 12345

    but when i inialise the my box into another program same what im doing it can inialise the sn...

    then connect to the ORIGINAL SOFTWARE

    ORIG. 00000

  7. #7
    Frenzied Member Devion's Avatar
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    1,049

    Re: i want my code to perpect

    There is probably something else you need to write then. I've never had any experience with what you are currently doing so I'm just thinking out loud so to speak. :/

  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: i want my code to perpect

    @Devion

    if you want i can attach hre the documentation?

    thanks a lot...

  9. #9
    Frenzied Member Devion's Avatar
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    1,049

    Re: i want my code to perpect

    I would actually need the device too otherwise it won't really help at all

  10. #10

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: i want my code to perpect

    this one is the documentation.....

    i think no need for the device......

    and i assume u can get what i mean........

    please see the attachment.......

    Thanks.........

    br,
    Attached Files Attached Files

  11. #11
    Frenzied Member Devion's Avatar
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    1,049

    Re: i want my code to perpect

    I'll check it this evening (as I'm @ work at the moment and don't have WinRar on my machine )

  12. #12
    Member
    Join Date
    Nov 2003
    Posts
    46

    Re: i want my code to perpect

    Ive just had a "quick" look at the documentation and read that when useing FT_Open
    the intDeviceNumber var can only be set to zero when there is only 1 device attached
    you could be writing to the wronge device ?
    if you have more than one device then you will have to use FT_ListDevices or FT_OpenEX

    you can also try Devions code again but with a FT_Purge(lngHandle, FT_PURGE_TX or FT_PURGE_RX) after it ?

    if that dosnt work, there is another driver u can use "FTCI2C" http://www.ftdichip.com/Projects/MPSSE/FTCI2C.htm
    which has an I2C_InitDevice function

    also if the device your referring to as "the box" is the SarasSoft mobile phone flasher, i dont think it will let you change the sn of it
    cuz that sounds Illegal !!

    Edit---
    Oops, my bad, did you say you Can change the sn useing "Another" program ?
    i have trouble reading your english
    Last edited by Johnny English; Aug 23rd, 2005 at 07:50 AM.

  13. #13

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: i want my code to perpect

    @Johnny English

    sir, its not illegal... thats my project here in our school...
    i want to know how to write the new sn and initialise so that the new sn will be usable.. if i can't initialise its still the OLD sn will appear like what im talking on the top of this thread...

    FT_Purge

    how do i insert to devion's code?

    Thanks...

  14. #14
    Member
    Join Date
    Nov 2003
    Posts
    46

    Re: i want my code to perpect

    when i read the documentation for the FTCI2C.DLL function "I2C_InitDevice"
    it says

    I2C_InitDevice
    This function initializes the FT2232C device, by carrying out the following:
    resets the device and purge device USB input buffer
    sets the device USB input and output buffers to 64K bytes
    sets the special characters for the device, disable event and error characters
    sets the device read timeout to infinite
    sets the device write timeout to 5 seconds
    sets the device latency timer to 16 milliseconds
    reset MPSSE controller
    enable MPSSE controller
    synchronize to the MPSSE controller
    set data in and data out clock frequency
    set MPSSE loopback state to off (default)
    ensure the device USB input buffer is empty
    so maybe you can carry out the same events by useing the FTD2XX.DLL
    you wont have to carry out any of the MPSSE events cuz it looks like thats exclusive to the FTCI2C.DLL

    so that leaves you with

    resets the device and purge device USB input buffer
    FT_ResetDevice(lngHandle)
    FT_Purge(lngHandle, FT_PURGE_TX or FT_PURGE_RX)

    sets the special characters for the device, disable event and error characters
    FT_SetChars (lngHandle, uEventCh, 0&, uErrorCh, 0&)
    i dont know what uEventCh or uErrorCh should be, cuz i dont know what an event or error character is

    sets the device read timeout to infinite
    sets the device write timeout to 5 seconds
    FT_SetTimeouts(lngHandle, lngReadTimeOut, lngWriteTimeOut)

    sets the device latency timer to 16 milliseconds
    FT_SetLatencyTimer(lngHandle, lngLatencyTimer);

    the documentation didnt explain how to do the rest ?
    set data in and data out clock frequency
    sets the device USB input and output buffers to 64K bytes
    ensure the device USB input buffer is empty

    just try this ?
    VB Code:
    1. Private Const FT_PURGE_RX = 1
    2. Private Const FT_PURGE_TX = 2
    3.  
    4. Public Sub ResetDevice()
    5. Dim lngHandle as long
    6.  
    7.       If FT_Open(0, lngHandle) <> FT_OK Then
    8.  
    9.           FT_ResetDevice lngHandle
    10.           FT_Purge lngHandle, FT_PURGE_TX or FT_PURGE_RX
    11.  
    12.           If FT_Close(lngHandle) <> FT_OK Then
    13.                 LoggerList.AddItem "Close Failed"
    14.           End If
    15.  
    16.       End If
    17.  
    18. End Sub

    are you not allowed to use FTCI2C.DLL in your project ?, cuz that looks like it has what u need, then I2C_InitDevice function

  15. #15

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: i want my code to perpect

    @Johnny English

    i tried your code......... nothing happens still the same....

    yes we only need is FTDI2XXX.dll

    Thanks...

    @Devion

    what is the news?

    thanks...

  16. #16

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: i want my code to perpect

    i just received an email from the website of the ftdichip........

    they told me that FT_CyclePort is the solution of my problem....

    means are to re-enumerate the port means........
    thats what i need.......

    the problem is how to use that FT_CyclePort Function?

    thanks.......

  17. #17
    Member
    Join Date
    Nov 2003
    Posts
    46

    Re: i want my code to perpect

    lol, i just read the documentation for FT_CyclePort and it says !!
    Remarks
    The effect of this function is the same as disconnecting then reconnecting the device from USB.
    Possible use of this function is in situations where a fatal error has occurred and it is difficult, or not
    possible, to recover without unplugging and replugging the USB cable. This function can also be
    used after re-programming the EEPROM to force the FTDI device to read the new EEPROM
    contents which previously required a physical disconnect-reconnect.
    try this ..

    VB Code:
    1. Private Declare Function FT_CyclePort Lib "FTD2XX.DLL" (ByVal lngHandle As Long) As Long
    2.  
    3. Public Sub ResetDevice()
    4. Dim lngHandle as long
    5.  
    6.       If FT_Open(0, lngHandle) <> FT_OK Then
    7.  
    8.           If FT_CyclePort(lngHandle) <> FT_OK Then
    9.                 LoggerList.AddItem "Can not Cycle Port"
    10.           End If
    11.  
    12.           If FT_Close(lngHandle) <> FT_OK Then
    13.                 LoggerList.AddItem "Close Failed"
    14.           End If
    15.  
    16.       End If
    17.  
    18. End Sub


    or you can just put it in your cmdChangeSN_Click() event, just before the FT_Close

  18. #18

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: i want my code to perpect

    @Johnny English

    sir, were do i insert this code? into a command button?

    thanks..

  19. #19

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: i want my code to perpect

    i got here and example of visual .net

    but anyone can convert this into vb6?

    thanks...
    Attached Files Attached Files

  20. #20
    Member
    Join Date
    Nov 2003
    Posts
    46

    Re: i want my code to perpect

    i have rewritten your cmdChangeSN_Click() event, just replace your old one whith this

    VB Code:
    1. Private Sub cmdChangeSN_Click()
    2. Dim lngHandle As Long
    3. Dim lngRetVal As Long
    4. Dim lngCount As Long
    5. Dim EEData As FT_PROGRAM_DATA
    6. Dim strManufacturer As String
    7. Dim strManufacturerID As String
    8. Dim strDescription As String
    9. Dim strSerialNumber As String
    10.  
    11. Dim bOLDSerialNumber(16) As Byte
    12. Dim MyValue
    13. MyValue = InputBox("Edit S/N, if needed", "SarasSoft Boxes (Serial Number) Changer", txtSerialNumber.Text, 5000, 4670)
    14. txtSerialNumber.Text = MyValue
    15.  
    16. If FT_Open(0, lngHandle) <> FT_OK Then
    17.     LoggerList.AddItem "Can't find SarasSoft Boxes"
    18.     Exit Sub
    19. End If
    20. EEData.Manufacturer = VarPtr(bManufacturer(0))
    21. EEData.ManufacturerId = VarPtr(bManufacturerID(0))
    22. EEData.Description = VarPtr(bDescription(0))
    23. EEData.SerialNumber = VarPtr(bSerialNumber(0))
    24.  
    25. lngRetVal = FT_EE_Read(lngHandle, EEData)
    26. If RetVal <> FT_OK Then
    27.     LoggerList.AddItem "EE_Read Failed: " & Str(lngRetVal)
    28.     Exit Sub
    29. End If
    30.  
    31. CopyByteArray bSerialNumber, bOLDSerialNumber
    32.  
    33. StringToByteArray txtSerialNumber.Text, bSerialNumber
    34.  
    35. lngRetVal = FT_EE_Program(lngHandle, EEData)
    36. If lngRetVal <> FT_OK Then
    37.     LoggerList.AddItem "EE_Program FAILED: code " & Str(lngRetVal)
    38.     Exit Sub
    39. End If
    40.  
    41. 'i have changed this part below
    42. If FT_CyclePort(lngHandle) <> FT_OK Then
    43.     LoggerList.AddItem "Serial Number Successfully Change. . ."
    44.     LoggerList.AddItem "------------------------------------"
    45. Else
    46.     LoggerList.AddItem "CyclePort Failed"
    47.     MsgBox "Please Disconnect USB Cable and Connect Back Again !!!  ", vbOKOnly + vbInformation + vbApplicationModal, "Information"
    48. End If
    49.  
    50. If FT_Close(lngHandle) <> FT_OK Then
    51.     LoggerList.AddItem "Close Failed"
    52. End If
    53.  
    54. CopyByteArray bOLDSerialNumber, bSerialNumber
    55. cmdChangeSN.Enabled = False
    56. cmdReadSN.Enabled = True
    57.  
    58. End Sub

  21. #21

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: i want my code to perpect

    @Johnny English

    its says can;t fin dll entry point in FT_CyclePort FTD2XX.dll?

    what does it mean?

  22. #22
    Frenzied Member Devion's Avatar
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    1,049

    Re: i want my code to perpect

    You have an old FTD2XX.DLL and should download the newest DLL (Just a wild guess)

  23. #23

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: i want my code to perpect

    @Devion

    there is no latest .dll version available in there site...

    actually the desired sn to written into a box is already working...
    but its needs to enumerate..........

    the info of this box has a PWR TX RX USB

  24. #24
    Member
    Join Date
    Nov 2003
    Posts
    46

    Re: i want my code to perpect

    read section 6.2 of the programmers guide

    Revision History:
    13/03/01 awm Created.
    13/01/03 awm Added device information support.
    19/03/03 awm Added FT_W32_CancelIo.
    12/06/03 awm Added FT_StopInTask and FT_RestartInTask.
    18/09/03 awm Added FT_SetResetPipeRetryCount.
    10/10/03 awm Added FT_ResetPort.
    23/01/04 awm Added support for open-by-location.
    16/03/04 awm Added support for FT2232C.
    23/09/04 awm Added support for FT232R.
    20/10/04 awm Added FT_CyclePort.
    18/01/05 awm Added FT_DEVICE_LIST_INFO_NODE type.
    11/02/05 awm Added LocId to FT_DEVICE_LIST_INFO_NODE.
    i noticed in the .net example that there was a Sleep(100) function between writeing and reading
    you dont want to reset the device before you have finishes writing

    also the .net example does not reset the device after writeing, but it uses FT_Write_String and not FT_EE_Program to write ?

  25. #25

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: i want my code to perpect

    @Johnny English

    so i need the FT_Write? and Not the FT_EE Program?

  26. #26
    Member
    Join Date
    Nov 2003
    Posts
    46

    Re: i want my code to perpect

    i dont know what the difference between the 2 write functions are, so i cant tell you
    the .net example does not try to write a Serial Number or a FT_PROGRAM_DATA structure
    it writes a string
    also the .net FT_PROGRAM_DATA structure is deferent, it has a Rev5 section

    open your DLL with "dependency walker" and check if you have CyclePorts in it !!

  27. #27

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: i want my code to perpect

    @Johnny English

    i didnt see the FT_CyclePort in the FTD2XX.DLL

  28. #28

  29. #29

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: i want my code to perpect

    @MartinLiss

    bcoz our project needs to control the ftdi chip...... so that we know how to write/read data from the eeprom....

    so the SN is located at the eeprom side.....

    i already know how to read/write the sn but my problem is it needs to enumerate so that the it will usable when i run to the software...

    thanks....

  30. #30
    Member
    Join Date
    Nov 2003
    Posts
    46

    Re: i want my code to perpect

    if dependency walker says you dont have Cycle_Port in your .dll and the documentations revision history section say that it added Cycle_Port on 20/10/04
    then you dont have the latest version

    the latest version for XP is 1.1.1 (24th March 2005)
    http://www.ftdichip.com/Drivers/FT2232CDrivers.htm
    is this the one your useing ?

    Edit ---

    ok, i downloaded version 1.1.1 for XP and it dose have Cycle_Port in it, so you should use version 1.1.1

    Last edited by Johnny English; Aug 26th, 2005 at 09:29 AM.

  31. #31

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2002
    Location
    Philippines
    Posts
    877

    Re: i want my code to perpect

    @Johnny English

    i already tried but it is still the same.....

    i have here a sample program but its compiled into .exe

    it can re-enumerate the new serial number written

    thanks..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width