Showing results for 
Search instead for 
Did you mean: 

U64 to minutes:seconds:milliseconds.microseconds

Go to solution



How to convert the U64 number to to the format of minutes:seconds:milliseconds.microseconds ?


Thanks for help:)

0 Kudos
Message 1 of 8

This should be specified in the documentation of the function or library or dll you will use to get this U64 value.

Which is?

LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 8

Hi Amit,


could you please explain the formatting of your U64 value? What data does it contain?


Once you did this we can easily solve the problem with you...

Best regards,

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 8

Thanks pincpanter and GerdW,

If I use the actual user interface software of the product it shows time in format but if I use LabVIEW drivers I get U64 format for the timestamp which I further need to convert to


The key question for me here, are these ticks to be consider in ms or us ? I am not expert of C or C++.


Please see the red marking below.


Read SPI (bg_spi_read)

      int bg_spi_read (Beagle   beagle, 
                       u32 *    status, 
                       u64 *    time_sop, 
                       u64 *    time_duration, 
                       u32 *    time_dataoffset, 
                       int      mosi_max_bytes, 
                       u08 *    data_mosi, 
                       int      miso_max_bytes, 
                       u08 *    data_miso);

Read data from the SPI port.

beagle handle of a Beagle analyzer
status filled with the status bitmask as detailed in Table 11
time_sop filled with the timestamp when the data read begins
time_duration filled with the number of ticks that it took to read the data
time_dataoffset filled with the timestamp when data appeared on the bus
mosi_max_bytes maximum number of MOSI bytes to fill
data_mosi an allocated array of u08 which is filled with the data sent from the master to the slave
miso_max_bytes maximum number of MISO bytes to fill
data_miso an allocated array of u08 which is filled with the data sent from the slave to the master
Return Value

This function returns the number of bytes read or a negative value indicating an error.

Specific Error Codes

The function will block until the requested amount of data is captured, a complete packet with slave select deassertion is observed, or the bus is idle for longer than the timeout interval set. See Section for information on the bg_latency() and bg_timeout() functions which affect the behavior of this function.

The data_mosi array should be allocated at least as large as mosi_max_bytes. The data_miso array should be allocated at least as large as miso_max_bytes.

All of the timing data is measured in ticks of the sample clock.


Thanks for help 🙂

0 Kudos
Message 4 of 8

So, what is the frequency of the sample clock?

0 Kudos
Message 5 of 8
Accepted by topic author amitwadje

Once you scale with the sample clock to fractional seconds as DBL, use a FOR loop with a shift register containing a "quotient &remainder", autoindexing on an array of divisors, one for each field to generate an array of parts. After the loop, use "array to spreadsheet string" and ":" as delimiter to format as the desired output.


You can likely do it all with blue datatypes, recommended).

Message 6 of 8

The Beagle USB 12 analyzer is locked to a 48 MHz sample rate, thus each count measures 20.83 ns.

Message 7 of 8

I am using 50MHz frequency for Beagle SPI it can be configured, thus one count tick is 20ns.

Thanks all.

0 Kudos
Message 8 of 8