05-09-2007 07:24 AM
05-09-2007 07:28 AM
05-10-2007 05:33 PM
GPCTR_Config_Buffer
status = GPCTR_Config_Buffer (deviceNumber, gpctrNum, reserved, numPoints, buffer)
Purpose
Assigns a buffer that Traditional NI-DAQ (Legacy) uses for a buffered counter operation.
This function configures the buffer for the counter operation. So, you should only need to run it before the loop to configure the buffer and not in the loop where you read from the buffer. For a C example of buffered counter measurement in Traditional NI-DAQ (Legacy) you can examine the example program called STCsingleBufPeriodMeasure.C. By default, this example is installed to the following path:
C:\Program Files\National Instruments\NI-DAQ\Examples\VisualC\Ctr05-11-2007 02:47 AM
We are using Traditional NI-DAQ 7.4.1f4 because the NI-DAQmx was not available back in the days when the application was developed. As development environment we are using Microsoft Visual C++ 6.0. Currently we are not prepared to invest in switching to NI-DAQmx.
I can say that the buffer is allocated only once when the application starts and then in every loop the pointer to the beginning of the buffer is passed to the GPCTR_Config_Buffer function.
05-11-2007 04:51 PM
07-25-2007 09:42 AM
07-26-2007 06:07 PM
Apopa,
I am a bit unclear from your wording, but when the task is cleared the buffer will be release, and will be reallocated when a new task is created. The only way to reset a counter is to stop and start the task as well.
07-27-2007 02:00 AM
Oh, sorry, I got a little bit caried away. Calling
nStatus = GPCTR_Control(m_nDeviceNumber, m_nCounterNumber, ND_RESET);
will only halt the operation of the counter, it does not make any kind of reset, as the name would sugest.
Adrian.
07-27-2007 06:22 PM - edited 07-27-2007 06:22 PM
Apopa,
You are correct that GPCTR_control (m_nDeviceNumber,
m_nCounterNumber, ND_RESET) does not reset the device, but returns to the power
on state. ND_RESET can also be used when you want to halt the operation
the general-purpose counter is performing. Below are two quotes from the
Traiditional NI-dAQ (Legacy) C Function Reference Help. I would also highly suggest and recommend doing this application using DAQmx, as it is a newer and more full featured driver.
Message Edited by David L. on 07-27-2007 06:25 PM
07-09-2008 10:53 AM