LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

time between pulses

Hi, I want to measure flow of some fluids. Sensors give a binary pulses per 10l. I made  a vi which do it but I think there is some bug in Lab view 8.2
 
I used math script for this calculation . I want to use PCI 6510 as digital card for this. In my program it was used simulation for this card.
 
What was a problem?
 
It works correctly, but when I press in front panel in (for example) place for indicator of flow(mouse cursor) it start to calculate quickly. I am afraid this qcould be a wrong situations in application.
 
How can I solve this problem??
 
Thanks
 
Emir O.
0 Kudos
Message 1 of 4
(3,203 Views)
Hi Emir,

I'm a little confused about what you're trying to do within your application.  Does the device containing the fluids send a single pulse or a binary representation (1010 = 10 or 100 Liters? every 10 Liters)?  If you're just receiving one single pulse from the device, it may be more suitable to use a Data Acquisition (DAQ) card with a counter to count the edges of these pulses.  If you want to use the 6510 for this application, you will need to use a software timed loop to check the digital input levels quick enough to catch every pulse.  This may be difficult if your pulses are coming in too fast or don't stay high (pulse width) long enough. 

In addition, could you give some more details about what is occuring when you say, "when I press in front panel in (for example) place for indicator of flow(mouse cursor) it start to calculate quickly."

I would also recommend taking a look at our shipping examples.  These can be found by going to Help » Find Examples in LabVIEW.  I would take a look at the Read Dig Chan.vi (Hardware Input and Output » DAQmx » Digital Measurements).  You may want to consider reducing the Wait Until Next ms Multiple delay.  This will increase the loop rate of your digital read.  I would also like to note that the loop rates in LabVIEW will be more on scale with millisecond delay.  If you need something faster, such as micro to nano second, you should consider going to a hardware timed solution.

I hope this helps,
Paul C.
0 Kudos
Message 2 of 4
(3,169 Views)
Hi, Emir is again.
 
Thanks for answer. This application would have 30 flowmeters with 10 or 100 l per impulse. One pulse is = 10 or 100 liters. This is not so quickly measurements and I think this card would be enough.
I also need to measure time between pulses. How can I do it?
Also is it possible when I write this data with time stamps to table to give a command to calculate a flow between two time periods??
 
Best regard
 
Emir
0 Kudos
Message 3 of 4
(3,154 Views)

Hi Emir

Since the reading of a digital measurement from the PCI-6510 is software time base we have to get the stamps inside the while loop using one of two functions, the first one can be the “Get Date/Time in Seconds”, this function will give you the current time every time the loops runs in a date/time format. The other function is the “tick” function (see code attach) that will give you the time in milliseconds.

Both cases you will have to save the timer value in an array with the digital value read from the card, for simplicity you can bundle the data with the timestamp into a cluster, from here a little bit of array manipulation and calculation will give you the time between pulses; this calculation has to be program by you. Always remember that since you have software timed application all these measurements are depended on how good your code is written and your computers speed. What I will suggest is to use Producer/Consumer design pattern were you read the data with the producer and make all the calculation with the Consumer.

I will also suggest taking a look at this DevZone article since you are using a simulated device: NI-DAQmx Simulated Devices.



Message Edited by Jaime F on 11-05-2007 12:57 PM
Jaime Hoffiz
National Instruments
Product Expert
Download All
0 Kudos
Message 4 of 4
(3,121 Views)