LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pulse Counter Using a DAQ Board

I am currently working on a project for school designing a control system for the Pulse Laser Deposition and we have everything but the laser functioning properly right now.  The problem with the laser is I need to output a Square Wave voltage level to trigger the laser.  The Delima I am running into is I cant seem to create a labview code that will properly count the number of pulses,  for some reason it counts improperly I no longer have the same file cause I am trying to figure out how to do this.  I did also work with a time setting which would count the number of pulses also which this option is more accurate but it only counts the number of pulses in seconds and not anything lower.  Here are some of the specifications.

 

Laser Pulses Frequency is from 1-10Hz

The laser voltage level output is 3.3V-15V

 

The DAQ Board I am currently Using Is the NI ELVIS board.  This will not be the board we use for the final project but we are trying to test everything on this board in the meanwhile.

 

I have the time delayed file for anyone who wants to take a look at it.

 

Any help would be greatly appreciated.

0 Kudos
Message 1 of 13
(9,654 Views)

Problem definition is unclear. Is the problem with generation of the pulse to laser or only with counting of the pulses.

 

The vi that you have attached does not have any of the code block that does the activity you are expecting.

 

Have a look at these two vi's which gives an understanding of how to accompolish the pulse generation and counting.

 

C:\Program Files\National Instruments\LabVIEW 8.x\examples\DAQmx\Counter\Generate Pulse.llb\Gen Dig Pulse Train-Continuous.vi

C:\Program Files\National Instruments\LabVIEW 8.x\examples\DAQmx\Counter\Count Digital Events.llb\Count Digital Events.vi

 

With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
0 Kudos
Message 2 of 13
(9,649 Views)

Well I tried what you suggested but unfortunatly it doesnt work the way I need.  I need to output square waves at a frequency from 1-10 Hz and I have to do an exact number of them.  Such as, if a user wants 317 pulses at 10 Hz then they get exactly 317 pulses.  I learned How both the examples work but I am unable to combine the two into one to get it to work properly.  The problem with combining the two into one is It gives the following error message when I try to run:

 

Possible reason(s):

Measurements: Task cannot contain a channel with the specified channel type, because the task already contains channels with a different channel type.

Create one task for each channel type.

Virtual Channel Name: Dev1/freqout
I/O Type Required for Virtual Channel: Counter Output
Physical Channel Name: Dev1/ctr0
I/O Type Required for Virtual Channel: Counter Input

Task Name: _unnamedTask<D>

 

Here is the updated file to take a look at.

0 Kudos
Message 3 of 13
(9,595 Views)

Hi sherard,

 

The reason you are receiving that error is due to the fact that you are specifying two channel types for one task.  You need to create separate tasks for the counter output (pulse generation) and for the counter input (count edges).  In the screenshot below, I have combined the two examples recommended above and added a pulse limit control to stop the generation at a set number of pulses (per your application).

 

pulse limit.jpg

Message Edited by DavidMN on 06-04-2009 01:37 PM
David
Applications Engineer
National Instruments


Digital Multimeters
0 Kudos
Message 4 of 13
(9,563 Views)

can you help me write the labview code to count a pulse flowmeter

0 Kudos
Message 5 of 13
(8,059 Views)

@HXdaq wrote:

can you help me write the labview code to count a pulse flowmeter


Attached is prototype code for counting edges, you can modify it to meet your requirement.

 

Low Level DAQmx Functions (Edge Counting)


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


Message 6 of 13
(8,049 Views)

thanks Smiley Happy can you send me the VI because I can only see the URL on the block diagram

0 Kudos
Message 7 of 13
(8,044 Views)

If you directly drag the attached PNG image, you'll find only URL in the block diagram.. However if you download the image and then drag it to the block diagram (from disk), you should be able to use the snippet.

 

Edited: you may also want to remove the scaling (multiplication with 1.41) Smiley Happy


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 8 of 13
(8,041 Views)

Ok Smiley Happy can you re-post the image in a downloadable form because I am having trouble downloading it?

 

 

0 Kudos
Message 9 of 13
(8,025 Views)

I got it!!! thanks 🙂

0 Kudos
Message 10 of 13
(8,024 Views)