...
int packetlen = 51200;//102400 for TE0320 and TE0630 modules;
int packets = 600;//1200 for TE0320 and TE0630 modules;
byte[] data = new byte[packetlen*packets];
byte[] buffer = new byte[packetlen];
int PI_EP6 = 6;
uint TIMEOUT_MS = 200;
int BUFFER_SIZE = 102400;
...
Stopwatch stopWatch = new Stopwatch();
//StopWatch timer starts
stopWatch.Start();
//starts test
test_cnt = 0;
total_cnt = 0;
for (int i = 0; i < packets; i++)
{
//Read USB data test starts
SendFPGAcommand(ref TE_USB_FX2_USBDevice, MB_Commands.FX22MB_REG0_START_TX, TIMEOUT_MS);
packetlen = PACKETLENGTH;
TE_USB_FX2.TE_USB_FX2.TE_USB_FX2_SetData(ref TE_USB_FX2_USBDevice, ref buffer, ref packetlen, PI_EP6, TIMEOUT_MS,BUFFER_SIZE);
Buffer.BlockCopy(buffer,0, data, total_cnt, packetlen);
total_cnt += packetlen;
//Read USB data test ends
SendFPGAcommand(ref TE_USB_FX2_USBDevice, MB_Commands.FX22MB_REG0_STOP, TIMEOUT_MS);
}
//StopWatch timer stops
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed; |