LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I create front panel objects from the block diagram

Labview 6 Windows

I need to generate 50 LEDs (actually 512) from the block diagram. I need to be able to manipulate thier coordinates as well. I tried to have a sub vi to make 1 LED, and make the code create 49 more on the front panel, spaced 50 units a part. What I want to avoid is having to copy 50 seperate LEDs and property nodes (512 actually, I am starting simple here. Is there a way to accomplish this without all the copying and pasting? I include my sample code to show what I am trying to do.
Download All
0 Kudos
Message 1 of 7
(2,549 Views)
Nate1,

You can't create an object from the diagram. However you can display as many as you wish in a picture control. See the attached VI. At each iteration, the value and caption of the boolean is changed. The image is read and added to a picture control.


LabVIEW, C'est LabVIEW

0 Kudos
Message 2 of 7
(2,549 Views)
Also you can use cluster of leds and manipulate with each led. Look attached example.
0 Kudos
Message 3 of 7
(2,549 Views)
You cannot create the booleans from the block diagram but if you drop 50 booleans you can get a reference to each one programatically. Then you can change their positions.

Attached is a subVI I created to produce an array of references to booleans on the front panel. You just need to wire the path of the VI with the booleans to the VI and it outputs the array of references which you can step through to position the LEDs.

Jeremy Braden
National Instruments
0 Kudos
Message 4 of 7
(2,549 Views)
how do I vary the number of LEDs in this code? Also, I think I know it will work, but if I put this code in a "while" loop, I should be able to, with controls from a "mouse" property node for the cluster, change the state of the any individual LED from on to off. the mouse would grab the coordinates and with some code, specify the LED to turn on or off. Does this seem do-able? Much appreciated, Nate
0 Kudos
Message 5 of 7
(2,549 Views)
Sorry. I meant to post this on the answer above.

On another note, can this be written in Labview 6.0
I don't have 6.1

Also, will I be able to change the state of each LED if I put it in a while loop and use mouse controls?
0 Kudos
Message 6 of 7
(2,549 Views)
The VI I posted is a subVI of another program I wrote. The main VI is not working or I would have posted it as well. I could drop any number of booleans on the main VI and the subVI (the one I posted) automatically created those references.

Jeremy
0 Kudos
Message 7 of 7
(2,549 Views)