So, I’ve been trying to get the the VEX ultrasonic sensor to work with the cRIO. I’ve created a while loop in which I have a “wait”, the Ping VI, and the Get Distance VI. Outside of the loop I have the respective Open and Close VIs for Ultrasonic sensors.
It /partially/ works. If I run it normally, I receive the distance to whatever object was in front of the sensor when I hit run. This also happens if I tell it to run continuously. Also, I attached a display to the loop timer. This timer stops updating after a period of time.
BUT: If I ask it to highlight execution it will update the distance as fast as the highlights move.
Essentially, I get a distance out of it, but it won’t update the distance.
I think the problem may lie in the respective lengths of the ping time and the loop wait time. Also, I am using the second update of Labview.
Any pointers? Tips? Attached is my code with some comments detailing the situation.
Ultrasonic_Senor_Robot.zip (130 KB)
Ultrasonic_Senor_Robot.zip (130 KB)