Uderc programming article aggregator sites

Data getting owerwritten

I have a very unusual question.
I am accessing my ATmel device from Lab View through USB.
Its bulk in format.
I am using The VISA open,Read, Close blocks properly as specified in the example provided by NI.
I receive 100 packets each of 960 bytes.I a saving this in a text file.
Its a simulated data, so each packet will receive only data of that particular packet number(in hex),for eg: packet 1 will receive only 1's and so on.
i capture this data and i observe that packet 1 has 500 bytes of 1's and the rest 460 bytes of 2's.What exactly is happening is second packet's data is getting overwritten in the first packet's data. The board is sending data every 20 ms.
I crossed checked it in hyper terminal i saw that my device is sending all values properly.So from firmware side there is no issue.
I am not doing any sort of processing in between.
I directly capture the data received from the board.
The timeout given in VISA Open is 2000 ms and the byte count given for VISA read is 5000.
Is it a timing issue or anything else?
The best answer: I think you need a larger I/O buffer. The default size is as I remember 1024 bytes. I have never worked with USB and visa. But as I understand visa USB and serial is the same ting. If this is correct you may use the “visa set I/O buffer size” function. Use at least a 2K or larger buffer.
Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)