Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx: Configuring start trigger for PCI 6602

Hi NI Support,

I am using a 6602 card to generate continuous pulses for another counter to measure period of continuous square waves. My
code is working fine with traditional NI-DAQ and API call sequence is as follows.

GPCTR_Control(1, Num0, ND_RESET);
GPCTR_Set_Application(1, Num0, ND_PULSE_TRAIN_GNR);
GPCTR_Change_Parameter( 1, Num0, ND_SOURCE, ND_INTERNAL_100_KHZ);
GPCTR_Change_Parameter( 1, Num0, ND_SOURCE_POLARITY, ND_LOW_TO_HIGH);
GPCTR_Change_Parameter( 1, Num0, ND_START_TRIGGER,ND_ENABLED);

GPCTR_Change_Parameter( 1, Num0, ND_COUNT_1, 500000); //Value "500000" is not important
GPCTR_Change_Parameter( 1, Num0, ND_COUNT_2, 500000);
.
.   

GPCTR_Control( 1, Num0, 1, ND_PROGRAM);
.
.
Data Acquision starts later by using
Select_Signal(id, ND_START_TRIGGER, ND_RTSI_0, ND_LOW_TO_HIGH);

Output of this counter is routed to the second counter for buffered period mesaurement. Sorry, I am not describing about the
second counter here.

I am facing some problems with DAQmx C API usage when I try to rewrite this applcation for DAQmx. Please see my new code.

DAQmxCreateTask"", taskHandle);
DAQmxCreateCOPulseChanTicks(taskHandle, "/Dev1/ctr0","","Dev1/100kHzTimebase",DAQmx_Val_Low,0.0,500000,500000);
DAQmxCfgDigEdgeStartTrig(taskHandle,
                                                "", //Which terminal to use here???
                                                DAQmx_Val_Rising));
DAQmxCfgImplicitTiming(taskHandle, DAQmx_Val_ContSamps, 0);
.
.
DAQmxStartTask(taskHandle);

My doubt is, "Which terminal can be used when configuring the start trigger?". RTSI_0 cannot be specified here because it can
be used only after some time (say 10 seconds) only. So, is it possible to route the signal from RTSI_0 to another signal(like
ND_START_TRIGGER) which can be configured earlier?

Please help.

Thank you very much.
-vtp

0 Kudos
Message 1 of 2
(3,824 Views)
Hello vtp,

Thanks for your post!

I see that you are converting your code from Traditional Daq to DAQmx. It looks like in your old code you are using the RITSI_0 line to start your counter task. So that is what I would put in the "trigger source" parameter of the DAQmxCfgDigEdgeStartTrig function.

DAQmxCfgDigEdgeStartTrig(taskHandle,
                                                "", /Dev1/RTSI0
                                                DAQmx_Val_Rising));

Now you mention later that you cannot use RTSI0 because it is a delayed signal? Is this signal coming from another PCI board in your computer. You can use any of the PFI or RITSI lines when setting up a trigger source. It depends on what you are wanting to do so you can specify where the trigger is coming from. The list of what terminals and triggers that can be used are in the DAQmx C reference help file. You can find this file by going to Start >> All Programs >> National Instruments >> NI-DAQ >> NI-DAQmx C Reference Help.

Let me know if you have any other questions!

Cheers!

Corby_B
http://www.ni.com/suppor
0 Kudos
Message 2 of 2
(3,794 Views)