Jump to content

Recommended Posts

Hello, I hope that you are doing well.

 

I am programming a new project in VisiLogic and was wondering if there was a way to change numeric variable properties on the fly. This is because I want the customer to be able to choose between SI and Imperial Units, and I need to change some number displays and numeric entries accordingly. I tried hiding some variables when a "unit" bit is set, but I cannot place one number on top of the other, nor are there binary numeric variables. Is there an easy way to do this that I am missing? Thank you very much in advance.

Link to comment
Share on other sites

Hi!

To implement a multiple unit numeric variable you can do the following:

1. define a numeric variable. add a numeric link and in the text box select "String from Library". You should define a library string ID variable.

2. Enter "String Library" from the project tree and double click on an empty space in the table. In the pop up window fill the text for the units you need.

3. Write the logic for the conversion between units. Use a button to select between units and perform the caluculations in every unit change. After you converted the value use the function "Set String Library" to select the unit that will be displayed.

 

I attached a small application I made for demonstration. It's a unit converter for pressure units - ATM to PSI. It's pretty straightforward and I believe you will find it easy to implement.

Pressure Convertor.vlp

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
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...