I have a program written in Labview for my LEGO Mindstorms NXT 2.0. When the target is set to the computer, the program works just fine. However, when I set the target to the NXT, the program doesn't work the same as when targeted to the computer.

The program makes the robot go forward until it is 30 centimetres away from an object, which is detected by the NXT's ultrasonic sensor. Then the robot will stop. If the object is moved and there is no object within 30 centimeters of the NXT's ultrasonic sensor, the robot will go forward again until it is 30 centimeters away from an object again. Then, it will stop.

This works when the target is set to computer in Labview, but not when set to NXT. When set to NXT, once the first object is detected, it will stop. But, if the object is removed and there is no longer any object within 30 centimetres of the ultrasonic sensor, the robot will remain stationary and not move forward.

Here is a screenshot of the block diagram:

Screenshot of LabVIEW block diagram

Here is a link to the source code for the program.

Any help would be greatly appreciated.

  • 1
    Could you post a picture of your block diagram in LabVIEW?
    – nhinkle
    Dec 5, 2011 at 23:27
  • There, posted it. It will reflect this as soon as the edit is approved.
    – William
    Dec 6, 2011 at 1:02

2 Answers 2


I would recommend you post this question to the National Instruments Discussion Forums. We have a dedicated board for supporting the LabVIEW for Mindstorms software. Since you are using LabVIEW, you can post the question there and NI support engineers are guaranteed to help you. http://forums.ni.com/t5/LabVIEW-for-LEGO-MINDSTORMS-and/bd-p/460

  • William: if you get an answer from the NI site, can you please post back here with what you find out? Emilie: it sounds like you work for NI. Is there any chance that an engineer would be able to answer the question here on this site?
    – nhinkle
    Dec 8, 2011 at 2:48
  • Yes, I'm the Social Business manager for NI. I keep an ear out for any mentions of our products. Unfortunately, I can't assign a support request from an external site directly to an NI engineer. William will have to go through our online support channel on the NI Support Forums. But it should be very easy to crosslink to the discussion forum thread when he gets an answer there.
    – Emilie
    Dec 12, 2011 at 16:05

Remove the waveform chart and change the stop bottom to constant 'F' and try it. When you target to NXT, the programm can not compile the waveform charts and many other things to NXT.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.