LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB RAW (BULK) VISA Read/Write inside loop too slow?

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!

 

 

block_diagram.png

0 Kudos
Message 1 of 5
(2,384 Views)

A few questions and possible suggestion.

  1. Once you issue the GET command does the device continuously stream data or do you have to issue the GET command every time?
  2. Can you obtain more than 1024 bytes at a time?

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

0 Kudos
Message 2 of 5
(2,303 Views)

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?

0 Kudos
Message 3 of 5
(2,285 Views)

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

0 Kudos
Message 4 of 5
(2,281 Views)

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!

Message 5 of 5
(2,259 Views)