LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there some form of a layout manager in labview?

I am trying to develop a GUI for my work and would like to be able to layout my designs using some form of a layout manager into a grid-like design. Once this is done, during run-time I would like to programmatically move some controls around and generate/create graphics on and around some of these controls. Basically it will be like a flow diagram with arrows moving around to show where the connections are made in the flow. Can this be done?

thanx in advance.
0 Kudos
Message 1 of 7
(5,540 Views)
Yes, what you are wanting to do can be done, but there is no layout manager or grid function built into LV. To move things you use property nodes where you specify the location of things relative to the coordinates of their upper left corner.

There are some excellent examples that ship with LV showing how to move things. Also if you are wanting your "flow diagram" to utilize standard process control objects (like valves and pipes) these are available in libraries that you can buy.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 7
(5,540 Views)
Thanx for the reply Mike. I have noticed and did a little bit of coding with the property nodes and have managed to move things around. It's just that it will take a lot of effort to move things around relative to other controls each time. I figured labview was very much a GUI programming language and so a grid- or layout manager might be definitely useful. Oh well, wishful thinking...

I have taken a brief look at the flow diagram libraries and it does not look like what I am trying to do, or at least I don't think it does. Imagine a row of containers, each showing a process. Arrows link up the direction of data flow from one container to the next. I have the choice to choose where the arrows point to before and after each container. Currently it is
not easy to just draw an arow on the fly with labview so the alternative was to draw an arrow in the background and lay a control over it with the same color as the background. I can then make the arrow seem to appear and dissapear by showing/hiding the controls. This process is a pain. There must be a better way. I'm new to this labview language and any help will be much appreciated.

Thanx again.
-Quan
0 Kudos
Message 3 of 7
(5,540 Views)
Hi,

Why don't you use a picture control?

Just create a sub VI that draws an arrow from point a to point b, and use
this sub vi to draw all the arrows. You can put the controls over the
picutre control, or draw pictures (bitmaps) of the control in the picture.

Regards,

Wiebe.

"Quan" wrote in message
news:5065000000050000004CD70000-1042324653000@exchange.ni.com...
> Thanx for the reply Mike. I have noticed and did a little bit of
> coding with the property nodes and have managed to move things around.
> It's just that it will take a lot of effort to move things around
> relative to other controls each time. I figured labview was very much
> a GUI programming language and so a grid- or layout manager might be
> definitely useful
. Oh well, wishful thinking...
>
> I have taken a brief look at the flow diagram libraries and it does
> not look like what I am trying to do, or at least I don't think it
> does. Imagine a row of containers, each showing a process. Arrows
> link up the direction of data flow from one container to the next. I
> have the choice to choose where the arrows point to before and after
> each container. Currently it is not easy to just draw an arow on the
> fly with labview so the alternative was to draw an arrow in the
> background and lay a control over it with the same color as the
> background. I can then make the arrow seem to appear and dissapear by
> showing/hiding the controls. This process is a pain. There must be a
> better way. I'm new to this labview language and any help will be
> much appreciated.
>
> Thanx again.
> -Quan
0 Kudos
Message 4 of 7
(5,540 Views)
> showing/hiding the controls. This process is a pain. There must be a
> better way. I'm new to this labview language and any help will be
> much appreciated.
>

Since I'm not sure exactly what you want to draw, I'll just cover a few
techniques that make animation and graphics easier in LV.

As you noticed, LV isn't an HMI package that started life as a CAD
program and then learned to program. It is a programming environment
that has some UI components for instrumentation. But it can do quite a
bit of graphics. I know of quite a few games that have been built using LV.

One key graphic piece is the ring control. For things that you don't
need to move around, but want to select between N images, Draw up the N
images in your favorite CAD, draw, or paint package, copy them, and
paste them in the ring control. From the diagram you can write the
index to the ring to show the appropriate image. This might be what you
want for your arrows -- one blank and several with arrows going in
various directions. Hopefully once you build the ring, you can use it
in a number of locations. Other tricks for rings. If the images are
masked, like pngs, or built using a drawing package, like EMFs, then
they don't have to be rectangular and you can layer these on top of one
another and get more reuse out of them. The rings and other objects in
LV also accept animated GIFs and MNGs. If you have a cycle of images,
you can make a GIF of it and add it to the ring.

Other controls people sometimes import graphics into instead of a ring?
A button is good for two states. Use the control editor to get the
images in. This works much better for controls the user should click
on. Sliders can have a custom thumb and housing, so making something
slide horizontally or vertically is sometimes easier and more reusable
like this than using property nodes. You might be tempted to do the
same thing with knobs, but it probably won't work the way you expect.

Another good trick is transparency. Layering a few objects is often
easier than programming everything into one. Placing a transparent
button over a graphic or a set of animating graphics can let the user
click and makes a simple diagram. You can also have one state be
transparent and another colored to show/hide things on the panel without
as many property nodes.

Another tool you will want to learn to use is Group and Lock. When you
have a couple objects that should stay together, select and group them.
If you have something like a background graphic, select it and lock it
in place so that it doesn't get in your way while editing.

Finally, some things are more easily done using the picture control.
The picture control is a 2D drawing surface you write to using the
picuture control icons on the diagram. They include a number of vector
commands for lines, circles, and boxes, but also include pixmap
functions. Most of what I described above can also be accomplished with
the picture control once you get the hang of it, and it is then just up
to what tool you want to use.

If you have more specific questions, just ask.
Greg McKaskle
0 Kudos
Message 5 of 7
(5,540 Views)
A couple points to remember in addition to the good advce that others have given:1) LV is modular. Take advantage of the ability to create subroutines (subvis) to encapsulate tasks that are a pain. For example, using the picture control idea, create a subvi that draws an arrow. Give it inputs specifying the arrow's desired location and whether it should be visible or not. Now, althpugh there's a lot of stuff required to do the drawing, you only have to implement it one time. From now on doing your arrow is simply a matter of calling your arrow VI.2) Put graphics you want to be able to change in controls---not decorations or pasted in graphics. This removes the need to overlay things. When you do need to overlay thing a technique that sometimes
works better is to overlay with a plan boolean where one state is colored transparent. Now you don't have to play with properties, just turn the boolean indicator on and off.Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 7
(5,540 Views)
Hey thanx lavbiew gurus. These were definitely the type of comments/tips I was looking for. Will give it a try with these tips and see what happens. Looks like I will be able to accomplish the task at hand with labview indeed.

Thanx again,
-Quan
0 Kudos
Message 7 of 7
(5,540 Views)