LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data lost when reading using USB Bulk RAW transfer

Hello! I am new to this discussion board.

 

I am currently designing a system capable of synthesizing an arbitrary waveform using a FPGA. The FPGA receives the samples from  the PC via USB and then sends them to a DAC. Now I am interested in sending the samples recieved back to the PC using the USB Bulk Raw example provided with Labview software. So far I've managed to send from the PC to the FPGA over 350000 samples using this example but when I try to read them in the PC nearly half of the samples are lost, that is, if I send 350000 to the FPGA I can only receive 180000 approx. I've also noticed that if I do the same with 150 samples(bytes) it works fine but from that point doesn't. What's more, when sending the full amount of samples the first 150 received in the PC are correct, the following hundred is lost and then again correct. I thought that data are overwritten since they are read slower than they are sent by the FPGA. Could it be possible? If so I don't know if it is possible to change the size of the input buffer like a serial port.

 

Thank you all!

0 Kudos
Message 1 of 3
(2,545 Views)

USB Bulk Raw example does not suit your pupose as you have to read the pipe with an event you generate manually by clicking the button. So make a simple application that continuosly read the pipe data at reasonably high rate may be every 10msec and collect all data into a buffer (array in SW) and later you can look at the data.

0 Kudos
Message 2 of 3
(2,431 Views)
Thank you for answering the post! I do not know if that is the real problem: our VI is slightly different from the example as the read of the 350000 is done inside the bulk out event. When the user presses this button (and the bulk out event is executed) a Visa write block is used to send a string command to the FPGA so it knows it has to send back the full amount of the waveform samples it receives from the PC. Straight after that and before ending the bulk out event we placed a VISA read block with 350000 bytes to read. In this step the system fails to read them. It is really weird because the first and.the last samples are correct but many of the samples in the middle are lost. Anyway we will try what you have suggested in your post and let you know about the results. Also I will try to post soon a capture of the block diagram of the VI
I really apreciate your answer and hope it will work!
0 Kudos
Message 3 of 3
(2,425 Views)