Time Stamp Precision

I am trying to output a daq to a file but the time stamp is only outputting in seconds.  I need more digits of precision.  I tried the Format Date/Time string and modified the time format string but this did not help.  What am I doing wrong.  I am attaching what I have.  The problem is in the bottom true/false case structure.
Message Edited by HereWeGo on 08-13-2008 11:11 AM
Message Edited by HereWeGo on 08-13-2008 11:13 AM
Attachments:
timestamp to string.vi ‏82 KB

Remove the "<" and ">" characters from your format string.

Similar Messages

  • Formatting a string with time stamp and double precision numbers

    %s\t%f\r%f
    This is a format string that I have in old code that I've decided to change.  Problem is I cannot make sense of the string codes in my own old code! Let me explain what I want, and hopefully someone can explain how to do it.
    I am using the format into string subvi to merge a time stamp (formatted as %m%d%Y%H%M%S%5u) and two different double precision numbers.  This string is then wired into the Write Characters to File subvi so that I can record data as a .txt file, and open it in either Matlab or Excel.  There is a minor problem with the string format above because in excel the first time stamp entry is blank, and the first loop only gives the two double precision numbers withouth the time stamp - the time stamp appears in the next loop (probably a looping issue and not due to the string format, but if you see differently please let me know).  Now what I want to do is 1. potentially fix that problem and 2. add some more doubles. 
    1. Is there a string format issue that is evident that I am not seeing that causes the time stamp to be formatted into the string after a carriage return?  Or should I be looking at looping issues?
    2. How do I add another one - three floating point numbers (double precision)?  Are the \'s marking different numbers in this string constant?  Or is it the %?  I can't find any information about the \'s, but I see that % begins the format specifier. 
    Ideally, I want these data in the following columns:  Date, Time(absolute), FP, FP, FP, carriage return for the next loop (FP is floating point double precision number).
    Thanks,
    Brad

    Hi JonN,
    Here there is no need of string concordinate function (in your code), the same result you can find if you connect the output of the format string to shift register, and shift register in data to initialize string connector in format into string function.
    <<KUDOS ARE WELCOME>>
    ELECTRO SAM
    For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life.
    - John 3:16

  • Precise time stamping of serial data

    I am having trouble with precise timestamping  of incoming serial data recived on 4 ports using 4 separate threads that continually attempt to read a byte.
    When the expected frame is recieved the data is tagged with a time stamp.
    The issue seems to be windows xp or the serial ports themselves.  I am using an xsens serial to usb, 2 lavaport serial cards and the built in serial port.
    Any suggestions for precise timing?

    there is some hints:
       -for milisecond precise timestamp, you can use GetLocalTime,GetSystemTime or GetTickCount.
        But to achieve true milisecond scale, you need use timeBeginPeriod(1)/timeEndPeriod(1) otherwise you get 10-16ms scale depend on system
        (please read help pages on msdn for timeBeginPeriod function)
       - create your program to not use CPU too much(no pooling,just message and/or sync wait),
         or even better, do not run any other apllication which consume lot of CPU/DISK resources on the same PC
       - for serial communication (but this also depend on baud rate) you can try to set send/receive driver buffer to 1 (from windows device manager)
       - try different serial port card/converter(with different drivers)
       - if still need something to try, set higher process and thread priority (SetPriorityClass,SetThreadPriority)
    After all of this, on windows, there are no precise timing.Even if you do everything you can do, there is still chance to get time gap, but you can detect it (in milisecond precision)

  • GPS Access to high precision time and time stamping WASAPI microphone captures

    I am interested in using multiple WPs to capture microphone WAV that is time stamped with high accuracy (sub millisecond), hopefully from the GPS system. The GPS hardware obviously has the capability to sub microsecond levels but I can't find an API for
    it.

    What I would like to do is get geo positional data, which has a defined statistical uncertainty but might be relatively better correlated and as accurate a time stamp as possible.  Latency isn't an issue but consistency is. GPS, of course, easily produces
    time information to sub microsecond though I don't know a way to access it in WP.  .1ms consistency would be all I really need but it's important that each phone in a cluster be able to capture and time stamp a sound (assume all phones are equidistant
    from a source) to within .1ms. I am thinking of a product that could be used, for one obvious example at weddings, to capture the proceedings and allow after the fact enjoyment by replaying the proceedings and shifting the focus on the bride/groom minister
    as they talk using beam forming dsp tech from the data. There are other ways but it occurs to me that the ubiquity of smart phones would really make this easy. Just have the guests download an app. It would be part of a wedding doc package along with videography
    and stills.

  • Time Stamps in Producer/Consumer Setup

    I am trying to acquire signal from a Gas Analyzer, Flow Meter, and 3 RTDs.  My hardware is a NI 9215 and NI 9217.  I need to write the data to a file with a time stamp at which the sample was read.  The program is written in a producer/consumer setup in which the data is being acquired in the prodcuer loop and sent to the consumer loop to be written.  I can get the samples written to the file okay. However, I have not figured out how to put the time stamp in the data file correctly. I thought the time stamp was created with the corressponding measurement at the Data Acquisition VI. However, whenever I open the data file, there are only 0s in the time column.  So, I've tried to use Format/Date String to add the time stamp. I can get it to work if I place it in the consumer loop. However, the time stamp is not accurate.  It puts the same time stamp up to six digits of precision for two consecutive samples. I've tried to figure out how to add it to the producer  loop, but I don't know how to add it and the measurements to the queue at the same time. Please tell me the best way to acquire signals with the exact time stamp and write them to a file using a producer/consumer design.
     Example:
    Date             Time               RTD1     RTD2      RTD3     CO2      Flow
    5/26/07      5:20:01.25       57         56         56.5      100       0.5
    5/26/07      5:20:01.30       57         56         56.5      100       0.5
    5/26/07      5:20:01.35       57         56         56.5      100       0.5
    Attachments:
    Producer-Consumer From Scratch2.vi ‏75 KB

    Okay, I've put it in a For Loop and it will connect now. However, whenever it runs the time stamp increments for a couple seconds and then it just repeats. How do I correct this?
    Attachments:
    Producer-Consumer From Scratch2.vi ‏88 KB
    pleasework.txt ‏20 KB

  • How to plot contour using time stamp

    Hello,
    I need help on the following:
    I acquire size distribution data each minute from a particle counter. I would like to plot the data as a contour plot using time stamp on the x-axis, the size bins on the y-axis and the 2D data on the z-axis. I cannot get the contour functionality in LV 2011 to accept the time stamp format. I did change the format of the x-axis to "absolute time" but it still doesn't work, see simplified diagram below.
    Any advice on reformatting a time stamp to something the contour plot understands??!?
    Thanks a lot,
    Claus
    Attachments:
    countour.png ‏20 KB

    Milan R wrote:
    Hi Mogensen!
    You could use the "To Double Precision Float" vi to convert the timestamp to a double prescion number as mentioned in this forum post "time stamp to number function". As mentioned in that forum, the number is based on the LabVIEW epoch date so you can use it to compare values taken at a specific time.
    I can't look right now but will that work?
    I thought the 3D stuff was single and the magnitude of the time stamp would swamp the difference in time stamps.
    Just thinking out loud.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to write time stamp to a file

    Hi,
    I'm using LabVIEW 8.2 and for my simulations purpose I've to store my data with time stamp (seconds having 6 digit precision ) in a text file.
    I'm using get time vi to get the time of the host computer on a  6 point precision (which I've attached also). My problem is I'm unable to convert this time stamp into string which can be written to text file directly. I would prefer to avoid the "unbundle cluster" which gives me individual elements (like seconds,date,time,year,day of the year, etc) and them convert each of them into a string.
    Looking to hear from any one of you soon,
    Regards
    Attachments:
    get time.vi ‏14 KB

    Hi Roiht
    You will never achieve 6 digits precision with the "get date/ time i seconds function" Perhaps 1 if you are lucky. But you can convert the time to string using the "format data/time string" function. You find it in the same palette as the other time functions.
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

  • Retriving records with the date and time stamp

    I need to get all the records that were update between 08:36:06 AM and 8:36:09 AM on the12/15/2009
    I am using this query it is giving me the right numbers (I think) because this condition GURMAIL_CPLN_CODE = 'UGAP', I would like something more
    precise using the date and time stamp with the dates
    12/15/2009 08:36:06 AM
    12/15/2009 08:36:07 AM
    12/15/2009 08:36:08 AM
    12/15/2009 08:36:09 AM
    select * from GURMAIL
    where
    PERMAIL_CPLN_CODE = 'UGAP'
    AND TO_CHAR(PERMAIL_ACTIVITY_DATE,'MM/DD/YYYYHH24:MI:SS AM') >= '12/15/2009 08:36%'Thank you

    Yes, but HH24 and AM cannot be used together:
    SQL> select to_date('12/15/2009 08:36:06 am', 'mm/dd/yyyy hh24:mi:ss am') from dual;
    select to_date('12/15/2009 08:36:06 am', 'mm/dd/yyyy hh24:mi:ss am') from dual
    ERRORE alla riga 1:
    ORA-01818: 'HH24' impedisce l'uso dell'indicatore meridianoUse this:
    select *
    from   gurmail
    where  permail_cpln_code = 'UGAP'
    AND    permail_activity_date between to_date('12/15/2009 08:36:06', 'mm/dd/yyyy hh24:mi:ss')
                                    and  to_date('12/15/2009 08:36:09', 'mm/dd/yyyy hh24:mi:ss')or this:
    select *
    from   gurmail
    where  permail_cpln_code = 'UGAP'
    AND    permail_activity_date between to_date('12/15/2009 08:36:06 AM', 'mm/dd/yyyy hh:mi:ss am')
                                    and  to_date('12/15/2009 08:36:09 AM', 'mm/dd/yyyy hh:mi:ss am')Max
    [My Italian Oracle blog|http://oracleitalia.wordpress.com/2009/12/18/table-elimination-oppure-join-elimination-lottimizzatore-si-libera-della-zavorra/]
    Edited by: Massimo Ruocchio on Dec 23, 2009 12:05 AM

  • Adding time stamp to table/array

    Hi,
    In my posted VI I am displaying some collected temperature data on a table.  What I am having trouble with is getting the time data to work properly on the table.  When I set the include time data to true, it reads out the time as 1904 etc. I'm not sure if it's possible for me to include a time stamp in my array because when I try to convert a time stamp to a double precision float, the output is still a cluster, and thus cannot be added to the array.  I've also tried to convert the array to a string and concatenate the time stamp on, but the signals input for the table does not accept strings, and because I would eventually like to export this table to a spreadsheet in a file, I don't really want to link the strings to the indicator directly.  I've tried to work with the instrument as well, but when I read time data from it it gives it back in the form of multiple numbers, such as 2008, 8, 28, 13, 30, 31.12 and I can't consolidate it to one number.  Needless to say, I'm a little stumped and am open to suggestions on how to fix this problem, whether its a quick fix or a change in the way I'm trying to record the data.
    Thanks in advance,
    Mike
    Message Edited by mbeenen on 08-28-2007 03:59 PM
    Attachments:
    Automated Thermal Testing Table.vi ‏75 KB

    Here are the sub VI's that I'm using.  The inner while loop is designed so that the loop will halt immediately when stopped, and not have to finish its current iteration, as the iteration period is intended to be rather long.  I may modify the program to have a programmable start/stop time later, but this is at least my temporary solution.  The purpose of the decimate array function is to seperate out the channel label from the actual data so they can be placed as headers in the Excel function.  The intent was likely not clear with the lack of the SubVI's.  Overall, the display table on the front panel is no longer necessary, it was just for me to see how the table was working in the early stages of development.
    The one issue I had with your suggestion is the fact that I the build waveform function only accepts a 1-D array for the waveform input, and with multiple and variable number of channels being used I'm not sure how I could easily manipulate the data I gather into multiple 1-d arrays.
    As always the help is appreciated,
    Mike
    Attachments:
    Write_Table_To_XL_Mod.vi ‏39 KB
    Conf Temp 2.vi ‏37 KB
    EZ Temperature.vi ‏20 KB

  • Time stamp to number function

    The Conversion VIs and Functions palette has a function that converts the number of seconds elapsed to a time stamp (To Time Stamp Function).  I need to go in the other direction, from a time stamp to a double (number of seconds elapsed since 12:00 a.m., Friday, January 1, 1904 Universal Time).  Does anyone have a function to do this?  I've tried to type cast with no success.
    Steve Hall
    [email protected]
    Solved!
    Go to Solution.

    Just use the To Double Precision Float function. It's polymorphic and it will accept a timestamp to return the number of seconds since the LabVIEW "zero-time".

  • Converting time stamp in waveform to seconds

    Hello,
    I would like to convert the time stamp in a waveform (coming from 'AI Sample Channel') into seconds.  Currently when I read the waveform into a file I get a format that looks like
    18:00:47.453000
    Any help you can offer would be greatly appreciated, it seems like this should be easy to do?
    Thanks,
    Cullen

    In the attached example, I compare converting the datestamp to seconds by converting to double, to extended precision and doing a delta directly on the timestamp iteself (then converting). 
    Running the VI showed the same results (using Win-XP) for all three cases.  Unless you have a better OS, then the top example would probably do.
    At least the example will show you how to convert to seconds (in 50ms steps for the example), and how to do it using the array directly (polymorphic functions).
    Hope it helps,
    RayR
    Attachments:
    DeltaTime.vi ‏13 KB

  • Time stamp for BioBench

    I am acquiring EMG data with BioBench while acquiring gait data from another source simultaneously. To correlate the data, it's important that the date stamps match. I would like to know where the time stamp comes from, and if there is a way to get more precision (milliseconds instead of seconds). Also, can I get more precision when I export, since this chops it off to the nearest minute.
    Thanks!

    The gait data can't be acquired with BioBench since it is from a motion capture package that acquires data in a completely different way with lots of complicated analysis involved. It processes dozens of frames per second from several video cameras to find the markers etc. I want to match the movement with the EMG signal exactly, to see when the movement begins in relation to the EMG signal. Therefore, I need to know exactly at what time each point in the BioBench file takes place in order to find out how much earlier the EMG signal started than the movement. Knowing when the EMG signal started to the nearest second is not nearly good enough resolution to say anything meaningful about the time difference between the onset of the EMG signal and the movement. The
    whole point of acquiring data at up to 1000 Hz is defeated if I only know the absolute time to the nearest second. For anyone who can't acquire all of their data with a DAQCard (motion capture, force plate, etc), the data can't be correlated if the creation time isn't accurate and precise, which really makes BioBench useless for data acquisition or analysis.
    Is there anyway to get the creation time to a better resolution? And does the creation time correspond exactly to the first point in the data? I think this would be a necessary improvement for many users.

  • Time stamp on Waveform Charts

    I'm making an application where I sample data every 5 seconds. I use the Time Delay VI to obtain the sampling interval, and then set the chart options using chart properties/format and precision/relative time. The chart is adding a point every 5 secs as it should, scale looks ok. However, the time scale on the graph is incrementing only one second at the time (although actual time elapsed is 5 secs). The log file gives the time stamps just as it should. Is there a way to make the waveform chart give the real time (other than the obvious solution of sampling 1 pt/sec)?

    I'm just directly passing scalar values to the chart. The total acquisition time is about an hour, and the idea is to display data as they vary with time.

  • Time Stamp in millisecond?

    I need Time Stamp data in the Build Table VI to be in ms(millisecond) precision. Right now I get values in second precison only. can I format the cell of the table in any way to display milliseconds?

    You may also ask why you need this kind of resolution.  Be aware that Windows systems (and probably Mac and Linux as well) are multi-tasking and have many active processes when can interrupt yours at any time.  What this means is that something you thought should be occurring at neat 20ms intervals will do so for a few iterations, then suddenly give you a 500ms interval because an e-mail arrived.  If you need millisecond accuracy on a non-RT system, you should ensure it happens in hardware and get the timestamps from hardware as well.
    On the other hand, if you just need to know when things happened, the millisecond resolution will work quite well.  There was a weird bug in LV8 (?) used on Pentium 4 (?) processors where the timestamps were always rounded to even millisecond multiples.  I cannot remember the details, but you can probably find them by searching in this forum.  There was a long thread on the subject.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • LVM file time stamps - time stamps are not uniform

    My LVM files do not have evenly separated time stamps.  Is this by design?  I want to record data from multiple channels at say 100S/s and see this in my LVM file.  Ideally each of the 100 data points would be separated by 0.01s.  This is not what I get.
    I have tried changing the samples per second and the samples per channel inputs on my timing and read VIs but I don't get even spacing.  I have figured out that the DAQmx Read VI always cuts the number of samples in the file in half.  So sampling at 100S/s gives me 50 data points per second in my LVM file.  Given that it cuts the points in half, I would like the spacing to be .00, .02, .04 etc., but I get this:  .00, .01, .02, .03, .08, .09, .10, .11, .16, .17, .18, .19... 
    Is this normal or am I missing something?
    HP

    Unfortunately, I am not a DAQ user (the last time I really used DAQ was 7 years ago, before DAQmx was created). So, I have never seen your DAQ read issue.
    LVM, on the other hand, I am intimately familiar with.  Using the write to spreadsheet will almost always be faster than the LVM write.  Under the hood, LVM write uses write to spreadsheet, but also handles a lot of other bookkeeping (you can look yourself by converting an LVM Express VI to a normal VI and diving into it).  Your biggest issue will be saving the timestamps correctly.  If you are using the waveform datatype from the DAQ read, the timestamp is included, so getting it right is not an issue.  Formatting it in a text format for save is.
    Precisely what are you trying to do?  From you earlier post, it appeared you were taking one set of several channels of data every 10ms and writing to disk.  Depending on how you use the LVM write, you may be attempting to open the file and close it at every write.  This would be very slow and could account for your jitter.  Saving at every data point is also very inefficient.  You can stream at disk rate limited speeds (~10 - 60 MBytes/sec, depending on your hardware) if you optimize your buffer and disk write sizes. Optimum disk write size is about 65,000 bytes for Windows XP.  Your data is probably far less than that.
    Please post more details and code and I will try to help you more.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

Maybe you are looking for

  • Change the Page Title for all the pages when viewing the Reports in Bi Publisher

    Hello , I have a requirement for changing the Page Title for all the report displayed pages on the browser window.

  • JDBC to IDOC using BPM

    Hi Experts, I am doing the scenario JDBC to IDOC Note: i need a solution without stored procedures My requirement is , in sender JDBC side 1) We need to select data from 3 tables from the DB ( I think we can do this by JOIN query specified in the cha

  • Additional account assigment category

    What is the relevance of "additional account assignment category" field while creating purchase order?

  • Ability to add metadata or label folders

    Maybe I'm missing something, but I can't understand why folders (Mac OS) can't be tagged with metadata. If I have 20 folders - some of which are client A and some are Client B - I'd like to be able to keyword those folders. At the least I should be a

  • Java object casting

    hi, im just trying to get access to a method in an object in a linklist and cant seem to do it. the object is held in a link list and i can print its refrence easily but i want to access the getName function of that object but i cant seem to do it???