Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Assigning PFI lines to counter

Hello,
 
I am using LabWindows CVI 7.1. Can someone tell me how can I assign the PFI lines on PCI6221 to the counter0 or Counter1?
I know how to do this in LabView but I cannot find the functinos in CVI to assign the PFI lines.
 
Thank you,
Hiren
Hiren Patel
0 Kudos
Message 1 of 27
(6,677 Views)

Hello Hiren,
I want to mention a couple things.  First, there are default counter terminals for your device (see pinout below).  Second, I'm not sure what LabVIEW VI you were using, but you can use the DAQmxConnectTerms function or the DAQmxExportSignal to route signals with NI-DAQmx.  These functions are very similar to the LabVIEW "DAQmx Connect Terminals.vi" and the "DAQmx Export Signal.vi", respectively.  If you need additional help with NI-DAQmx functions, see the NI-DAQmx C Reference Help, located here (in Windows) Start>>All Programs>>National Instruments>>NI-DAQ.
-Alan A.

Message Edited by Alan A. on 10-14-2005 11:03 AM

0 Kudos
Message 2 of 27
(6,657 Views)

Hello Alen,

I am using LabView 7.1. I have this up and running under LabView without a problem.

Let me explain what I am trying to do in CVI. I want to use counter0 to measure my frequency using configureFrequency function. What I need is what function I can call to connect PFI8 to ctr0? DAQmxConnectTerms function asks for source and destination but I cannot find the ctr0 in there.

 

Thank you,

Hiren

Hiren Patel
0 Kudos
Message 3 of 27
(6,646 Views)

Also where can I find the function "DAQmxSetCIFreqTerm"? I can not find this on the DAQmx library. This may the function I need to set my ctr0 to PFI8.

 

Hiren

Hiren Patel
0 Kudos
Message 4 of 27
(6,644 Views)
By default, Counter 0 Source is PFI 8, as noted by the image in the previous post.  What LabVIEW VIs are you using?  There is usually a direct one-to-one relationship between LabVIEW DAQmx VIs and C-based DAQmx functions. 
-Alan A.
0 Kudos
Message 5 of 27
(6,628 Views)

Hello Alan,

I am using CI Freq function in LabView 7.1. By default ctr0 is set to PFI9 when I use CI Freq function. But by using Property node on the term I can choose any PFI line to assign to ctr0.

I have got the first part working OK on CVI also where ctr0 is assigned to PFI9 as default for Frequency measurements. What I need is the term function for CI so that I can assign any of the PFI line to ctr0.

Hiren

Hiren Patel
0 Kudos
Message 6 of 27
(6,622 Views)
To clarify,  Counter 0 Source is PFI 8 and Counter 0 Gate is PFI 9.  Depending on what flavor of frequency measurement type you use, the signal must be connected to one of the two terminals.  For example, if you use the one counter method, you need to connect your signal to the gate terminal.  If using the two counter method, the signal must be connected to the source terminal.  I'm still a little unclear what exactly your program is doing.  Again, what LabVIEW VIs are you using??  You said you used a property node to handle the signal routing.  What property node, and what property??  It looks like you might just need to use the function you mentioned previously, the DAQmxSetCIFreqTerm function.  Are you having problems using that function?  You might want to check out the NI-DAQmx C Reference Help.  That function is listed with the DAQmx Counter Input Channel Properties.
-Alan A.
0 Kudos
Message 7 of 27
(6,617 Views)

Hi Alan,

Thank you for your help, you are right all I need is "DAQmxSetCIFreqTerm" function to set PFI line to ctr0.

Can you tell me where can I find the description or an example of

int32 __CFUNC DAQmxSetCIFreqTerm(TaskHandle taskHandle, const char channel[], const char *data) function please. Especially the "const char * data" parameter. If you can help me with this then I think I have got what I need to assign my ctr0 source to any of the PFI lines.

Thank you,

Hiren

Hiren Patel
0 Kudos
Message 8 of 27
(6,609 Views)
So it doesn't look like there is a lot of documentation for that function.  I'm assuming that you can just use a 'dummy' variable for the data variable.  Give that a try and let me know if it doesn't work. 
-Alan A.
0 Kudos
Message 9 of 27
(6,597 Views)

I can't get it to work. Can you find out more information on this function please?

Hiren

Hiren Patel
0 Kudos
Message 10 of 27
(6,587 Views)