LabVIEW with NXT sensors

Some skilled LabVIEW programmer: PLEASE write vi’s for the NXT accelerometer and gyro or tell me where I can get them.

I spent some time this summer working through LabVIEW Basics Course I. This fall I purchased an NXT robot so I could learn to program a robot with LabVIEW. Towards that end I also purchased the accelerometer and gyro.

After spending $400 on my NXT kit I discovered that the LabVIEW NXT toolkit does not include vi’s for the accelerometer and gyro. I downloaded the NXT-G code from Hitechnic’s website and recompiled the vi’s. However, the vi’s are password protected and useless.

I found some website where National Instruments claimed that they weren’t releasing the code since it was proprietary. I’m afraid I just wasted a lot of money, but I still want to learn to program using the acclerometer and gyro.

Thanks in advance!

I did notice that the digital sidecar has an NXT sensor connector. Does WPI or NI plan on releasing drivers for any of the NXT sensors for the cRio ?

The compass is available in the WPILib C++ Class list

How do we use it in Labview?

There’s no vi for it, so we might have to write our own.
There are I2C vi’s for the basic communications you need to get it working.
Just search Functions for I2C.

LabVIEW comes with some examples using the I2C vi’s to take input from an NXT compass and an NXT accelerometer.

When you fire up LabVIEW, on the bottom right under “Examples,” you’ll see “More…”
Click on “More…” and you’ll get a list of examples including:
HiTechnic Accel Example
HiTechnic Compass Example

Open one of those up, say the Accel one, and in the Block Diagram you’ll see the Accel Open subvi. Double click on that, open the Block Diagram window, and you’ll see how the I2C communication is handled.

Slightly off topic

Also with the NXT connector on the digital sidecar if you look at the jaguars i believe they have the same connector on them. I think i read somewhere in the future we might be using those instead of the PWM cables for speed control?

i think it was called CAN “control area network” or something like that

Sorry i just thought i would bring that up just thinking that connector might not actually be meant to use for the NXT devices…

(if i had been misinformed please let me know) Thanks!

No, it’s not the same connector.

i think it was called CAN “control area network” or something like that

Yes, it’s CAN.

There are no built-in CAN connections on the cRIO or any of the breakouts or sidecars. To use it in future years will require adding a cRIO CAN module (e.g. NI 985x).

Ok i wasn’t sure if they were the same port or not…

I’m still interested in using a NXT with LabVIEW and an accelerometer and gyro. The point of this thread was to find a way to learn robot programming with LabVIEW on an NXT (cheaper than a cRIO).

I’ve messed around some with I2C and the Advanced Programming guide, without success. Can someone please post vi’s for the NXT to read the accelerometer and gyro?

I’m afraid I’m not going to be of much help. It sounds like you have VIs from the mfg of the sensor that work, and that means you can write LV code that makes your NXT respond to the sensor input.

To dig deeper, into the actual protocol for talking with the sensor is something that the toolkit does support, and you may be able to find the protocol details on the HiTechnic website or on a similar advanced LEGO site – and are good sites to scour for that sort of thing. That would also be a better place to ask advanced questions about the NXT.

On the otherhand, the author of the VIs was not NI, and they chose to lock the diagrams, likely for support reasons.

Greg McKaskle

VIs for HiTechnic sensors are available from HiTechnic. They are not on the web site yet but will be posted there shortly. In the mean time, email [email protected] for a copy.

And this is why I love ChiefDelphi and FIRST.

Thanks HiTechnic

And, as an aside, you can ALWAYS read analog sensors like the accelerometer and Gyro by using the Light Sensor VIs. I did with accelerometers and gyros from the last several year’s KOP with ease.