LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Parallax PING))) implement with myRIO

Hellow. I want to implement Parallax PING))) with myRIO in labview. I found an example on NTS Press youtube channel:

 

Capture.PNG

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.

0 Kudos
Message 1 of 14
(5,601 Views)

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. 

 

 

 


0 Kudos
Message 2 of 14
(5,568 Views)

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.

0 Kudos
Message 3 of 14
(5,555 Views)

I am running LV14.0. Send me the converted version and I'll take a look at it. 


0 Kudos
Message 4 of 14
(5,542 Views)
0 Kudos
Message 5 of 14
(5,529 Views)

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.


0 Kudos
Message 6 of 14
(5,507 Views)

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.


0 Kudos
Message 7 of 14
(5,505 Views)

Ok thank you very much for the help!

0 Kudos
Message 8 of 14
(5,485 Views)

Your success also deserves giving me a kudo. Smiley Tongue


Message 9 of 14
(5,465 Views)

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?

0 Kudos
Message 10 of 14
(5,412 Views)