Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

GPCTR_Set_Application Example

Located under the NIDAQ Function Reference Help section is a 'GPCTR_Set_Application' example I am trying to get running with a 6608 Counter (aboard a PXI-1000B chassis). I have a 1KHz signal on my counter gate input and a 10Khz signal on my counter source input, and I am probing my counter output with an oscilloscope. Unfortunately I am not getting the correct data on the output when I run my program. Is my code correct? Am I supposed to be initializing the counter input/output pins before I run my program???

void CSystemTimingDlg::OnStart()
{

long deviceNumber = 1;
long gpctrNum = ND_COUNTER_1;
long gpctrNumOut = ND_PFI_32;

GPCTR_Control(deviceNumber, gpctrNum, ND_RESET);

GPCTR_Set_Application(deviceNumber, gpctrNum, ND
_RETRIG_PULSE_GNR);
GPCTR_Change_Parameter(deviceNumber, gpctrNum, ND_COUNT_1, 3);
GPCTR_Change_Parameter(deviceNumber, gpctrNum, ND_COUNT_2, 4);

Select_Signal(deviceNumber, gpctrNumOut, gpctrNumOut, ND_LOW_TO_HIGH);

GPCTR_Control(deviceNumber, gpctrNum, ND_PROGRAM);
}

I have already confirmed the device number using Measurement Explorer, and I have the necessary header files (nidaq.h, nidaqcns.h, nidaqex.h, nidaqerr.h) and the two nidaq library files.
0 Kudos
Message 1 of 2
(3,464 Views)
Rodney;

Refer to the attached example which uses that function on a C code.
Hope this helps.
Filipe
0 Kudos
Message 2 of 2
(3,464 Views)