03-20-2016 08:32 AM - edited 03-20-2016 08:47 AM
Hellow. I want to implement Parallax PING))) with myRIO in labview. I found an example on NTS Press youtube channel:
but the display is not working good and i got 1e-.. in cm. Maybe the mathematic operations don't match with my sensor. Can somebody give me another example for my problem? It was very easy with sbRIO to use Read distance.vi and to do a simple math operation after, but with myRIO I don't know how to do it.
03-20-2016 08:56 AM - edited 03-20-2016 08:57 AM
The information of this sensor listed here tells us that it only uses one I/O pin to "trigger" and "listen to echo". Also this sensor talks "digitally" to other world. The first mistake you're doing is using an "ANALOG OUT" express VI to listen to digital pulses from sensor.
You need to use single digital I/O to first send a pulse of few millisecond, change the I/Os state to read and then receive digital pulses. Then measure these pulses and do some maths to obtain distance.
Below are few good resources to get you going.
https://decibel.ni.com/content/docs/DOC-30452
https://decibel.ni.com/content/docs/DOC-36034
Regards.
03-20-2016 09:08 AM
Thank you, I see the mistake. I found that the correct formula is d=c*t/2. I also found a very good example that works, but the problem is that it calculates the distance only once and the program stops after. I put it in another while loop but it doesn't work either. I will attach the example, and if you have time to look at it I will be very grateful:
Thank you.
03-20-2016 09:12 AM
I am running LV14.0. Send me the converted version and I'll take a look at it.
03-20-2016 09:22 AM
Can you open now?
03-20-2016 09:34 AM
It runs once because at sixth iteration of the outer while loop, the "equal to" operator renders TRUE after it finds both state enums equal (i.e. the Stop state). Remove this function and just use a boolean stop button.
Regards.
03-20-2016 09:35 AM
It runs once because at sixth the iteration of the outer while loop, the "equal to" operator renders TRUE after it finds both state ENUMS equal (i.e. the Stop state). Remove this function and just use a Boolean Stop button.
Regards.
03-20-2016 09:41 AM
Ok thank you very much for the help!
03-20-2016 11:20 AM
Your success also deserves giving me a kudo.
03-22-2016 05:49 AM
Sorry for disturbing you again, today I tested the vi from above, and now the program won't stop after 1 read of distance but the distance doesn't change. It shows for example 0,3 m, the vi is still working but the distance won't modify whatever i put in front of the sensor. It calculate and show the distance for 1 run only. Can you help me again please?