10-30-2017 10:07 AM
Hi,
How to convert the U64 number to to the format of minutes:seconds:milliseconds.microseconds ?
Thanks for help:)
Solved! Go to Solution.
10-30-2017 10:47 AM
This should be specified in the documentation of the function or library or dll you will use to get this U64 value.
Which is?
10-30-2017 10:49 AM
10-30-2017 11:42 AM
Thanks pincpanter and GerdW,
If I use the actual user interface software of the product it shows time in m:s:ms.us format but if I use LabVIEW drivers I get U64 format for the timestamp which I further need to convert to m:s:ms.us
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.
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 |
This function returns the number of bytes read or a negative value indicating an error.
None. |
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 6.4.1.12 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 🙂
10-30-2017 01:06 PM - edited 10-30-2017 01:08 PM
So, what is the frequency of the sample clock?
10-30-2017 01:22 PM - edited 10-30-2017 01:41 PM
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).
10-30-2017 04:04 PM
The Beagle USB 12 analyzer is locked to a 48 MHz sample rate, thus each count measures 20.83 ns.
11-01-2017 02:53 AM - edited 11-01-2017 02:55 AM
I am using 50MHz frequency for Beagle SPI it can be configured, thus one count tick is 20ns.
Thanks all.