From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

What is this "BrickReference.lvclass" and how do I work with it?

Hello!  New here.

I'm trying to bone up on LabView via "LabView for Lego Mindstorms" for a possible job in the near future and I've run into a problem early on.
 
I'm programming my Lego brick in LabView to simply turn on the color sensor which is easy enough:  I build a while loop and inside that I have a color sensor block connected to a text block which displays light intensity from the sensor in text on the brick.  I compile and run and the sensor turns on and I can read the constantly updating intensity on the brick.  That part works fine.  Now I'd like to control the light sensor (which doubles as a light source with color LEDs) on the LV front panel.  The book I'm using (LabView for Lego Minstorms) says I need to right click the sensor block on the "generate light" input and choose "Create-->Control" from the resulting menu.  A Boolean pushbutton should appear connected to the sensor block in the Block Panel and a push button should appear in the Front Panel.  That's not what happens.  Two things are different here.

 
1) I have no "generate light" port to right click on.  This is probably due to using a more up to date version of Mindstorms than the book uses.  That's a book/Mindstorms issue that probably can't be solved here but hopefully solving the next issue will make this one irrelevant.

2) I right click and create the control, but instead of creating a Boolean push button as the book predicts, it creates a "BrickReference.lvclass" icon.  It connects okay with the light sensor and a corresponding block is created in the Front Panel but it is a paper weight as far as I can tell.  I can't do anything with it.  There is no button to push, no slider, knob, radio button etc. and I can't seem to change it into anything that works in any way.  I delete it and create a no kidding Boolean push button from the library but it won't connect to the light sensor and so I can't compile.  So now I'm a bit stuck.
 
I've looked for "Brick Reference" on line in the context of LabView class and have found little or nothing that tells me about its definition or how I can use it to control the light sensor via the Front Panel.  The help section with the software isn't much help either and yet I'm sure there must be a way to control a simple Lego light sensor from the Front Panel for debugging and other purposes.
 

If you know what I'm doing wrong or if you know an end run around this issue that will enable me to control a Mindstorms brick from the Front Panel in this way, please let me know.

Thanks!

0 Kudos
Message 1 of 4
(5,789 Views)

The book you are using is referring to an older version of the software. In this new version the control over what color is controlled by the combo box located below the vi. This VI is called a Polymorphic VI. Instead of using a Control to input the color you only need to use the combo box to select what color you want. You do not need to worry about the LabVIEW class that appears, you can delete it. 

Alex D
Systems Engineer
Academic Research
National Instruments
0 Kudos
Message 2 of 4
(5,762 Views)

Well, I'm not interested in controlling which color comes out of the LEDs.  I can do that already.  I'm interested in controlling the sensor from the front panel via a Boolean pushbutton.

 

Do you know how to do that?

0 Kudos
Message 3 of 4
(5,736 Views)

Hi,

 

Have you tried using a case structure? I think the attached VI is what you're trying to do. I'm assuming you're using LabVIEW 2012 SP1.

 

To answer your question more generally, the brick reference wire represents the brick you are targetting, and is mostly used to enforce the sequence of the program. If you have a VI targetted to the computer, the brick reference allows you to interact with multiple bricks in the same program, with each brick reference wire representing a brick.

 

 

 

 

0 Kudos
Message 4 of 4
(5,720 Views)