05-13-2016 04:07 PM
Bonjour à tout le monde. Je suis en deuxième année BTS électrotechnique et je travaille sur un projet. Ma problématique c'est arriver à lire des impulsions générer par un compteur d'eau. La Fréquence des impulsions est proportionnelle au débit. Ma fréquence max est de 14 Hz d'après la doc du constructeur ; J'arrive à lire le signal en passant par labview (evidement j'utilise une Arduino mega), j'utilise LINX. Mon problème c'est de mesurer la fréquence de signal pour pouvoir avoir le débit instantané. J’espère que vous aurez une solution pour que je puisse avoir la fréquence. Je joins le programme que j’ai fait. Ce qui est entouré c'est le bloc que d'apres l'aide peut lire la frequence d'un signal. Mais apres quand je lance le programme il me dit erreur. Merci d'avance à tout le monde.
05-14-2016 02:20 AM
You are trying to get the statistics for a single value i.e. a single value does not have an amplitude or frequency. You need to gather a set of data over a period of time (where the data points are obtained at a constant frequency that is greating than the nyquist frequency).
However, for an application like this, I highly recommend that you implement the frequency calculation on the Arduino using interrupts. Then, you would use a LINX custom command to get the current value of the calculated frequency.
For further questions regarding LINX, please post on the LINX forums.
05-14-2016 04:02 AM
Thank you for your answer. So, if I understand, I must Use a digital read to read a pulse. And after How I can read the frequency??
Thank You !!
05-14-2016 12:06 PM
No, that is not what I said. Here is a document that I found that talks about measuring frequency using the Arduino.
05-14-2016 02:34 PM
But this he can't help for write a code with Labview software For my project i must use Labview like an Human Machine Interface. I did lots of research on the internet, look for example at what insipirer me ... But Nothing Pleas Heeeelp
05-14-2016 09:28 PM
You would still be using LabVIEW with LINX. The link that I gave you shows you how to calculate the frequency of the sensor.
Using the first option shown, you can actually do without modifying LINX at all since you have access to the pulseIn() function via LINX. In LINX it's called Digital Read Pulse Width.
You can also do the second option listed on that page. It requires writing implementing the interrupt in custom firmware to calculate the frequency. Then, you would create a LINX custom command to access that value. If you opt for this method, I'd recommend making a LINX custom command that simply reads a digital pin so that you 1) get the custom LINX firmware set up and 2) verify that your new custom command works. After getting that to work, you would add the interrupt code to the custom firmware and thento return the frequency value to LabVIEW.
05-15-2016 05:56 AM
I test The digital pulse width; I saw somthing in the Waveform. But I don't understand how exactly this foncton work; The Pin Pulse Width (uS), what kind of information tell me. If I understand is the time between the pulse?? No??
Thank you again! And sorry for my bad English
05-15-2016 12:13 PM
To understand how that function works, you can take a look at the documenation for the function used on the Arduion: pulseIn(). If your sensor does not output a 50% duty cycle square wave, you'll probably need to use the interrupt method.
05-23-2016 06:12 AM
Thank you!
You know the name of the fonction Millis in Labview??
Thanks again