LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subPanel: The coordinate system seems all scr... up? AND How to see whether a reference is set to anything?

G'day!

In a larger program I want to use a subPanel to change between different .vi's depending on certain criteria etc.

This functionality I have realised in the attached .vi's. However one thing irritates me and that is that I cannot figure out how the coordinate system in the subPanel is related to the .vi's? My guess is that where the two more bold/thick grid lines meet in a dot is the orego? This is the most logical interpretation. However when the .vi is shown it seems like there is a fixed random correlation different from this. It is too frustrating if I have to move the controls around (check and go back, repeat...) in my very di
fferent .vi's to make sure they are placed correctly in the subPanel. How do I correlate the two -- what I concieve as -- oregos?

Another question:
Before loading a new .vi in the subPanel I close the old one - if one is loaded. To avoid closing something that do not exist I have a boolean (activePanel) which I set the first time I have a .vi in the panel. However it should be possible to exclude the boolean and check whether the reference is referencing anything - but how?

Thanks in advance - and have a jolly weekend!
Martin
Download All
0 Kudos
Message 1 of 7
(3,176 Views)
For your second question, you can use "Nat a Number/Path/Reference ?" from comparison subpallete to see if the ref is valid or not.

Joe
0 Kudos
Message 2 of 7
(3,176 Views)
The top-left corner of the subPanel uses the same coords as the top-left corner of your saved sub VI. Also the "subPanel document size" will be the same size as your running VI. I.E. the sub VI's should have the same placement / appearance as "regular" VIs, or exsiting in a subPanel.

If you want to make sure they match up, then save your sub VIs with the origin at the top-left (0,0).

One way to do this is to place a property node on your block diagram, right click the header to change the property class to "VI" and then select "origin" property, right click to change to write. Right click again to create a cluster (0,0).

When you run your VI, the top-left will align perfectly with the two thick lines. Save your VI so that the VI will open a
t this coord (even in the subPanel).

-David
Message 3 of 7
(3,176 Views)
Thanks!

- Martin
0 Kudos
Message 4 of 7
(3,176 Views)
Coming to think of it I actually found out on the way home in the train about the graphical correlation - however I experienced it when building an executeable and running it on a desktop with a different resolution.

The origin property tip is super! I'll include that when I get to work again -- however for now I have to spend the next week in cont. phys. at uni.... so I'll have to wait till friday before earning some coins again 🙂

Again, nice weekend to you all!
Martin
0 Kudos
Message 5 of 7
(3,176 Views)
Hi David!

I cannot make your tip work 100% When I do it I get the following
error:

>>Error 1148 occurred at Property Node (arg 1) in test0.vi

Possible reason(s):

LabVIEW: This property is read only while the VI is in a subpanel.<<

However it does locate the sub vi correctly even though it claims that
I am not allowed to write to the "origin variable". What do I do to
avoid the error - just ignore it?

- Martin
0 Kudos
Message 6 of 7
(3,176 Views)
Hi Martin,

Oops, I didn't expect for the property node to give an error when used
in a sub-panel, but it makes sense.

I only meant for the property node to be used when you are doing your
editing. This allows you to run the VI, and the property node will
line things up for you exactly. Then you save the VI, so that the VI
is saved at that origin.

When used as a sub-panel, it is the saved coords that cause the
alignment to be as you want. The Property Node does not do anything.

You could remove the property node after you run/save the VI. But I
would keep it in just in case you accidently move the origin when
editing the VI in the future.

Instead, what I would do is wire the error out of the property node to
"clear errors" VI found in th
e time & dialog palette so that you won't
get your error.
0 Kudos
Message 7 of 7
(3,176 Views)