Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I specify the GPCTR0's Source using NIDAQ API Functions for C++?

I am trying to route a PFI signal to a RTSI signal. Erin B. recommended "It is possible to route an external signal through the board to a RTSI line, but you will need to use GPCTR0 to do this. The way to do this is to connect your external signal to a PFI line and specify that line as GPCTR0's Source. You then have to configure a counter operation such as simple event counting. By doing this, you basically turn on the ability to route that signal elsewhere on the board. Then, call Select_Signal to route GPCTR0 Source to RTSIn. You can then start the counter, and the signal on PFIn will automatically be routed to RTSIn."

However, how would I map the GPCTR0 source to the
PFI? Would the following set of NIDAQ API function calls be the right way to do this (PCI-6071E is device 1 and the AT-AO-10 is device 3)
/* disconnect PFI signal*/
Select_Signal(1, ND_PFI_8, ND_NONE, ND_DONT_CARE );

/* reset GPCTR0 and start simple event counting */
GPCTR_Control(1, ND_COUNTER_0, ND_RESET);
GPCTR_Set_Application(1, ND_COUNTER_0, ND_SIMPLE_EVENT_CNT);
GPCTR_Change_Parameter(1, ND_COUNTER_0, ND_SOURCE, ND_PFI_8);
GPCTR_Change_Parameter(1, ND_COUNTER_0, ND_INITIAL_COUNT, 0);


/* connect RTSI triggerline to GPCTR0 source */
Select_Signal(1, ND_RTSI_6, ND_GPCTR0_SOURCE, ND_LOW_TO_HIGH );


/* connect AT-AO-10's EXTUPDATE to RTSI triggerline */
RTSI_Conn (3, 5, 6, 0);


/* start counting */
GPCTR_Control(1, ND_COUNTER_0, ND_PROGRAM);

As well the RTSI switch is made up of 34 pins but only provides 7 trigger lines. Which of the 34 pins correspond to the 7 trigger lines? I am trying to monitor the outputs on the RTSI pins using a scope to check if t
he mapping actually works.
0 Kudos
Message 1 of 3
(2,837 Views)
The code that you specify is correct. By using GPCTR_Change_Parameter and selecting PFI8 as the counter source, you can connect your external signal to PFI8 and that signal will be used as the counter source. By calling Select_Signal to route the counter source to RTSI6, the signal that you connect to PFI8 will also be routed to RTSI6.

For a pinout of the RTSI connector on your DAQ board, you can refer to the following Knowledgebase entry:

http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/ad2d553f55a07bbf8625650d005f1f00?OpenDocument

This will tell you how the RTSI connector is pinned out.

Hope this helps.

Regards,
Erin
Message 2 of 3
(2,837 Views)
It worked! Thanks for the help Erin.
0 Kudos
Message 3 of 3
(2,837 Views)