LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get the numeric format (HH:MM:SS) in an array? I have attached my code.

Solved!
Go to solution

I built an array and I would like the number being fed into the array to be in hour/ minute/ second (HH: MM: SS)?

I've tried it, but it did not work. Can anyone please help?

 

My code:

GRCK5000_0-1682089746933.png

The results on the front panel that I don't like:

GRCK5000_1-1682089776848.png

Can someone please help?

 

 

0 Kudos
Message 1 of 5
(1,595 Views)
Solution
Accepted by topic author GRCK5000

Hi GRCK,

 

you should have learned by now: when you need a specific display format in a FP element then you need to configure that specific display format in that FP element!

You also should have learned by now: even though you apply a specific format to BD constants it's still the DBL datatype with the same DBL values inside the shift register. Th eindicator on your FP doesn't care about properties of BD constants, it only receives the value…

 

Did you set the display format of the numeric element inside the array as needed?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(1,586 Views)

Thanks GerdW! Yes, I should've known this by now. smh 😑. But It works now; I updated the array on the front panel to the same format. 

But here is another question that arose. Let's say I have two 2D arrays and I just want to have the first column being in the format of HH:MM:SS, but the rest of the columns to be normal.

How do you do that?

Here is my code:

GRCK5000_0-1682092558029.png

Front panel:

GRCK5000_1-1682092632283.png

 

 

 

0 Kudos
Message 3 of 5
(1,561 Views)

Hi GRCK,

 


@GRCK5000 wrote:

But here is another question that arose. Let's say I have two 2D arrays and I just want to have the first column being in the format of HH:MM:SS, but the rest of the columns to be normal.


You should have learned by now: in an array ALL elements share the same properties!

 

So you cannot have different properties for numeric elements in the first row of the array compared to the other rows…

 

Suggestion: use a string array, here you can format the strings as needed!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 5
(1,553 Views)

@GerdW wrote:

Hi GRCK,

 


@GRCK5000 wrote:

But here is another question that arose. Let's say I have two 2D arrays and I just want to have the first column being in the format of HH:MM:SS, but the rest of the columns to be normal.


You should have learned by now: in an array ALL elements share the same properties!

 

So you cannot have different properties for numeric elements in the first row of the array compared to the other rows…

 

Suggestion: use a string array, here you can format the strings as needed!


You can also use an array of clusters. That can give you some more flexibility in your visual formatting.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 5 of 5
(1,411 Views)