LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating New Blocks for LEGO MINDSTORMS NXT

The most advanced capability of the toolkit is the ability to create blocks for LEGO MINDSTORMS NXT. The goal for this part of the toolkit was to expose the capabilities that the development team had during the MINDSTORMS NXT Software 1.0 development process. Building the blocks requires an intermediate knowledge with LabVIEW and there are interesting caveats that you'll uncover. Post your questions and issues here. This board will be monitored by NI Applications Engineers and members of the development team.

Thanks and enjoy expanding the MINDSTORMS Software.

John Field
MINDSTORMS Software Group Manager
LabVIEW R&D
0 Kudos
Message 1 of 45
(28,226 Views)

I'm still pretty new to LabVIEW, so forgive me if this question is obvious.

In the NXT Toolkit, there is a block called "NXT_RotationSensor.vi"  I'd like to use that, but I want it to output a signed count, instead of a count +direction.

So, if I add this output to the VI, how will it affect other things?  Will it affect anything else?

Next, if I don't change the block, and want to send an NXT-G block I've made based on the "normal" NXT_RotationSensor.vi to someone who has the DBU installed, will I have to include the block?

Thanks

Steve

0 Kudos
Message 2 of 45
(28,133 Views)
As a general rule, you probably shouldn't change the implementation of anything in vi.lib because (as you mention) this makes it hard to share code. I'd recommend creating a new VI that includes NXT_RotationSensor.vi where you compute the outputs that you want. Then, when you distribute your block, make sure to share your new VI as well.

- john
0 Kudos
Message 3 of 45
(28,124 Views)

That's what I thought, thanks.

Steve

0 Kudos
Message 4 of 45
(28,122 Views)
Please disregard; I put this in the wrong thread.

Message Edited by madengr on 12-11-2006 04:37 PM

Message 5 of 45
(28,043 Views)

Hello

I have done some programming making a rotationcount_regulator for the motors and the NXT. It works fine. When I use the "Edit/Create SubVI"-function it doesn´t work any more and I don´t get any errormessages. I have done a mass compile and I´m using version 8.20. I would like to include the two VI´s in this message but I do not know how to do that. Any help with this problem is welcome.

/Magnus

0 Kudos
Message 6 of 45
(27,479 Views)


@Holmm wrote:
I would like to include the two VI´s in this message but I do not know how to do that. Any help with this problem is welcome.

Below the edit window where you compose the message,  is a field for attachments. Click the browse button and select your attachment. To add another, click on "add additional attachments" until you have two browse buttons.  etc.

Be aware that these fields clear whenever you preview the message and you have to attach them again. Thus, you should add the attachments as a last step right before posting.

Good luck! 🙂

Message 7 of 45
(27,469 Views)
Hello again
 
Refering to my message yesterday. I have problems when making a subVI. I'm working with LabVIEW (8.20 and the NXT). I have made a program that rotates the motor some degrees (setpoint) and the program works fine (RotationCountRegulator_test.vi) but when I try to make a subVI (Edit/Create SubVI) it doesn´t work any more (RotationCountRegulator_test_withsubVI.vi). The two VI´s included in this message. Any help is welcome.
 
If anyone knows another way to solve this "motordistanceproblem" I would be greatful. In the offline programming of the NXT there is a VI called "Motordistance". That is the function I´m after for the online programming.
 
/Magnus
0 Kudos
Message 8 of 45
(27,451 Views)

Hi /Magnus,

I tried your VIs and wasn't able to immediately identify a problem.  That being said, I also didn't have your sub-VI there with which to test the higher level VI.  Attaching that sub-VI would allow me to try the whole thing out from my end, too, to see if I can determine a problem.

Another solution to this question might be the following:

You could write a program on the NXT that listens for a particular mailbox, then send strings to that mailbox from the PC.  The NXT could then respond with an action based on the message received (ie. start a motor with one message, stop it with another).  Just another approach that might work!  Unfortunately, there isn't a straight interface (with the direct commands) to the synchronization function in the firmware that the 'motor distance' function employs for its work.

I'd be interested to hear how things work out!

Peter

Peter L.
Applications Engineer
National Instruments
www.ni.com/support/
Message 9 of 45
(27,399 Views)

Hi Peter

Thanks for your help. The sub-VI´s that I use are the ones included in the LEGO toolkit for LabVIEW. They also have a lot of sub-VI´s "inside" so I can´t attach them all to this message unfortunately. If you could install that toolkit and try, I would be greatful.

To bad to hear that there isn´t a straigth approach to the "motor distance"-function with the online commands. I have tried to use the "Tacho Limit" variable but I can´t access the flag "Tacho Limit" and the PID controls. Do you know why this isn´t possible? Is this function just forgotten or is it not possible? Due to the possible samplerate it should be possible. Please pass this request on to your colleuges responsible for the NXT toolkit.

 

/Magnus

0 Kudos
Message 10 of 45
(27,359 Views)