Decode time stamp from c-code

Hi everybody,
I have a TCP/IP where I send datagrams (in c-code) to LabVIEW (which is the server).
The datagram sends with every data a time stamp in the following way: dd.mm.yyyy hh:mm:ss.zzz, where zzz stands for milliseconds. I would like to see my data in a waveform chart at the LabVIEW frontpanel, but I'm not sure how to get a continuous time stamp from the c-code. I tried it with "scan from string" (as my data enters LabVIEW as a string), and then I made a sum of the minutes (times 60) and the seconds, which works for one minute, but after one minute my time goes of course to zero again which isn't nice for the waveform chart...
Does anybody has a nice idea how to solve this? Any examples?
Thanks in advance!
Steffi

This code should help you,
I only have a problem to read the final '.' my localization set the ',' as decimal sign and I can't get LabVIEW to change the decimal sign in this parser.
Ton
Message Edited by TonP on 02-01-2008 10:00 AM
Message Edited by TonP on 02-01-2008 10:01 AM
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas
LabVIEW, programming like it should be!
Attachments:
ScanTime.png ‏2 KB

Similar Messages

  • How to read a time stamp from the db without ".0" at the end

    Hi All,
    I have code that is saving the results of a query in a result set.
    When ever i read a time stamp from the db (mysql 4) it always adds ".0" to the end of it.
    I tried using the getTimeStamp, getDate, getString methods for result sets and was not able to resolve the issue.
    Am i missing something here?
    Thanks

    here is the code
    public static Table executeSelect(Connection conn, String qry)
         throws SQLException {
              Statement stm = null;
              ResultSet rs = null;
              try {
                   stm = conn.createStatement();
                   rs = stm.executeQuery(qry);
                   Table t = new Table(rs);
                   return t;
              } finally {
                   close(null,stm,rs);
    Basically the user is asked to enter the query and the connection settings and then i retrieve the data and return a table.
    Now if i try to print the value of the time stamp from the result set it adds a a .0
    So for example if am running the following
    select mod_ts from temp limit 1;
    | mod_ts |
    | 2007-12-28 09:32:58 |
    1 row in set (0.00 sec)
    When i print the value of the time stamp it gets printed as 2007-12-28 09:32:58.0
    The following code is used to generate a table from the result set
    public Table(ResultSet rs) throws SQLException {
              ResultSetMetaData rsmd = rs.getMetaData();
              int colCount = rsmd.getColumnCount();
              colNames = new String[colCount];
              colTypes = new int[colCount];
              for ( int i=0; i<colCount; i++) {
                   String colName = rsmd.getColumnName(i+1);
                   colNames[i] = colName;
                   int colType = rsmd.getColumnType(i+1);
                   colTypes[i] = colType;
              while ( rs.next()) {
                   if ( data == null) {
                        data = new ArrayList<List>();
                   List<Object> row = new ArrayList<Object>();
              for ( int i=0; i<colCount; i++) {
                   Object ob = rs.getObject(colNames);
                   row.add(ob);
              data.add(row);
    Now when i print the values in the result set it adds a .0 to the end of the time stamp
    I also tried using getTimeStamp for a result set and the same problem still existed

  • Crash due to Faulting application firefox.exe, version 1.9.2.3888, time stamp 0x4c745229, faulting module ntdll.dll, version 6.0.6002.18005, time stamp 0x49e03824, exception code 0xc0000005

    Uploaded latest version yesterday. On Vista.
    Crashes in google, united, not Craigslist.
    tried troubleshooting : allowed Firefox in firewall, disabled plug ins, when started in safe mode still same problem
    Couldn't fine container.exe to allow it
    Crash report last one showing was in August.
    data from the Event Log
    Crash due to Faulting application firefox.exe, version 1.9.2.3888, time stamp 0x4c745229, faulting module ntdll.dll, version 6.0.6002.18005, time stamp 0x49e03824, exception code 0xc0000005, fault offset 0x00031d62, process id 0x1328, application start time 0x01cb52a1a20e0726.

    Uploaded latest version yesterday. On Vista.
    Crashes in google, united, not Craigslist.
    tried troubleshooting : allowed Firefox in firewall, disabled plug ins, when started in safe mode still same problem
    Couldn't fine container.exe to allow it
    Crash report last one showing was in August.
    data from the Event Log
    Crash due to Faulting application firefox.exe, version 1.9.2.3888, time stamp 0x4c745229, faulting module ntdll.dll, version 6.0.6002.18005, time stamp 0x49e03824, exception code 0xc0000005, fault offset 0x00031d62, process id 0x1328, application start time 0x01cb52a1a20e0726.

  • How do you edit out the date and time stamp from a photo

    How do you edit out the date and time stamp from a photo

    You can blur it out with retouch
    The built-in "Retouch" brush in "Edit" mode should suffice, if the background is mostly uniform, and if you set the size of the brush to slightly wider than the bar width of the letters. For example, in this picture I removed the year from the date (in the lower right corner) by using the "retouch" brush and following the contours of the letters. (the screen shot is from iPhoto '11, but iPhoto 9 should give similar results).
    Regards
    Léonie

  • How do I see the time stamp from footage

    I was wondering if it is possible to see time stamps from footage taken by GoPro camera in FCPX. I can see the duration of the clips and the DATE it was created. I would like to see the actual time it was created. I have 2 cameras that were shooting at the same time and I would like an easier way of sifting through all of the clips to mary them up.
    Is there a way to see the time stamp of when the video was taken?
    Thanks

    Got ya. I will suggest one more thing: You can add "markers" at points where you can visually (or aurally) see (or hear) a synch point. Once you add these markers, "synchronize clip" will begin to grind out the rest.
    Again, if you look at the above tutorial, I think it explains this under "manual" synch.
    I don't mean to push this upon you, but... FCPX is GREAT for multi-cam synch. It is the best--I think--in the industry.
    Good luck. Sorry if I'm of little help beyond this.

  • Transfer time stamp from text file into MS Access thru Labview

    Hello everyone,
    I am Cruz; Long time listener, First time caller.
    I am currently monotoring data being collected by an oven. The data is stored in a text file. I am using Labview to take the data from the textfile and place it in an MS access DB for manipulation. The first three columns of the text file are the time stamp of data. When i transfer the data into Access i cant get the first three columns to display as a time stamp. Can have some pointers on what how to get the first three columns to display correctly.
    Additional info:
    the text file is a 1D array that gets overitten with every new mesurement tanken. the transfer to Acces is to not loos any of the information and to better manipulate the data into forms and such.
    Running Labview 2010
    attached is code and text file.
    Any help is greatly appreciated.
    Attachments:
    Oven test other.vi ‏16 KB
    datalog032010003.txt ‏1 KB

    Your first mistake is reading the file as DBL. Your first three columns are obviously not numeric values. Did you ever look at the output array? Read it as strings. Second, you would need to combine those first three columns to create an actual time stamp before you write to the db. Unless of course you have one column for date, one column for time, and one column for AM/PM. I would not recomend that type of structure in the db.

  • Wrong Time Stamp from GPS GGA Sentence?

    Hello Everyone,
    Today I made a short program to interface with a GPS antenna over the serial port, and parse the incoming strings.  That part seems to work great.  However, when I decode the GGA sentence to retrieve the UTC time (hhmmss.ss) and try to convert it to a time stamp, the value seems off. 
    First, when I'm watching the UTC time count up, one second of displayed time is longer than 1 second of me counting out loud.  Counting out loud isn't super accurate, I know, but it takes almost 2 seconds of real time to pass before 1 second updates on the display.  Not sure why.  I'm thinking it has something to do with my loop timing?  The expected sample rate coming from the antenna is 5 hz.  I have a wait function built into the program to time the loop, and if I try any value I try besides 200mSec, then the sentences don't read correctly at all.  Am I getting data correctly by setting a wait function, or should I be doing something else. 
    Also, the time just doesn't match up with my computer time at all.  When I first ran it, it was like 10 minutes fast.  But I let it run for a little while and now it's 1.5 hours fast.  I'm not sure if it jumped to that time, or worked it's way up.  Either way, if the seconds truly are updating slower than 1 second of real time, I'm not sure why the timer is fast? 
    I'm pretty confused at this point.  This is my first time using GPS, so if anyone with some experience could help, I'd appreciate it. 
    Thanks,
    Alex 
    Attachments:
    Front Panel2.JPG ‏68 KB
    GPS1.vi ‏44 KB
    Block Diagram2.JPG ‏132 KB

    Ok, thanks for the quick responses everyone.  I will try to weave together replies to some of your comments, as well as talk about a discovery I made. 
    As far as my system goes, I actually have a Blue Tooth unit communicating over the serial port.  It works great through Hyper Terminal, as I can use it to retrieve NMEA sentences just fine.   The VI I made with Labview retrieves the sentences just as well, so I know I am communicating with my antenna.  I know I have a lock on several satellites, because I can get that information from one of the sentences.  The UTC time it provides, in the format hhmmss.ss (similar to your GPRMC Mike), seems correct.  It matches my system time within a minute.  So I am pretty confident with the system setup.
    That being said, I made a discovery this morning that might point to the problem.  Right now I am retrieving 2 sentences from the GPS unit: GPGGA and GPVTG.  When only pulling in the GPGGA sentence into Labview, the UTC time seems to be updating as I would expect.  Every time I count one second of time, the UTC time changes by one second.  Great!  Then I programmed the GPS unit to start outputting GPVTG sentences in addition to the GPGGA sentence.  Now when I look at the UTC time, it takes longer than 1 second real time to update 1 second of UTC time.  I hope that makes sense.  So it seems like when I pull in two sentences at a time, the system slows down.  Is this a VISA read error or something?  I don't know where the problem really could be.  This seems like the main issue. 
    Otherwise, the second problem I have, is actually converting the GGA time value to a Labview timestamp.  Right now I just have the UTC value (hhmmss.ss) feed into a "to Time Stamp" function within Labview.  I'm not sure that is the correct way of going about it though.  I guess I'm not even sure where a date value comes into play either? 
    Anyways, hope you can guys can see something here that I am missing. 
    Thanks again. 

  • Read file latest entry with time stamp from unix

    Hi
    I have a log file which is being generated with an entry  like this
    Product20080228185707,TRANSPORTED,862067_G,MPITT,20080415,ADEAMICIS,
    Product 20080229151029,TRANSPORTED,862067_G,MPITT,20080415,ADEAMICIS,
    Product 20080320163241,TRANSPORTED,862067_G,MPITT,20080415,ADEAMICIS,
    Product 20080229151111,TRANSPORTED,862067_G,MPITT,20080415,ADEAMICIS,
    I know how to read the file from Unix but How do I pick the entry with latest time stamp ?
    Please help urgent
    thanks

    Hi,
    Do like this.
    1. Declare table with two fields as name(255) type c, timestamp(14) type n.
    2. Loop at your entries and push entry name in name field and time stamp in timestamp field. You can move time stamp as: move file+7(13) to timestamp.
    3. So your new internal table will have entry names and timestamp.
    4. Now sort itab by timestamp descending.
    5. Read itab index 1.
    this will give you latest entry from unix.
    i hope this helps,
    Ags,

  • Plotting Time Stamp from Txt file in Column to another column

    I want to know how to plot 2 columns that i am reading from a text file.
    column 1 has a time stamp in HH:MMS,  and column 5 has data in which i want to plot the time verus the data.

    The Scan from String function will do most of those conversions in a single step.  Here are a couple of examples.  You will still need to read the array of strings in and process in a loop.
    Message Edited by DFGray on 03-19-2010 07:46 AM
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • Time stamp from dynamic data

    I trying to write dynamic data to a file using Express VI (Write LabView Measurement file). The dynamic data comes straight from a simulated Signal Express VI. The signal part of the dynamic data is written correctly but the time stamp is what appears to be float counting the seconds since the Write LabView Measurement file Express VI was started.
    I have configured the Simulate Signal VI Time stamp to absolute data and time option.
    This should be dead simple but it just do not work!
    Any suggestion to what I might do wrong?
    I do expect that the time stamp would be written as two columns one for date and one for time.
    Thanks,
    Soren T. Jensen

    The timestamp is written in the header of the file. The time and date entered there is the time and date that you are looking for. The timestamp written next to each piece of data is indead a relative value. It is the delta from the timestamp in the header to the time that datum was collected (created). The reason for this is that timestamps are quite large in bytes, especially if you break out the time and date in strings. Just stamping the header and providing the offsets is much more efficient.
    If you choose to not provide a header, I think that the timestamp will be lost entirely. I think that this is probably wrong, but I am uunsure what should be done to correct it.
    Hope that this helps,
    Bob
    Bob Young - Test Engineer - Lapsed Certified LabVIEW Developer
    DISTek Integration, Inc. - NI Alliance Member
    mailto:[email protected]

  • How to read time stamps from a spreadshee​t and calculate the difference between consecutiv​e time stamps?

    Hi,
    I am new to Labview. This question might be a joke to some of you here, but any help would be greatly appreciated. I have a spreadsheet with time stamps and power outputs from a generator. I am supposed to calculate the difference between consecutive time stamps, which will act as a delay for the next power output update that needs to be sent. For example, lets say that I have to following data:
    Time Stamp                    Power Output
    11:00:00 AM                       3kW
    11:00:02 AM                       2.9kW
    11:00:04 AM                       3.2kW
    11:00:06 AM                       3.1kW
    The above data doesn't make any sense, but it is just for the purpose of this question.
    So, I have to read 11:00:00 AM and 3kW initially - 3kW is the initial request that

    Hello
    you can simple subtract one time from the other one and so you get the difference. -> Example
    Mike
    Attachments:
    Unbenannt 2.vi ‏8 KB

  • How to read time stamps from a spreadsheet and calculate the difference between consecutive time stamps?

    Hi,
    I am new to Labview. This question might be a joke to some of you here, but any help would be greatly appreciated. I have a spreadsheet with time stamps and power outputs from a generator. I am supposed to calculate the difference between consecutive time stamps, which will act as a delay for the next power output update that needs to be sent. For example, lets say that I have to following data:
    Time Stamp                    Power Output
    11:00:00 AM                       3kW
    11:00:02 AM                       2.9kW
    11:00:04 AM                       3.2kW
    11:00:06 AM                       3.1kW
    The above data doesn't make any sense, but it is just for the purpose of this question.
    So, I have to read 11:00:00 AM and 3kW initially - 3kW is the initial request that is sent. Then I have to

    Repeated forum post
    Please view http://forums.ni.com/ni/board/message?board.id=170&message.id=294435
    Regards,
    Juan Galindo
    Applications Engineer
    National Instruments

  • How do you remove the date/time stamp from a photo before printing?

    I have one group of photos in an event that have the date and time stamp on them.  I don't know how to remove the date/time stamp before printing. 

    If you have your camera set to imprint the date/time on the photo you can not "remove it - it is a part of the photo - depending on the surounding photo you might be able to retouch it out
    LN

  • How to build a time stamp from a string

    I have the date-time information stored in a string and I want to build a time stamp to make a plot with the date-time in the X axys. Is there a way to do this??
    thanking in advance...
    crimolvic

    See attached vi.  You may have to modify depending on the order your string.
    - tbob
    Inventor of the WORM Global
    Attachments:
    DateTimeMOD[1].vi ‏34 KB

  • Loading Time stamp from Flat File

    Dear Experts,
         I thank you for your kind support and replies.
       Again I am stuck in a issue. So I need your help.
       We are loading flat file data into a cube/dso. The flat file contains time stamp field.
    All the data are getting loaded properly except time stamp.
    The field is taking system date and time of data loading.
      I have taken the customized info-object like 0TCTTIMSTMP.
    Kingly guide me, where I am going wrong.
    Thanks,
    Sanjana

    Hi Experts,
          I am trying to load the flat file, the input format is attached below.
    Creation Date
    20,150,411,121,600
    20,150,406,032,600
    20,150,406,125,800
         but after loading into the ODS , the data is becoming
    20150424102709
    20150424102709
    20150424102709.  
       This means it is taking today's Date..
    I have the checked the PSA level, there also the data is 20150424102709.
    Also checked the Conversion  Routine, it is maintained with TIMES.
    Kindly suggest, what may be the cause or how can I work on this.
    Thanks,
    Sanjana.

Maybe you are looking for

  • How can I convert and replace SDII files to WAV files in a song?

    I have to convert some audiofiles in a song from 16 to 24 bit and from SDII to WAV. I choose the option "Copy/convert files" in the audio window and everything is converted well. In my audio window I have now 16 and 24 bit files and WAV and SDII file

  • BBM version 6.1.0.49 - my bbm contacts cant see my Dp when i change it (Bold 9900 )

    Hello, I just bought my blackberry a few days go and I can't see the display image of BBM contacts and they also cant see mine.  The only time I could see their display image is when they change it.  I tried changing my and they still can't see it.  

  • How do I find a word in all my document, return false if it's not in there.

    Hi, I struggle with something that should be easy, and didn't find any answer on this forum. I have a list of word that I want to search in a 300 pages catalogue in InDesign. I'd like to know how can i: 1) Look for the word 2) Return true if it's in

  • There was a problem connecting to the server "192.168.1.3

    'There was a problem connecting to the server 192.168.1.3 Check the server name or IP address, and then try again. If you continue to have problems, contact your system administrator.'  - How to sort this out so I can connect to my NAS Drive via wifi

  • Can't update Apple TV to 6.0

    I tried to update Applt TV but it says it is up to date with 5.3.  Should I even bother updateing with all these other problems I have been reading about?  Is this an apple software problem or did apple stop the update?