NI Home > Community > NI Discussion Forums

LabVIEW

Showing results for 
Search instead for 
Do you mean 
Reply
Active Participant X.
Active Participant
X.
Posts: 1,885
0 Kudos

Why can't I send a picture to the back of my diagram?

Here's the picture

 

ScreenHunter_001.jpg

 

Here's what happens when I try to "Send to Back" said picture in order to use it as a way to hide a mess of irrelevant wires (think of large while loop with dozens of pass through wires):

 

Before I slide it underneath the objects: ScreenHunter_002.jpg

 

 

After I slide it "under" those objects: ScreenHunter_003.jpg

 

 

The wires are hidden!

Are you telling me that if I want to hide a spaghetti network, my only recourse is the Sequence Structure?

Like this:

 

ScreenHunter_004.jpg

 

Note: the picture is a piece of diagram background, so it is the same color of the background, which explains that you don't see much (which is the whole idea...).

 

 

Knight of NI
Knight of NI
tst
Posts: 10,882

Re: Why can't I send a picture to the back of my diagram?

[ Edited ]

X. wrote:
...think of large while loop with dozens of pass through wires

OK, I did and now I have a headache.

 

 

Oh, how I wish LV would break hidden code right now...

 

 

 

If you have multiple tunnels, I would suggest considering bundling them into a single cluster or class. Done - your wires are no longer visible.

 

 

 

And yes, it did also bother me that only the wires go behind the image, but every time I ran into this in the past it wasn't an issue, because I never tried to do anything like this.


___________________
Try to take over the world!
Active Participant
Alex.T
Posts: 324
0 Kudos

Re: Why can't I send a picture to the back of my diagram?

I noticed this a while back and thought it'd make a good LabVIEW Idea; being able to place objects underneath wires. Block Diagrams could look really fancy that way...

 

However, unless I'm missing something, I think it's something fundamental in the way wires are drawn within LabVIEW. When you place wires on a Block Diagram, I'd imagine that internally they're drawn before any other component, irrespective of the order in which they're placed. I think the reason it's done this way is because it's the most straight forward way of ensuring that wires would never show up on top of any diagram elements; i.e. never seeing the starting position of a wire on top of the VI that it's wired to.

 

It's cool that you noticed that you don't see this behaviour within Sequence Structures, that's something I never noticed and I did play around with this for some time. I just assumed that the method of drawing wires would be ubiquitous between both the Block Diagram and Structures...

 

It seems to me like there's a different operation of implementing drawing order within Sequence Structures (or maybe even all Structures?) than that which the Block Diagram uses.

 

Hopefully in a future version of LabVIEW they'll make it so that the Block Diagram inherits the same drawing mechanism that your Sequence Structure has. It's way cooler that way!


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

Active Participant X.
Active Participant
X.
Posts: 1,885
0 Kudos

Re: Why can't I send a picture to the back of my diagram?

[ Edited ]

Just to clarify: I had to enclose the objects (and wires) in a Sequence Structure.

You cannot drop a Structure and slide it underneath something, like a rug.

 

I think that from a logical point of view my question is perfectly legit. The graphical nonsense that results from the current behavior (hidden wires) should either be prevented or I'll add it to my collection of code obfuscation tools (did you ever try to paint a Loop with the background color? That's a lot of fun!).

 

Active Participant
Alex.T
Posts: 324

Re: Why can't I send a picture to the back of my diagram?

[ Edited ]

Haha! I haven't but I'll give it a shot now...

 

You're right; wires being covered up like you've shown could end up being really misleading to anyone uninitiated to the VI. It creates dysfunctional looking code anyway... It would be good if decorations and images had a special kind of privelege so that they're the only kinds of elements that have the potential to be drawn underneath wires when the Block Diagram is redrawn.


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

Active Participant X.
Active Participant
X.
Posts: 1,885

Re: Why can't I send a picture to the back of my diagram?

Code obfuscation 101 or how to use the two "features" described above to simplify your diagram...

 

ScreenHunter_002.jpg

 

Perfectly functional diagram, with all wires hidden and no while loop boundaries...

Active Participant X.
Active Participant
X.
Posts: 1,885
0 Kudos

Re: Why can't I send a picture to the back of my diagram?


tst wrote:

If you have multiple tunnels, I would suggest considering bundling them into a single cluster or class. Done - your wires are no longer visible.


 

That is not always a practical option (as in the masked diagram above). For instance, the wire carry massive amount of data, therefore the overhead in bundling/unbundling is a heavy price to pay.

When you have a multi-case structure in the loop (as in the diagram above), you then have to unbundle/bundle in each case you are using even a single wire. That requires naming conventions that distinguish between same type wires (and thus that requires Named bundles. Each time you modify the type of ONE wire, you have to modify the bundle type, etc...

 

I have suggested a no-cost solution in the past, but it did not go very far at two kudos... It links to several other suggestions and has an interesting (and rare) feedback from NI (which again does not mean much, but for what it's worth...).

Active Participant X.
Active Participant
X.
Posts: 1,885
0 Kudos

Re: Why can't I send a picture to the back of my diagram?

[ Edited ]

I think I have found a solution (this is going to get a lot of people to cry for foul, but so be it)...

 

Say you have given up on NI ever providing a way to hide those useless pass-through wires:

 

ScreenHunter_002.jpg

 

You can't drop a background image that would cover the unused wires AND NOT hide the one you want to see (read the discussion above).

However, you can draw a Sequence Structure around the content of the case shown above and expand all but one of its edges beyond the boundaries of the case structure, like so:

 

ScreenHunter_003.jpg

 

Tada! Now the unused wires are hidden, but those you care about are not.

Just make sure you leave one of the edges of the Sequence Structure visible, as you will need it if you ever want to remove it. I left the bottom one in the example above. Or if you don't care about this, just go ahead and hide the last edge. But be prepared for a lot of pain if you ever change your mind about that Sequence Structure. I don't know of any simple way (besides expanding the case structure) to get hold of it in order to remove it, if all its edges are hidden.

Of course this requires that you have autogrow disabled for the case structure.

It would work just as well for any other structure, obivously.

Active Participant X.
Active Participant
X.
Posts: 1,885
0 Kudos

Re: Why can't I send a picture to the back of my diagram?

Now that I think of it, a nice touch would be to have two frames in this sequence, one that shows what I am interested in (the "Active" frame), and the other that shows the unused wires (the "Passive" frame).

Right now, there is no simple way to do that once the wires are laid down, so this would require a new tool, which, following the step I just described in the previous post would allow doing the following:

 

1) Add a "Passive" frame to the sequence structure that would encompass all the remaining objects (if you've done your job properly, this should only be pass-through wires).

2) If you ever want to promote a "passive" wire to an "active" one, that is one you want to connect to something within the case, you would be able to select it and "send it" to the "active" frame.

3) of course you want to be able to do the opposite, i.e. send a pass-through wire back to the "Passive" frame - we could limit this to pass-through wires for consistency.

4) New pass-through wires would automatically be created in the "Passive" frame.

 

At this time, what I am describing above is feasible but takes a lot of time:

 

1) requires creating the frame and disconnecting/reconnecting all wires through that frame.

2) requires disconnecting the wire and reconnecting it through the other frame

3) same as 2)

4) new wires will be created out of the sequence structure altogether (and rerouted around it)

 

Is that worth a two Kudo sugestion? Anyway, it is here for anybody to use if you find this helpful.

Knight of NI
RavensFan
Posts: 15,928

Re: Why can't I send a picture to the back of my diagram?

I think the best solution to your problem would be the implementation of this idea.

 

A better way to define the output of unwired output tunnels