09-13-2020 04:30 AM
Hello,
I have a custom USB device containing an ADC whose sampled data I want to receive in LabVIEW. The data rate is 16.384 MBit/s with block sizes of 1024 Bytes every 500 us. A tiny C++ application I built for receiving the data (based on WinUSB driver) is working without any problems.
For setting up the USB communication in LabVIEW I followed this article: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x1qzCAA
Basically, the communication is working and I can receive some of the data. However, every few seconds packages are lost and in the Windows 10 task manager I can see that the device is disconnected and directly reconnected again. Is it possible that LabVIEW is not able to perform a USB read/write procedure every 500 us? Can I improve my LabVIEW program somehow (I am new to LabVIEW)?
Thank you very much for your help/your ideas!
09-13-2020 08:44 PM
A few questions and possible suggestion.
Sending commands is probably the slowest part, if you could send a GET command and receive 100 ms or more data at a time, that would probably speed things up.
mcduff
09-14-2020 02:15 AM
Sorry, I can't help you with the communication, but I strongly recommend to do a few simple LabVIEW tutorials first. All you need is a toplevel outer loop and a simple state machine architecture. Stacking interactive loop inside loops is not great.
Pictures are impossible to debug because much of the meta-information is missing. What's in the other case? What's the loop rate in the outer loop if the case is false? What are the mechanical actions of the various buttons? Your inner loop spins as fast as it can, constantly overwriting the data in the string indicator. Don't you want to keep all information?
09-14-2020 02:30 AM
Reading your post you mention that the device disconnects and reconnects.
This points at a power problem from either your device or your USB port.
I have encountered a lot of USB devices / ports which simply do not support clean power supply to devices with higher-than-usual power requirements. Maybe try connecting to a powered USB hub instead of directly to your PC.
Shane
09-15-2020 01:36 AM - edited 09-15-2020 01:38 AM
Thank you for your help! I solved the problem by adjusting the USB device's firmware: Instead of sending 1024 bytes each 500 us, 20480 bytes are transferred every 10 ms now. Thanks again!