Jump to content

Numeric Units Control


Recommended Posts

          Hello.  Is there a way to automatically control a Numeric Control with the Units Label?  My experiments show it has a good manual affect when I change the units from nS to mS to S, hiding or showing the 3 lsd.  I need this to happen automatically when the user scrolls the number.  I need to limit a numeric control window to the 3 most significant digits no matter how large the number is by incrementing the unit label through nS, mS and S.  Is there a way to use the text property node for Unit Label for this?

          There seems to be conflicting information.  NI says it is possible here  https://www.ni.com/docs/en-US/bundle/labview/page/lvhowto/numeric_units.html

"You also can use the Text property to change units programmatically. The Unit Label property creates a reference that you can use with the Text properties."

But when I try it an error message appears telling me that changing this property isn't allowed while the VI is running.  What am I missing?  Thanks for any help you can give.

Link to comment

The reason your cant change the unit label at runtime is because unit labels change the data type of the wire (notice the "S" in brackets at the end).

image.png.86ab0a1087ec41ce24e9f4b3f267721e.png

That said, what you want can be achieved with the display format.

  1. Enable unit label and specify the unit "S"
  2. Change the display format to SI notation and the number of digits to 3

Now it will automatically add the prefix according to your value. For example, 10000 S will turn into 10 kS.

image.png.522d2b6bde13cc97acca246339b22c99.png

image.png.0740d59fc0be64f927832d69cc107e34.png

image.png.404da74e45ace2bd27a9c4fc44cbf250.png

 

Edited by LogMAN
  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.