LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

front panel animation advice

I would like to animate an algorithm on a VI's front panel. The algorithm is this: Imagine a juke-box-like device, with a linear magazine of, say, discs. There is a fixed-position target for insertion. The idea is this: to insert disc 3, I'd like the magazine to move (up or down) until disc 3 is adjacent to the insertion point, then see it slide horizontally out of the magazine into the insertion point.

 

I tried a cluster of string indicators, and slid the cluster up or down using a property node on its position, but sliding the indicator "out" of its cluster just made it disappear. I guess it's only visible when within the boundaries of its parent.

 

I fiddled with decorations a bit, without success. Any suggestions? Sorry if this question is vaguely worded.

 

-Jeff

0 Kudos
Message 1 of 9
(2,857 Views)

Hi,

 

If you post your vi we can help you better.

0 Kudos
Message 2 of 9
(2,852 Views)

Without looking at the actual code, here are some options:

 

  1. Make the cluster larger and move it behind the jukebox. That way, the string is still visible when moved, but it appears to be inside the jukebox. You can hide the cluster border and use a decoration inside the cluster to create a new border for the magazine. To paint a 3D border transparent you need to click on it with the paint tool, then click space to toggle FG and BG coloring. To move the cluster to the back, the reorder button at the center of the toolbar helps.
  2. When you need to move the string, place another string over it which was off-screen until now. Then, you can hide the cluster string and move the new string instead.
  3. Don't have a cluster at all. Instead, create a reference for each string and build them into an array. Use that array to control their positions.

___________________
Try to take over the world!
0 Kudos
Message 3 of 9
(2,836 Views)

Good advice. I've attached a VI to illustrate. The block diagram is empty, I'm using the front panel to better illustrate my question.

 

What I am envisioning is that the magazine would move up and down, aligning one of the strings with the slot. Then the selected string would move to the right, "into" the slot, looking like an insertion into the slot. I would want to depict an empty space in the magazine.

 

Then, move the slotted string back into the magazine, move the magazine to select another string, and so on.

 

The magazine only goes up and down, and the selected string right and left.

 

In my example, I don't claim that clusters or strings are required or are the right way to go; I'm still casting around for the right approach.

 

Thanks for any advice you can give.

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

Well, all the methods suggested in my previous reply are doable and using the cluster of strings is certainly valid. I think the first is easiest in terms of the amount of the code required. As you already saw, you can use the position property to control the location, so you can simply move the magazine cluster up or down until the specific control you want reaches the same line as the slot, then move the string sideways. You could probably implement it as a fairly simple state machine.


___________________
Try to take over the world!
0 Kudos
Message 5 of 9
(2,798 Views)

Hello, JWP!

 

Were you able to implement JWP's suggestions?

 

Please let us know if you have further questions.

 

-Will

Will Hilzinger | Switch Product Support Engineer | National Instruments
0 Kudos
Message 6 of 9
(2,769 Views)

Thanks for the replies. I'm still exploring the various techniques (I like #2 above), but I'm on my way now. Thanks again for the replies!

0 Kudos
Message 7 of 9
(2,763 Views)

*tst's suggestions - my mistake!

Will Hilzinger | Switch Product Support Engineer | National Instruments
0 Kudos
Message 8 of 9
(2,745 Views)

I took tst's advice, and built a state machine just as he suggested. It came out pretty well. When you run my shuffle vi, click to select a filter, then fetch to load it into the slot, stow to bring it back out.

 

It's a little elaborate, but I wanted to practice building an event-driven queued state machine. If you click on a bunch of filter-selects quickly, you can see the event loop loading things into the queue, and the "stop" button clears out the queue. It's sort of a test-bed for my project goals.

 

Thanks very much for the advice! And, of course, comments are always welcome.

 

-Jeff

Message 9 of 9
(2,706 Views)