LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create multiple VIs using a for loop

Solved!
Go to solution

Hi,

I'm still pretty new to LabVIEW, so this question might be easy for you guys here..

 

I'll simplify what I'm trying to do.

I've got two numeric controllers that act as the rows and columns of a matrix.

 

I'd like to take those numbers from these two controllers and use them to create a matrix of a certain picture.

 

Example:

The rows controller is given 3, and the columns controller is given 4.

Using these numbers I would like the end result to show a certain image (let's say, a cube) multiplied on a 3 by 4 matrix.

Let's say the picture is an X, then the end result should be:

 

XXXX

XXXX

XXXX 

 

I think I should be using a double for loop (one inside the other obviously), and I should also create the "position" property in order to display each picture of the cube in it's right place.

 

 

The problem is that I don't know how to CREATE the pictures over and over again, while being able to control each one's position property.

 

Any help would be GREATLY appreciated!

0 Kudos
Message 1 of 9
(4,284 Views)

I'm confused as to what you are looking for.

 

Your subject line says using multiple VI's.

 

You talk about "numeric controllers".  Do you mean numeric controls on the front panel?

 

What is the "matrix" you are talking about?

 

What does an image have to do with this matrix?

 

Are you trying to do something in a picture indicator?  And where to the "multiple VI's" come into play?

0 Kudos
Message 2 of 9
(4,279 Views)

1) By "multiple VIs" I meant that I think that I need to create express VIs on the fly while running the for loop. I might be totally wrong here.

2) Yes, by "numeric controllers" I meant numeric controls in the front panel.

3) The matrix I'm referring too isn't an object nor a VI in LabVIEW but a virtual matrix that is the end result. I used the term "matrix" because the end result is actually a matrix (of rows and columns) of pictures..

 

I'll try to elaborate and even simplify it more:

Let's say I want to display one picture. That's easy, no problem there.

Now let's say that I'd like to display n pictures on a one dimensional array. Just one row.

What I think I need to do is to read from the numeric control in the front panel the number (n) of pictures, and then create them in a for loop, while using the "position" property to set the distance between each picture (using coordinates).

My original question was just like the above, but for a two dimensional matrix/array. So I guess we can even simplify it even more, by saying it's only one dimensional.

 

My way of action here might be totally wrong, and there might be an easier way or another way to go about this...

 

 

Thanks for the quick answer!! 🙂 

0 Kudos
Message 3 of 9
(4,268 Views)

Something like this should do: (Populate the image data cluster in the usual way, ie. Read From JPEG/PNG/etc)

 

PictureMatrix.PNG

 

PictureMatrix.png

Message 4 of 9
(4,264 Views)

Wow, this looks great!!

Is there any chance that you can upload that file to me somehow?

Maybe post a link to somwhere you upload it to?

 

I ask because other than the flattened pixmap I'd don't know most of those express VIs.. 

 

 

Thanks! 

0 Kudos
Message 5 of 9
(4,251 Views)

If you have LV2009 you can drag the image with the code to your block diagram (it is a snippet).  If you are using a previous version, let me know and I can save it for an earlier version.

 

I'll let the accusation that I have used Express VIs slide this time...Smiley Wink

0 Kudos
Message 6 of 9
(4,247 Views)

Hahaha 😄 

I guess I just don't know the correct terminology for those little boxes.. BTW - I'd be happy if you could enlighten me 🙂 

 

What we have is LabVIEW 8.6... 

0 Kudos
Message 7 of 9
(4,242 Views)
Solution
Accepted by Alex789

Those little "boxes" (key word being little) are simply called sub-VIs.  Express VIs are big blue abominations that take up valuable real estate and purport to make your life easier.

 

Here is the VI saved to LV8.6

 

 

 

 

Message 8 of 9
(4,235 Views)
Thank you so much!!
0 Kudos
Message 9 of 9
(4,172 Views)