Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Code Block
languagec#
...
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_EP6EP8 = 68;
uint TIMEOUT_MS = 1000;
int BUFFER_SIZE = 131072;
... 
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
//Write USB data test starts
SendFPGAcommand(ref TE_USB_FX2_USBDevice, MB_Commands.FX22MB_REG0_START_RX, TIMEOUT_MS);
test_cnt = 0;
total_cnt = 0;
for (int i = 0; i < packets; i++)
{
     packetlen = PACKETLENGTH;
     Buffer.BlockCopy(data, total_cnt, buffer, 0, packetlen);
     TE_USB_FX2.TE_USB_FX2.TE_USB_FX2_SetDataGetData(ref TE_USB_FX2_USBDevice, ref buffer, ref packetlen, PI_EP8, TIMEOUT_MS,BUFFER_SIZE);
     total_cnt += packetlen;
}
//Write USB data test ends
SendFPGAcommand(ref TE_USB_FX2_USBDevice, MB_Commands.FX22MB_REG0_STOP, TIMEOUT_MS);
stopWatch.Stop();
TimeSpan ts = stopWatch.Elapsed;
...