LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get only seconds from the time block function?

Hello, I want to know to get only "seconds" from the time function. I tried to find other time function but I couldn't find anything that provides only second to be written in the text file.

 

data saving

0 Kudos
Message 1 of 17
(4,284 Views)

It may not be the best way but it works...

Rodéric L
Certified LabVIEW Architect
0 Kudos
Message 2 of 17
(4,283 Views)

CurrIn.png


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 17
(4,282 Views)

I also have an idea:

check.png

 

"I couldn't find anything that provides only second"

Reading the context help, when moving the mouse of the functions palette, is not so easy, isn't it? There are only 11 functions in the timing palette...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 17
(4,276 Views)

Thanks for all helps. Anyway how to get it started from 0 instead of the real time?

 

it should be 0, 1, 2,...

0 Kudos
Message 5 of 17
(4,268 Views)

Ah you want relative seconds!  Get date time in seconds.  Subtract "Start time" display format of the indicator "%<%S>t" (Advanced editing mode)


"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 17
(4,256 Views)

Sorry I don't really understand it completely. Where is "start time"? Could you please show it as a image?

0 Kudos
Message 7 of 17
(4,248 Views)

Hi Bombboo,

 

"start time" is the timestamp at the start of your program or DAQ loop.

When you subtract current time and "start time" you will get the elapsed time of the loop.

Wait, there's an ExpressVI called "Elapsed Time", maybe you could read it's context help???

 

Or search the forum for common things like your question right now?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 17
(4,229 Views)

Ok this is what I have got... but it still doesn't provide the right time I want. You can see in my attachment in text file. The time for each measurement is not correct as I set up the waiting time between each data saving. It's not constant. it should start at 0, 1, 2, 3, 4... if I set the waiting time to be 1000ms. In this case I set it to be 500ms but the result is wrong.

 

Sorry for asking something too simple and too much but I'm quite new to this software.  Thanks 🙂

 

save data1.jpg

0 Kudos
Message 9 of 17
(4,208 Views)

sorry I attached the wrong text file.

0 Kudos
Message 10 of 17
(4,201 Views)