LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Local variable that keeps data format

Solved!
Go to solution

Hi,

 

I have a value in seconds that I display in relative time format, I want to read this exact value and input it into a string, what I receive in the string however is the original number in seconds.

 

Is there a way around this or of formatting the output of the variable.

 

Michael

0 Kudos
Message 1 of 4
(3,322 Views)
Solution
Accepted by topic author nashm999

Hi Michael,

 

when you read the value of your control/indicator you get the value! (THINK DATAFLOW!)

 

I want to read this exact value and input it into a string

No, you don't want to read the "exact value"! You want to read the displayed text formatted by your indicator settings!

 

To get the currently displayed text you can use a property node of your indicator and read the "Text.Text" property…

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(3,317 Views)

The formatting of the number is handled by the numeric indicator you use to display it. The number (representing seconds) contains no formatting information itself - it is just a number.

 

To format this into a string use the format date time string or format into string functions.

 

Alternatively, to capture the actual string that is displayed in your numeric indicator, create a property node and select the Numeric Text->Text property.

 

EDIT: Damn - I hate these Forum race conditions! Smiley Very Happy @ GerdW

0 Kudos
Message 3 of 4
(3,311 Views)

And this is why this forum is so great, the perfect answer in less than half an hour. 

 

Thanks guys!

0 Kudos
Message 4 of 4
(3,290 Views)