LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

counter input problem

hi, i'm using a counter input to count the falling edges of a digital pulse. I need to convert this into a time based measurement (period/frequency), but am having a litle trouble doing this. If any one can help? i'd prefer it if it were as simple as possible, i.e. no fancy programming as I'm new to LabVIEW and would like to fully understand what i'm looking at!
 
Many thanks in advance!
tom
0 Kudos
Message 1 of 7
(3,227 Views)
Hi,
 
You may search your computer for the file "ni-tio.llb". This library have examples on using the counter inputs for different measurements including period (Measure Period (NI-TIO).vi) and frequency (Measure Frequency (NI-TIO).vi). Hope this will be helpful for your application.
 
Regards
Message 2 of 7
(3,214 Views)
Thanks for your reply, i searched my computer, but cant find this libaray extension? Have you got any examples of how to solve my problem?
many thanks for your response!
tom
0 Kudos
Message 3 of 7
(3,203 Views)
Hi there,
 
Usually it lies at "C:\Program Files\National Instruments\LabVIEW 7.0\examples\daq\counter\" if you are using windows based operating system.
Check the below link, it might be helpful:
 
Regards
0 Kudos
Message 4 of 7
(3,189 Views)

Best to places to start are the example finder (there is an example which does what you want) look for "hardware input output>>daqMX>>counter measurments>>count digital events>> count digital events.vi". 'This example demonstrates how to count digital events on a Counter Input Channel.  The Initial Count, Count Direction, and Edge are all configurable' (from the description under example finder).  What care are you using?  after working through the example you can place an Daq Assistant express vi and generate some code and eventally when you are familliar with daqMX drivers writing the code from scratych will take only a few minutes.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 5 of 7
(3,183 Views)

Hi

What version of LabVIEW are you using? If you're programming with version 7.0 or higher you can configure your counter for period or frequency measurements quite easily using the DAQ Assistant.

Just drop down the DAQ Assistant Express VI. The Wizard that opens will ask you to choose your input type. Choose Counter Input and it list options for Edge Counting, Frequency and Period Measurement. Choose the one you want then choose the counter with which to do the measurement. When you click Finish a configuration dialog box will open up for you to configure the Input Range, the Task Timing, etc. There will also be some further information in the help section along the right of the window. When you click OK the DAQ Assistant will build your code.

I've attached a Zip file with 2 labview programs to demonstrate this. (They're written in version 8). Connect DIO 0 to PFI 9 of your DAQ card (I'm using an M Series card. If you're using a different card let me know). Extract and run both files. The Digital Output VI generates an alternating high and low signal for each iteration of the loop. The Counter Frequency Measurement VI measures the frequency of this output. The frequency is determined my the Wait Until Next ms Multiple function so change the input to that to vary the frequency.

Let me know how you get on with that and if you require more info.

Good luck!
SarahB

NI | UK
Sarah

Applications Engineer | National Instruments | UK & Ireland
Message 6 of 7
(3,168 Views)
Hi, thanks for all of your help. I finally figured out how to do this! took me long enough, but i am only a beginner! Thanks again
0 Kudos
Message 7 of 7
(3,153 Views)