Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

counter input using PFI0

Hi everyone,
I am trying to make frequency measurement using PFI0 or PFI1 in the cDAQ-9188 and DAQmx
is it possible to do so ???
can i have guide for that ?
thanks 

0 Kudos
Message 1 of 9
(7,497 Views)

Tareq,

 

Do you have a Digital cDAQ module in the system? Or are you trying to do this without a digital module? I don't believe that you have access to any of the counters without a digital module present in the system, at least this is what I see when I simulate a 9188 chassis.

 

If you are looking for examples, I would recommend looking at the example finder in LabVIEW. There are depending on whether you are doing continuous or finite reads. I linked the examples as well.

Aaron W.
National Instruments
CLA, CTA and CPI
0 Kudos
Message 2 of 9
(7,480 Views)

Hi Tareq-

 

You can use those PFI terminals as inputs for counter tasks using one of the four counters on the chassis.  In order to use those (instead of the terminals on a digital module, which is the typical use-case like Aaron suggested), you'll have to do a couple of things.

 

First, you will need to change the I/O name filtering on the DAQmx Physical Channel control (the input to DAQmx Create Channel VI) to include internal channels.  I/O name filtering is a right-click option on the channel control.

 

You will need to use a DAQmx Channel Property Node to specify the input terminals to be the chassis PFI lines (like cDAQ1/PFI0).

 

Hopefully this helps-

Tom W
National Instruments
0 Kudos
Message 3 of 9
(7,478 Views)

i try to build this but when i tried to selct PFI0 or PFI1 i cannot find in the list 

0 Kudos
Message 4 of 9
(7,471 Views)

Hey Tareq-

 

This should "just work."  I sanity tested with your VI and a cDAQ-9188 (simulated) to be sure of this.

 

You should use the CI.Freq.Term control to specify "/cDAQ9188-1747EBB/PFI0" in order to use the chassis BNC PFI0 connector as the input terminal for your measurement.  This terminal should be auto-populated in the list of terminals in that I/O constant when you click on the arrow to make a selection.

Tom W
National Instruments
0 Kudos
Message 5 of 9
(7,449 Views)

when i am trying to implement the attached file i got this error

-200284
PFI_try.vi<append>
<B>Property: </B>RelativeTo
<B>Corresponding Value: </B>Current Read Position
<B>Property: </B>Offset
<B>Corresponding Value: </B>0

<B>Task Name: </B>_unnamedTask<E8E>

0 Kudos
Message 6 of 9
(7,440 Views)

Hi Tareq-

 

You have specified your frequency input pin and its sample clock to be the same signal.  The -200284 error is a timeout, associated with the fact that you do not have multiple periods of your input signal for each sample clock cycle (since they are the same signal).

 

Are you actually trying to acquire a so-called buffered frequency measurement (buffering away measurement values on each tick of an external clock)?  My guess is that you just want to read a single frequency value per loop iteration judging by your use of the single sample DAQmx Read instance.  In that case, you can remove the DAQmx Timing VI from your task creation for the frequency measurement task.

 

Edit:  I should also mention that if you *do* plan to use an external clock, you should make sure that its rate and your 'samples to read' value of the DAQmx Read VI match in such a way that a read of that many samples can actually occur within the allotted DAQmx Read timeout.  You should probably also use a multi-sample instance of DAQmx Read in that case, too.

Tom W
National Instruments
0 Kudos
Message 7 of 9
(7,419 Views)

hi,
what i have acually is signal as pulses the frequency of this pulses change in propotion with the motor speed i want to read the frequancy of this signal to detect the spead of the motor ... HOw?
thanks 

0 Kudos
Message 8 of 9
(7,411 Views)

Hi Tareq-

 

If you do not require the latching of those values to by synchronized with an external clock, I would suggest that you use a software-timed example to pattern your application after.  Check out the Example Finder (Help>>Find Examples in LabVIEW).  You might consider Counter Input:Counter - Read Pulse Width and Frequency (On Demand).vi.  In the Frequency use-case, that example is very similar to yours if you were to remove the DAQmx Timing VI as I suggested in my previous post.

 

Hopefully this helps-

Tom W
National Instruments
0 Kudos
Message 9 of 9
(7,399 Views)