07-23-2012 05:37 AM
Hello,
I'm working on project that reads adc simples in a very high rate from an MCU based card. To transfer samples to the computer, I've used USB communication (full speed with USBTMC driver).
I've insered a "VISA read" into a while loop, but I have a very bad rate :1 request is sent every 3ms.
I have tried to put other functions into the loop in order to make it slowlier but I have always the same result (1req/3ms), so it's not a related to the amout of function in the loop.
I am wondering if its a Labview, VISA driver or Windows limitation.
Can you explain to me why I cant have better the 3ms rate??
Thank you
07-23-2012 08:31 AM
Code?
07-23-2012 09:55 AM
And provide the make and model of the device.
07-24-2012 06:49 PM
device : STM32
code: a simple while loop having a read visa block
07-24-2012 08:15 PM
07-25-2012 12:50 PM
Actually, a VISA read block generate a "REQUEST_IN_MSG" request. After that request, STM32 USBTMC firmware handles this request by sending a response.
Since I am sending samples in a high sampling rate (1mega samples per second) 3 ms is very slow, even If I would send a large amount of samples in a single transfer (actually I try to tranfer 1000 samples at ones)
Any suggestion? I need a real time samples tranfer.
07-25-2012 01:27 PM
The only driver that I found for an STM32 was a virtual com port. That is not at all the same as USBTMC. But whether you really do have a USBTMC driver or not, it apparently has been written by STM and both the number of samples and the transfer rate would be set by firmware they wrote. Are you saying that you only get a single sample at a time or are you actually getting the 1000 that you request? If you set the VISA Read for a high byte count and you are not getting the number of requested bytes, perhaps you need to disable the termination character for a read. Since you have not posted your code or typical data, kind of guessing.
07-25-2012 04:19 PM
I've found that I can read data at around 1-3 Msamples per second if I read 100,000 to 500,000 samples for each iteration of my while loop. I had to add a timing sequence to the loop to make sure that it doesn't read data in too quickly though.
07-25-2012 08:03 PM
the firmware responds to a "read request" by sending a buffer. It have nothing to do with the timing. I have to handle the "read requests" frequency by Labview. Actually I put in the buffer 1000 samples (I cant store a very large number of samples because of memory constraints) .
The probleme is that the buffer is updated very quickly and I must not miss any buffer. That's why I must have very accurate and quick "read requests"
05-05-2016 06:00 AM