11-10-2005 11:03 AM
11-11-2005 01:24 AM
11-11-2005 02:57 AM
It seems that this question has been already answered here: I suggest you study the post linked in that page.
Anyway, if your card it that PCI-MIO 16E4 you are referring to in another question, I can confirm you have two counters available for this task. This provided you are not executing other acquisitions in the same moments: some analog acquisitions use one of the internal counters for timing.
11-13-2005 03:45 PM
11-14-2005 02:03 AM - edited 11-14-2005 02:03 AM
Message Edited by Roberto Bozzolo on 11-14-2005 09:09 AM
11-15-2005 09:20 AM
Hi, Ican't find your directory but I would like to know if you don't know where I can find example of simple event counts each 50 ms for a traditionnal DAQ on labwindows because I can't find anything......I've also looked on the DAQ QTC Technical reference, and found a chapter on "Simple Gated-Event Counting" but no exemples.
Thanks.
11-15-2005 09:52 AM
11-16-2005 12:11 PM
Hi,I still have problem
As you said, I've generated with my counter0 a square wave of 50 ms pulse width from an internal source but then, I don't know how to specify that this signal will also be the pin gate (ND_PFI_4) of my counter1 which will count the rising edge.
Moreover I also don't know how to specify my counter1 just to count rising edge while my gate is at high state; here 's mys code :
//Generation of an internal 100 KHZ square wave
GPCTR_Control(1, ND_COUNTER_0, ND_RESET);
GPCTR_Set_Application(1, ND_COUNTER_0,ND_PULSE_TRAIN_GNR);
GPCTR_Change_Parameter(1, ND_COUNTER_0, ND_SOURCE,ND_INTERNAL_100_KHZ);
//Generation of a 100 ms gate
//50 ms => low state
//50 ms => high state
GPCTR_Change_Parameter(1, ND_COUNTER_0, ND_COUNT_1,5000);
GPCTR_Change_Parameter(1, ND_COUNTER_0, ND_COUNT_2,5000);
//output the counter pulse, you must call Select_Signal.
Select_Signal(1, ND_GPCTR0_OUTPUT, ND_GPCTR0_OUTPUT,ND_LOW_TO_HIGH);
GPCTR_Control(1, ND_COUNTER_0, ND_PROGRAM);
//configuration CPTR1 that will count each rising edge while the gate is at high state
GPCTR_Control (1, ND_COUNTER_1, ND_RESET);
GPCTR_Set_Application(1, ND_COUNTER_1,ND_SIMPLE_EVENT_CNT);
GPCTR_Change_Parameter(1, ND_COUNTER_1, ND_SOURCE, ND_PFI_3);
GPCTR_Change_Parameter (1, ND_COUNTER_1, ND_SOURCE_POLARITY,ND_LOW_TO_HIGH);
GPCTR_Change_Parameter (1, ND_COUNTER_1, ND_INITIAL_COUNT, 0);
GPCTR_Control(1,ND_COUNTER_1, ND_PROGRAM);
GPCTR_Watch (1, ND_COUNTER_0, ND_ARMED, &compteur0);
printf("%d\n",compteur0);