LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get the string value displayed on a numeric control that is set for relative time.

Solved!
Go to solution

I have a numeric control set to display relative time in 30min increments. 

 

I want to record the value displayed on the control as a string.  Unfortunately, when I use the "convert number to decimal string.vi", the resulting string is just the value in seconds.

 

How can I get the displayed value as a string? (i.e. 1:30 for one hour and thirty minutes)

 

Thanks,

Sean

0 Kudos
Message 1 of 8
(4,098 Views)

If you right click your control and choose properties -> display format and the click the "Advanced editing mode" radio button you will get the format string for the control, something in the line of %<%H:%M>t. You can use this format string with the "Format Into String" function and the just wire the control as input, and you should get your string.

 

//Martin



CLA
www.dvel.se
Message 2 of 8
(4,090 Views)

I've done this:

 

Message Edited by jcarmody on 01-28-2009 12:01 PM
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 3 of 8
(4,080 Views)
I would use M_Peeker's method. jcarmody's method does work, however it is like trying to crack a walnut with a sledge-hammer.
It may be overkill, and you should not add code if you do not need to, it will just slow down the VI.
Cory K
0 Kudos
Message 4 of 8
(4,074 Views)

[...] it is like trying to crack a walnut with a sledge-hammer.

I resemble that remark!

 

I guess I didn't understand the original post.  I played around with M_Peeker's method but got confused, then a person walked by and I got distracted...

 

Jim

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 5 of 8
(4,053 Views)
Solution
Accepted by Sean.C

Hi Sean.C!

M_Peeker's suggestion is a good one.  One step that might clear things up is that you need to set the format string input to %<%H:%M>t. 




Kristen H.

0 Kudos
Message 6 of 8
(4,034 Views)

Kristen:

 

When I try this, I get an error that I have too many format specifiers?

 

Regards,

Greg

v7.1
0 Kudos
Message 7 of 8
(3,801 Views)

Hi gstanczak,

 

can you post what you tried?  Take a look at the Help on Format Into String Function- there's a link under the format string input to the Format Specifier Syntax page (link says "format string") Using this reference will help you get the string you are looking for.  

 

Kristen H.

0 Kudos
Message 8 of 8
(3,758 Views)