Currently LabVIEW Timestamps truncate values rather than round them when using the %u format code. The numeric format codes all round values (0.499999 formatted with %.2g is 0.50). I would like an alternative to the %u code that does the same.
See https://forums.ni.com/t5/LabVIEW/Timestamp-Formatting-Truncates-Instead-of-Rounds/m-p/3782011 for additional discussion.
My use case here was generating event logs. I was logging the timestamp when parameters started/stopped failing. To save space, I stored a set of data identical to the compressed digital waveform data type.
I had a couple parameters which would alternate failing (one would fail, then the other would start failing as the first stopped failing). As they had different T0 values, the floating point math for applying an offset multiplied by a dT to each T0 gave values that would truncate to 46.872 and the other truncated to 46.873, leading to a strange ordering of events in the log file (both would appear to be failing/not failing for a brief time).
To make the timestamps match, I made the attached vi (saved in LabVIEW 2015) to do my own rounding (based off the feedback in the linked forum post).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Any idea that has received less than 2 kudos within 2 years after posting will be automatically declined.