We are using a NI-PCI 6541 HSDIO card for simultaneously generation and
acquisition of data. For this, we use some C code that is largely
comparable with the DynamicAcqAndGen-SourceSynchronous.c example code
and this does work okay. One thing that surprises me however is the
long delay between the moment the acquisition is started and the
generation is started.
The code I used to make the measurement is (somewhat stripped):
niHSDIO_WriteNamedWaveformU32( TxSession, TxWaveformName, read, buffer );
niHSDIO_ConfigureWaveformToGenerate( TxSession, TxWaveformName );
niHSDIO_CommitDynamic( TxSession );
QueryPerformanceCounter( (LARGE_INTEGER *)&before_acquire );
niHSDIO_ConfigureAcquisitionSize( RxSession, SamplesToRead, 1 );
niHSDIO_Initiate( RxSession );
niHSDIO_Initiate( TxSession )
QueryPerformanceCounter( (LARGE_INTEGER *)&after_generation );
double usec = after_generation - before_acquire;
__int64 nHPFrequency;
QueryPerformanceFrequency( (LARGE_INTEGER *) &nHPFrequency );
usec = 1.0E6 * usec / nHPFrequency;
printf( "%.0lf us between starting acquisition and generation started\n", usec );
And the typical results is something like 20000us = 20ms.
When I look into the captured data and see when data that is being
generated caused a response in the acquired data, I see that this
typically translates to something like 115000 samples, which translated
to 2.6 ms on 45 MHz generation/acquisition frequency.
Combining these results, it seems to me like setting up the acquisition
takes about 17.5 ms and starting generation about 2.5 ms. Both the 17.5
ms and the 2.5 ms are pretty long to my opinion, we are using a recent
Pentium 4 machine.
Is there any way to reduce this latency?
NB: I tried to do a niHSDIO_CommitDynamic( RxSession ) earlier on but that gives errors.