Using VEX Ultrasonic Sensor

So I’m trying to use a VEX Ultrasonic Sensor(276-2155) But I’m having a difficult time trying to find the correct Labview Example that works with the VEX Ultrasonic Model. Where can I find an example? Also, when we program the Ultrasonic Sensor how would I get it that it sends information(about Distance) to the “User Messages” Text Box in the Driver Station and continuously updates it? Thanks

I don’t think there’s an example for that type of sensor. The way it works is not something that is supported directly by the WPI library. I’m not even sure anyone has figured out the proper wiring and counter configuration to get useful information from it. Hopefully someone will answer with advice you can use.

Also, when we program the Ultrasonic Sensor how would I get it that it sends information(about Distance) to the “User Messages” Text Box in the Driver Station and continuously updates it? Thanks

Use the “Write User Message” function in the WPI Driver Station function palette.

Most ultrasonic sensors are connected via the analog module of the CRIO. If that is true in your case, read the voltage from the analog channel and multiply it by 100 to get the distance from the sensor.

There used to be a set of (horribly written) vis in WPIlib to support an ultrasonic encoder with two digital ping/response lines. I believe they still exist, but I’m not sure.

It used the DIO Pulse feature and DIO Interrupt features to generate and listen to a pulse. Unfortunately, it was written to Wait On Interrupt, causing the thread that called the ultrasonic sensor to hang until either a pulse was returned, or the timeout (60ms) was reached.

Unfortunately, the majority of the library is written synchronously with blocking calls like this, which is IMHO really really bad embedded code design.

The FPGA has a lot of rarely or never used features which I have never seen used, including these DIO pulse and interrupt features, and a lot of DMA capabilities.