LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

Energy Meter from the Renewable Energy Add-on Set

I am trying to read data in real time from the Renewable Energy Meter from the NXT Lego Mindstorms Renewable Energy kit.  The add-on for NXT for Labview doesn't seem to include this sensor block and I've been unsuccessful in my attempts to draw the data from the NXT. I called Lego and they suggested that I should contact NI.


Are there any plans to develop a block that can read data from the energy meter?  Is that block something that could be put together using the .vis that come with the NXT Programming software for the Renewable Energy blocks?  The .vis seem to load up, but I've been unable to set them up to work with the NXT and their back panels are password protected.  I do not know how to program them correctly.  Then again, I'm at a beginner programming level.  Any ideas would be appreciated.

 

Or if you think it's a lost cause until NI comes out with the correct sensor block, that would be useful information as well.

0 Kudos
Message 1 of 7
(9,350 Views)

Hi Max2trillion,

 

Would you be able to post a screenshot of the code you are currently working with? I downloaded the NXT Toolkit and found the following VI to read sensors:

 

Read Sensor

 

This VI is found in the Block Diagram's Function palette >> NXT Robotics >> NXT I/O >> Read Sensor.vi

 

You can download the LabVIEW NXT toolkit here: http://zone.ni.com/devzone/cda/tut/p/id/4435

 

Let me know if you are unsuccessful in using this VI to acquire data. In addition, you can also try the NXT Data Viewer. Go to Tools >> NXT Application Browser >> NXT Data Viewer >> click on Launch to add different data sources.

 

Keep us updated if any of the above work for you, thanks!

 

 

Aldo A
Applications Engineer
National Instruments
0 Kudos
Message 2 of 7
(9,337 Views)

That reads the battery level of the NXT, right?  From testing, this seems to be correct. I need the Watts and Voltage inputs for the Energy Meter which feeds into the NXT like a sensor would (through ports 1-4).

 

The Energy Meter feeds into the NXT through an I2C connection.  If it were a simple signal (analog for instance) I could use one of the other sensors like you suggest.  Unfortunately, the data is sent in some format and I don't have the experience to write a library to read the information that's coming out (my professor mentioned that this could be the case).

 

I've attached the NXT Programming screenshots to help you understand the outputs that I need to have access too.  In the first screen shot, it shows how the energy meter input is used in the code.  The input is from port 3 and it's reading A-in.  The second screen shot is setting up a read function in the NXT Data Logger and I can select several options that are unavailable unless you download NXT's special renewable energy add-on.

 

My conclusion is that until I can add the correct data source in Labview (which is something addtional to the software that is currently supported) I will not be able to read the data that the rest of my program will rely on.  The LEGO people support my conclusion as they stated that the Energy Meter is not currently supported in Labview.

 

The last picture is of my Labview code trying to extract data from the device.  The top portion of the code is reading the raw data from the port... it reads 1023 when running without changing, which is the maximum value for a 10 bit code.  Nothing else comes out.

 

The bottom portion of the code is attempting to use the bits of code that come with the NXT programming software which I will post on my next post as I cannot add any more pictures.

 

 

0 Kudos
Message 3 of 7
(9,334 Views)

The first picture of the front panel is what I think is the .VI that the NXT Programming software draws to read the energy meter data in.  The file title is "Energy Meter In" and it appears to have the right icons.  The second picture is the password protected back panel that I don't have access to.  Again, this comes as a part of the NXT Programmig Renewable Energy Add-on software package.  All that's in the software package are the read functions for the Energy Meter sensors.

 

Unfortuntely, I cannot use any of these .VIs.

Download All
0 Kudos
Message 4 of 7
(9,332 Views)

Hi Max2trillion,

 

If I understand correctly, what it comes down to is the last VI which you posted is the one which reads in the I2C data coming from the energy meter, which unfortunately for us, you cannot use since the block diagram is password-protected. 

 

Overriding password-protected files is not something I can help with, however, if you are feeling bold, there are resources which show how to implement I2C for other devices which can help in figuring out the format of the output of the energy meter. For example, you can start by looking at this tutorial which outlines I2C communication with one of the USB8451 modules: http://zone.ni.com/devzone/cda/tut/p/id/5767 In specific, take a look at the Read Operation section.

 

I could not find a VI which will do what we want for now and I do not know if NI plans to develop one in the near future. 

 

 

Aldo A
Applications Engineer
National Instruments
0 Kudos
Message 5 of 7
(9,314 Views)

Thanks Aldo.

 

I think that you've covered everything I was looking for.  I wanted to be sure that NI hadn't developed the VI for this application yet and that figuring out the I2C format was the only way.  I also wanted to start the conversation in case anyone else stumbles onto this topic as I couldn't find any other resources referring to this issue.  I'll see if I can do anything with that I2C translation.

 

Thanks again,

 

Max

0 Kudos
Message 6 of 7
(9,306 Views)

Dear all,
I am also working with LabVIEW and the Energy Meter (http://education.lego.com/en-us/lego-education-product-database/machines-and-mechanisms/9688-renewab...) for an experiment. I would like to know if there is any implementation for reading this sensor in LabVIEW nowadays or what can be a solution for reading the measures from this sensor.
Thanks all in advance,
Llanos

0 Kudos
Message 7 of 7
(8,654 Views)