08-04-2022 01:51 AM
Hi everyone, this is my first topic here and I am a beginner in Labview. Please be soft to me 😄
I am working on an interface and I need to display numbers like if I was on a 4.5 LCD display.
Meaning I have 5 digits, but the first one can only be 1 or empty.
Example:
200 will be displayed as 200.0
15 will be displayed as 15.000
Any idea how I could do it?
The best option for me would be to use a INI file with the precision after coma as an input, but I did not find anything like that.
Thank you for your kind support
08-04-2022 03:31 AM
Hi jojo,
@jojozekil wrote:
Hi everyone, this is my first topic here and I am a beginner in Labview. Please be soft to me 😄
Welcome to this forum!
@jojozekil wrote:
I am working on an interface and I need to display numbers like if I was on a 4.5 LCD display.
Meaning I have 5 digits, but the first one can only be 1 or empty.
Example:
200 will be displayed as 200.0
15 will be displayed as 15.000
Any idea how I could do it?
Some questions:
Can you provide examples which don't conflict with your requirement description?
08-04-2022 04:03 AM
Hi GerdW and thank you for your reply.
Sorry, I am figuring out that my message was not clear.
I try to emulate the same behavior as a 4.5 digits 7 segment LCD screen. My screen is like that:
Y.X.X.X.X.
I can choose to light on the dot anywhere I want.
Y can only take the value of 1 or be turned off (2 segment piece)
X can take any value between 0 and 9
If I have a value of 1.5 to display I can display 1.5000, ie I can use all my spots to display my number.
If I have a value of 20 to display I can display 20.00, ie I cannot use the left spot, only the 4 next spot to display my number.
My application is basically a voltmeter. I have to set the maximum voltage of the application, but it can change depending who will use it. So I need to change the maximum value and representation in my VI before I compile it. I would prefer to use one INI file with the parameters.
Basically, I would like Labview to display on 5 digits in total if the first number is 1 and only on 4 digits if the first number is different of 1.
I could set it manually in my INI file to avoid him to make long complicated operations. For example:
[CONFIG]
Voltage = 5.02
VoltageAccuracy = 3
And it will display up to 5.020
What do you think about it?
08-04-2022 05:02 AM
Hi jojo,
@jojozekil wrote:
I could set it manually in my INI file to avoid him to make long complicated operations. For example:
[CONFIG]
Voltage = 5.02
VoltageAccuracy = 3
And it will display up to 5.020
I don't know what that INI keys should do without knowing your whole project…
@jojozekil wrote:
I try to emulate the same behavior as a 4.5 digits 7 segment LCD screen. My screen is like that:
Y.X.X.X.X.
I can choose to light on the dot anywhere I want.
Y can only take the value of 1 or be turned off (2 segment piece)
X can take any value between 0 and 9
If I have a value of 1.5 to display I can display 1.5000, ie I can use all my spots to display my number.
If I have a value of 20 to display I can display 20.00, ie I cannot use the left spot, only the 4 next spot to display my number.
So you have a float value input and you need a string consisting of 4 or 5 digits and (maybe) a dot.
One solution would be:
Put all this into a subVI to encapsulate the algorithm…
08-04-2022 05:18 AM
Thank you @GerdW
It can be very complicated to make such simple things in Labview if they did not implemented the function...
08-04-2022 06:19 AM
Hi jojo,
@jojozekil wrote:
It can be very complicated to make such simple things in Labview if they did not implemented the function...
That's not "complicated, it's called "programming"!
Why should NI implement such a specific functionality? Who needs 4.5 digit displays on a modern GUI?
08-04-2022 07:10 AM
You are right, but I was not talking of this very specific need.
I was talking about setting the precision of a numeric as an external parameter.
A=1.1
B=2
if I want to display A with 2 digits after coma (1.10), I need to set it on the GUI before compilation or use a complex mechanism. I cannot just ask to Labview to display A with B digits, where A and B are parameters in an external INI file.
But hey, I am just beginning on Labview, so it is more easy to focus on what is not like I am used to use as I do not feel comfortable yet 😄
Looks like it is very powerful. I am eager to discover what incredible projects I could achieve with!
Anyway, thank you for your kind support @GerdW, greatly appreciated!
08-04-2022 07:37 AM - edited 08-04-2022 07:39 AM
Hi jojo,
@jojozekil wrote:
if I want to display A with 2 digits after coma (1.10), I need to set it on the GUI before compilation or use a complex mechanism. I cannot just ask to Labview to display A with B digits, where A and B are parameters in an external INI file.
You can change the display format of a numeric indicator also at runtime of your VI!
Just use some property node:
You can also use an "external" INI file, when you implement the ConfigFile functions to read the keys from such a file…
08-04-2022 07:51 AM
Thank you very much! This exactly what I was looking for!