LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is you most reused VI you came up with?


@JÞB  ha scritto:

@Basjong53 wrote:

.

The standard notation is 3.14 kHz (with a space between the number and prefix), which isn't natively supported. So for frontpanel indicators needing a unit I almost always use this vi that formats it correctly.

 


Nope, Mathematically it is 3.14*1000*Cycles/Second or "3.14kHz" where "*" is implied the space breaks the math.


@JÞB 

I know you like to be pendantic and always right, but you're wrong here. The official International Bureau of Weights and Measures states that you add a space between the value and unit: https://www.bipm.org/en/publications/si-brochure

 

@crossrulz

Yeah, maps probably will improve performance, but I've made this vi before maps were added. I guess this is a good time to update it 😉

Message 31 of 34
(554 Views)

@paul_cardinale wrote:

"%.2{Hz}p" works, but has the drawback of only working for frequency.


With what are you getting that to work?  I just get errors with everything I've tried so far (Format String, Scan From String, control's display format).

 

EDIT:  Ahh, your example showed me the part I was missing.  Units have to be attached to the numeric data.


GCentral
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 32 of 34
(553 Views)

@Basjong53 wrote:

It's a pet peeve of mine, but I always disliked how to add units to numbers on frontpanel indicators. It's either 3.14kHz (%.2pHz) or 3.14k Hz (%.2p Hz).

The standard notation is 3.14 kHz (with a space between the number and prefix), which isn't natively supported. So for frontpanel indicators needing a unit I almost always use this vi that formats it correctly.

Convert to string with SI unit.png


I like this one a lot. I worked on a project a few years ago in which one of the non programmer product leads demanded that all number indicators on the UI MUST be numeric types and not strings (which was extra work because we were getting nicely formatted strings with units from the hardware). So we made the UI and all the indicators were numeric and had SI units but he took a look and said; "No, that's not how it is supposed to look, there needs to be a space between the number and the unit!" So we said this would sure be a lot easier if we could use strings for the indicators but he was not going to budge on the data type so we ended up having the caption for the indicator be to the right of the indicator and it displayed the units in the caption and he liked that. 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 33 of 34
(541 Views)

@Basjong53 wrote:

@JÞB  ha scritto:

@Basjong53 wrote:

.

The standard notation is 3.14 kHz (with a space between the number and prefix), which isn't natively supported. So for frontpanel indicators needing a unit I almost always use this vi that formats it correctly.

 


Nope, Mathematically it is 3.14*1000*Cycles/Second or "3.14kHz" where "*" is implied the space breaks the math.


@JÞB 

I know you like to be pendantic and always right, but you're wrong here. The official International Bureau of Weights and Measures states that you add a space between the value and unit: https://www.bipm.org/en/publications/si-brochure

 


Well,  1 Kudos for that! I'll be right next time 


"Should be" isn't "Is" -Jay
0 Kudos
Message 34 of 34
(512 Views)