12-06-2016 08:53 PM
first i have a sensor that measures pulses , and I need to obtain how many pulses i'm getting per second .
i couldnt find a way to do that , how can i convert the derivative of the pulses numeric variable that keeps changing while i am measuring from the sensor ?
Solved! Go to Solution.
12-06-2016 10:23 PM
Huh? Your problem is not quite clearly explained, but it sounds to me you have more of a Hardware problem than a LabVIEW problem. What sensor do you have? Have you taken a look at the datasheet, to see if there's info you need to know before working in your app?
It sounds to me like a very basic case for a frequency to voltage converter. What I would do is:
-Use a real-time capable device, like a comercial frequency to voltage IC or in my case, a cheap 16F887 and a few lines of code
-Get an output in voltage
-Measure that with any acquisition hardware of your choice or, if you're knowledgeable in PIC programming, send it right over to LV thru RS232 or USB if you rather use an 18 family one.
It is not realiable to use LV to measure pulses directly, as it runs on an OS that is not real-time capable, and you'll have discrepancies even at low frequencies. NI offers a wide range of hardware capable of reading frequency, and there are plenty of less expensive solutions, like the one I described.
Post back with a clear view of what you have, what you can buy, what you want to do, and we can help you further.
12-07-2016 01:32 AM - edited 12-07-2016 01:34 AM
Hi zawilious,
use a cheap DAQ device with a counter - even the cheap USB600x will do.
Then use that counter to count those pulses.
Read the counter value once a second.
Finished…
how can i convert the derivative of the pulses numeric variable that keeps changing
Which derivative?
Convert to what?
I guess you want to calculate the speed from pulse count: use a shift register to store values from last iteration…
12-07-2016 04:00 AM
could you please post an example how can I read the counter once a second , since i have a counter but its value keeps increasing as I am runing the code , I jut want to capture how many pulses new pulses i get over one second
12-07-2016 04:04 AM
Hi zawilious,
I jut want to capture how many pulses new pulses i get over one second
Store the counter value of the current iteration in a shift register.
In the next iteration you subtract the old counter value from new value to get the difference. Kind of easy, don't you think?
You know how to use shift registers?
Have you taken the free online resources to learn LabVIEW?
12-07-2016 04:24 AM
I'm new to labview ,
I appreciated your patience with me . could you please check the VI attached here , give it a look so you can understand what I am doing ,
12-07-2016 04:34 AM - edited 12-07-2016 04:34 AM
Hi zawilious,
could you please check the VI attached here
You seem to use a simple example VI from example finder…
What's wrong with using exactly this example:
- There is no loop in the VI, so how do you run this VI for more than a second?
- When you use the "run continuous" button: this is just wrong! (And your DAQmx task will be created and closed all the time…)
- Did you even try to understand my example image and to implement it in your VI?
I'm new to labview
Then take those FREE online resources to learn LabVIEW!
12-07-2016 04:43 AM
yes I used a demo for a hall effect sensor from the Myrio project essential guide and I want to modify it , the thing is
that I don't have enouph time to try thinks and learn since I need to implement this in a project that I need to submit it today .
I understood the exapmle you gave , but I didn't figure out how can I take this difference once every one second
12-07-2016 04:50 AM - edited 12-07-2016 04:51 AM
Hi zawilious,
I don't have enouph time to try thinks and learn since I need to implement this in a project that I need to submit it today
I'm sorry, but this community isn't the right place to ask for ready-to-use stuff to solve your homework…
Either you learn to use LabVIEW - or you can't solve your homework!
Don't get me wrong: you can always ask for specific help!
Ask specific questions, provide your VI and tell us, where you are stuck!
But please don't ask for "solutions for free"…
but I didn't figure out how can I take this difference once every one second
Have the loop iterate once per second.
Replace the random() function in my image by your DAQmxRead function…
12-07-2016 05:08 AM
I didn't ask for ready to use stuff , I'm just asking to learn a specific funcion that I need.
thanks for guiding me