05-28-2009 09:57 PM
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.
05-28-2009 10:44 PM
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
06-03-2009 11:00 AM
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.
06-04-2009 01:34 PM - edited 06-04-2009 01:37 PM
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).
08-05-2013 05:30 PM
can you help me write the labview code to count a pulse flowmeter
08-06-2013 12:03 AM
@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.
08-06-2013 12:53 AM
thanks can you send me the VI because I can only see the URL on the block diagram
08-06-2013 01:10 AM - edited 08-06-2013 01:11 AM
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)
08-06-2013 02:45 PM
Ok can you re-post the image in a downloadable form because I am having trouble downloading it?
08-06-2013 02:48 PM
I got it!!! thanks 🙂