>(a) I set a breakpoint at txtDataInOUt.Text = txtBulkDataToSend.Text. When I clicked on the Send button at the UI, it does not allow me to step the codes. Instead, it sends and reads data automatically.
Try putting the breakpoint further up, in cmdSendAndReceiveViaBulkTransfers_Click, or further down, in SendViaBulkTransfer.
>(b) When I send a command to the microcontroller, it may returned few data. I want the ReadDataViaBulkTransfer() routine to display the data whenever there is any data coming from the microcontroller. How to address this issue? In this case, ReadDataViaBulkTransfer() is running independently.
Call ReadDataViaBulkTransfer again after it returns data.
>(c) I add in these codes to ReadDataViaBulkTransfer() routine right after ar
ar = MyReadFromDeviceDelegate.BeginInvoke _
(myWinUsbDevice.myDevInfo.bulkInPipe, _
bytesToRead, _
buffer, _
bytesRead, _
success, _
New AsyncCallback(AddressOf GetReceivedBulkData), _
MyReadFromDeviceDelegate)
Dim j As Integer
txtDataInOUt.Text = ""
For j = 0 To 63
txtDataInOUt.Text = txtDataInOUt.Text & Chr(buffer(j))
Next
lstResults gives read data of Rev: A (12th March 2012) but txtDataInOut = "ch 2012)" only. Please advise
If the data read from the device doesn't match the data the PC sent, isolate the problem by verifying that the PC sent the correct data, then checking to see if the device firmware is sending back what it received (or whatever data it's supposed to be sending).
Jan