LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Micro-Nuggets !!! ~~~~ Post 'em if you got 'em

Thank you Richard,

Sorry for my ignorance. I have read this thread and in an excitement(I hope every first time user of LV feel the same) , typed my first reply here. I will consider looking in depth next on.

0 Kudos
Message 291 of 368
(2,334 Views)

@DhruvAcharya wrote:

Thank you Richard,

Sorry for my ignorance. I have read this thread and in an excitement(I hope every first time user of LV feel the same) , typed my first reply here. I will consider looking in depth next on.


And even with the ancient LabVIEW versions that support VISA (very old VISA like whatever shipped with 6.i) You could use "Tools>>Options :Environment- check the box for "Automatically Close VISA Sessions" and VISA sessions will close when the top level VI goes idle.

 

Welcome to the forums!


"Should be" isn't "Is" -Jay
0 Kudos
Message 292 of 368
(2,294 Views)

I don't know about anyone else, but I was recently looking for a way to centre a VI in a subpanel and couldn't find anything. In my particular case I had a little spinning 'loading' indicator VI and wanted to have it centered in the subpanel it was loaded into.

 

This is the way I did it:

 

1) Centered my VI's front panel around the origin:

2015-01-09_13-58-52.png

 

2) Create an event handler for the Pane Size event with the following:

Centre VI Around Origin.png

 

When my VI is inserted into the subpanel or the subpanel/pane resizes (e.g. change window size) - the origin remains in the centre of the pane.

 

I found this very useful for when you have a resizeable user interface!


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 293 of 368
(2,180 Views)

@Sam_Sharp wrote:

I don't know about anyone else, but I was recently looking for a way to centre a VI in a subpanel and couldn't find anything. In my particular case I had a little spinning 'loading' indicator VI and wanted to have it centered in the subpanel it was loaded into.

 

This is the way I did it:

 

1) Centered my VI's front panel around the origin:

2015-01-09_13-58-52.png

 

2) Create an event handler for the Pane Size event with the following:

Centre VI Around Origin.png

 

When my VI is inserted into the subpanel or the subpanel/pane resizes (e.g. change window size) - the origin remains in the centre of the pane.

 

I found this very useful for when you have a resizeable user interface!


Curious why you couldn't do "left minus right" and "top minus bottom" instead so you could avoid negating the answer?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 294 of 368
(2,173 Views)

Yes, good point - I suppose I had better post this is in the rube goldberg code thread as well Smiley Very Happy


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 295 of 368
(2,169 Views)

Ehhh... I've done worse.  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 296 of 368
(2,163 Views)

You might also want to try Quotient & Remainder instead of the Divide in order to avoid some of the data coercion.  Or, since it is a divide by 2, use a a Logical Shift (would be less processor intensive if you are really going for any and all performance gains).



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 297 of 368
(2,144 Views)

@Sam_Sharp wrote:

Yes, good point - I suppose I had better post this is in the rube goldberg code thread as well Smiley Very Happy


I can't think that unnecessarilly flipping two sign bits would quite qualify.  Mr. Goldberg would be very disinterested in the wasted energySmiley Very Happy


"Should be" isn't "Is" -Jay
0 Kudos
Message 298 of 368
(2,128 Views)

@JÞB wrote:

I can't think that unnecessarilly flipping two sign bits would quite qualify.  Mr. Goldberg would be very disinterested in the wasted energySmiley Very Happy


From a performance standpoint i agree, from a fanatic standpoint it's an extra block that's not needed (like when people wire a '0' constant to an Index array). The RGC is less than minor, thus a micro Rube, far from a slap on the wrist.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 299 of 368
(2,113 Views)

Using the negate is better than simply dividing by minus two....

0 Kudos
Message 300 of 368
(2,089 Views)