I'm developing some code for frequency measurement in Visual C++ using the
NI 6601 counter/timer board. I am able to successfully read the counter
for a single counter; however, my application requires reading multiple counters.
I have code to the effect as follows:
do
{
nStatus = GPCTR_Watch( nDevice, ulCounter1, ND_ARMED, &ulArmed1 );
nRetVal = NIDAQYield( nYieldOn );
} while ( ( ulArmed1 == ND_YES ) && ( nStatus == 0 ) );
do
{
nStatus = GPCTR_Watch( nDevice, ulCounter2, ND_ARMED, &ulArmed2 );
nRetVal = NIDAQYield( nYieldOn );
} while ( ( ulArmed2 == ND_YES ) && ( nStatus == 0 ) );
do
{
nStatus = GPCTR_Watch( nDevice, ulCounter3, ND_ARMED, &ulArmed3 );
nRet
Val = NIDAQYield( nYieldOn );
} while ( ( ulArmed3 == ND_YES ) && ( nStatus == 0 ) );
I have tried a single do..while, but to no avail. In the above code, the
first counter returns, but the next one just hangs there indefinately - not
arming.
Can anyone point me in the right direction on how to read multiple counters
on the 6601?
Thanks,
Aaron Lukacsko
alukacsk@avtron.com