Using counter to time stamp to text file

Dear all,
I am using counter to acquire singnal from quadrature linear encoder. I would like to time stamp the data acquisition to text file but I found that I can't choose to read time. Anyone know how to solve this problem?
Attachment is my program.
Thank you very much!
Best regards,
George
Attachments:
encoder continous 21-4-2013.vi ‏28 KB

Hi,
Have you seen these two articles?
http://digital.ni.com/public.nsf/allkb/68806B93A21​355E98625726F0064822B
http://digital.ni.com/public.nsf/allkb/5D42CCB17A7​0A06686256DBA007C5EEA
Basically, it can be done, but be aware it may not be as accurate as you would like.  Follow the code in the first article and note that the easiest way would be to just use the basic File I/O VIs to write to text file, since the Write to Measurement File VI will only work with waveforms and you have counter output.
Matt Lee
National Instruments
Applications Engineer

Similar Messages

  • 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.

  • Read one word at a time from a text file

    I want to read one word at a time from a text file as it is done by "scanf &s" function in text based programme. It is not possible by " read from text"  function. Suggest me  function or method to solve this.

    The simplest way is to use the spreadsheet string to array function with the space character as the delimiter.
    Note that this won't work unless there is a space character between the words - it won't work with line feeds / carriage returns between the words but you could always split the string into lines first. You may also want to trim whitespace to remove any other non-visible characters (e.g. tab, line feeds) from around the word.
    If you need something more sophisticated that splits based on whitespace (e.g. tab, new line) then you'll probably need to do something with searching the string for these characters (e.g. using a regular expression) and then splitting them yourself into an array.
    Of course...if you actually want to just read one word at a time from the file rather than just split the file into words (I assumed you meant this), you will need to read the file byte by byte using the low level file IO functions, build a buffer of the bytes and check the character you've read to see if it a space.
    Certified LabVIEW Architect, Certified TestStand Developer
    NI Days (and A&DF): 2010, 2011, 2013, 2014
    NI Week: 2012, 2014
    Knowledgeable in all things Giant Tetris and WebSockets

  • Customizing Time Stamp In Receiver File Adapter

    Hi,
    I am working in a XI to file adapter scenario.
    The default time stamp in receiver file adapter is yyyyMMdd-HHmmss-SSS.
    I want to time stamp as "ABC_MM_DD_YYYY_HH_MM_SS".
    i searched SDN,but not getting an end to end approach.
    Like...I developed a UDF ,but when I map it to receiver root node..I am getting error.
    Please help.
    Just request for a step by step procedure.
    Also,ASMA is not v clear to me......
    Plzzzzzzzzzzzz help!!
    Regards.

    Hi sriparna,
    The timestamp used by the File Receiver Adapter is a default pattern, to achieve that you have to use a UDF in the middle of the MM and set the receiver file name with the ASMA, read this for further information:
    ´´´´ Dynamic Configuration vs Variable Substitution - The Ultimate Battle for the File Name
    /people/shabarish.vijayakumar/blog/2009/03/26/dynamic-configuration-vs-variable-substitution--the-ultimate-battle-for-the-file-name
    It really helps,
    regards,
    Juan.

  • How can i add a time stamp to tdms file?

    I want the data and the time for the tdms file generated?
    how can i do that?
    should i cinvert .tdms to .lvm and use the data storage option or excel add on option for .lvm file created?
    cant i directly have the time stamp for tdms file generated?

    How are you acquiring the data in the first place?  That will matter in how we want to approach this.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Read a character 1 at a time from a text file

    Hi all,
    I have tried the following to read 1 character at a time from a text file but it did not work;
    int buf_sz = 1;
             try
                BufferedReader br = new BufferedReader( new FileReader( "C:\\bitshift.txt", buf_sz ));
                String rd_line = null;
                while( (rd_line = br.readLine()) != null)
                    System.out.println(rd_line + "\n");
             }I could only get it to read the whole line by removing the buf_sz when creating an instance of the BufferedReader.
    How can I achieve this?
    Thanks

    The Javadoc for Reader.read()
    read
    public int read()
             throws IOException
        Read a single character. This method will block until a character is available, an I/O error occurs, or the end of the stream is reached.
        Subclasses that intend to support efficient single-character input should override this method.
        Returns:
            The character read, as an integer in the range 0 to 65535 (0x00-0xffff), or -1 if the end of the stream has been reached
        Throws:
            IOException - If an I/O error occurs

  • How can I get a time stamp on text message without turning on "read"???

    How can I get a time stamp on text message iPhone 5 IOS 7? (Without having to send read receipt)

    You can make the "Visit Date" column visible in the Bookmarks Manager (Library) via "Views > Show Columns"
    * Bookmarks > Organize Bookmarks
    *http://kb.mozillazine.org/Viewing_the_browsing_history_-_Firefox

  • Unable to measure pulse time, using Counter pulse time 1samp.vi

    Hi
    I am using pci6624 board to measure pulse time . I have selected counter 0 to measure  pulse time & connect the signal to gate0+ & gate0-.
    When i used Counter pulse time 1samp.vi to read the pulse time , i am not able to read the value and i am getting following error msg . If i used Counter DBL 1samp.vi  i am getting out put.
    Please help me
    Attachments:
    pulse_time_measurment.vi ‏11 KB
    Counter_errors.JPG ‏44 KB

    Hi,
    You can try changing the mode to counter -> single sample -> DBL in Daqmx read function
    You can also try this example 'Meas Pulse Width-Buffered-Cont.vi' or related examples from NI Example Finder.
    Cheers,
    Sahil Gupta
    NI India

  • Retaining date/time stamp when copying files from a backup network drive

    How do I retain the date/time stamp when copying files from a backup such as a external drive or a network drive?

    i don't trust MA at all. known to create a lot of problems.
    instead, see the green box in this user tip.

  • IPhone texting; no verizon 'checkmark' no time-stamp on texts- it makes texting unpleasant- am considering taking it back- how can I fix this?

    IPhone texting; no verizon 'checkmark' no time-stamp on texts- it makes texting unpleasant- am considering taking it back- how can I fix this?  Is there an app I can buy?  If not is there a smart phone out there that includes this?

    ALL of my messages have the date and time. I just sent that one to get something generic to post.  It's true that each text in a conversation does not have its own time stamp, if there is a minimal amount of time between texts, but take a look at this.  "R" replied 25 minutes after my initial text and that message has date/time.  I replied immediately and that one does not.

  • How do you vary the Date/Time stamp format in File Adapters

    In the receiver channel of the File Adapter where you specify the 'File Name Scheme', you do have the option of specifying a 'File Construction Mode' of 'Add Time Stamp'.  How can you specify a different Date/Time stamp format ( eg MM/DD/YY vs YYYYMMDD vs MMDDYY, etc. ) without changing the Date/Time stamp for the entire SAP system?  Also, can you control where the Date/Time stamp appears in the filename?

    Hi,
    There are many threads discussing the same issue. Go thro the following:
    Dynamic file name (Date) in Receiver File Adapter
    Receiver File Adapter - TimeStamp
    Bhavesh's reply in above thread:
    You can use Adapter Specific Identifiers and then change the file name in the mapping. Append the tiem stamp in the format that you want and so on.
    Just use this code in an UDF,
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String SourceFileName = conf.get(key);
    java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat( "yyyyMMdd" );
    dateformat.format( new java.util.Date() );
    String newfilename=SourceFileName+dateformat;
    // change to new file name
    conf.put(key, newfilename);
    return "";
    Regards,
    P.Venkat

  • 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)

  • Get the created time stamp of a file...

    Hi Guys,
    I am trying to get the created time stamp of a text file from oracle... How is this possible? I tried using UTL_FILE but didnt succeed so....
    Thanks...
    Edited by: Napster on Oct 21, 2010 12:43 AM

    You may try something like this.
    create or replace and compile java source named filehandler as
    import java.lang.*;
    import java.util.*;
    import java.io.*;
    import java.sql.Timestamp;
    public class FileHandler
      private static int SUCCESS = 1;
      private static  int FAILURE = 0;
    public static Timestamp lastModified (String path) {
        File myFile = new File (path);
        return new Timestamp(myFile.lastModified());
      }Then the wrapper
    CREATE OR REPLACE FUNCTION lastModified (p_path  IN  VARCHAR2) RETURN DATE
    AS LANGUAGE JAVA
    NAME 'FileHandler.lastModified (java.lang.String) return java.sql.Timestamp';PS: Not tested.

  • Add one character at  a time from External Text file

    Hi,
    I'm using Flash 8, and I have created a standard Dynamic
    field that pulls the text from an external text file using the
    LoadVars function and it works fine.
    To get the correct effect for the design, I would like to be
    able to create the illusion that the characters are being typed out
    when the page loads as if someone has started typing and also hear
    the "Typewriter Clack" each time a character appears.
    The only place I have found an example is on the Syphon
    Filter Game website which seems to have created the illusion
    perfectly:
    http://www.syphonfilterdarkmirror-thegame.com/en_IE/
    (Check out the bottom right section)
    I could create a Movieclip and add a character each frame
    but, I would like to be able to edit the text when required via a
    text file or even ASP or PHP if neccessary.
    Any help would be grateful.
    Cheers

    or here:
    http://www.actionscripts.org/tutorials/beginner/Scripted_Typerwriter/index.shtml

  • Time Stamp format from file problem

    Hey there,
    I have a pretty peculiar problem. I'm working on two PCs right now, one is my private laptop running on Windows 8, and the other one the PC at my workplace, running on Windows XP, but on the same version of LabVIEW. I use this method to save the time and date to a tab delimited .txt file. Then later, with another VI, I read the date and time written to file to reconstruct the time stamp. I've noticed that dates written to file from my workplace differ from the dates written from my private PC: in Windows XP, there are "-" separating the day, month and year. In Windows 8, it's "/". There are other differences (see pictures). So naturally, when reading from file using my VI, I can only read on my private PC files (or at least dates) written on my private PC and vice versa, I can't read files written on my private PC on my workplace PC. Can anybody tell me why there's a difference in format, or how to write the date uniformly so I can read it on any PC, or how to read both formats?
    So this is the method I use for writing the time and date (the subVI only inserts a certain number of TAB characters).
    This is what it looks like on Windows 8
    This is what it looks like on Windows XP
    This is the VI (attached) I use to read the time stamps (the first row actually contains the time stamp in HH:MM: SS format for a whole bunch of measurements).
    Have a nice day.
    Solved!
    Go to Solution.
    Attachments:
    Extract Time Stamps.vi ‏22 KB

    I would suggest using the ISO-8601 UTC format.
    The only limitation is that the string value is in reference to GMT.
    The conversion of the string back to a timestamp will present the date/time on your front panel indicator as local time.
    https://lavag.org/topic/15034-timestamp-support-for-format-into-string-scan-variant-from-string-stri...
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

Maybe you are looking for

  • Problem with 3rd Gen Ipod Nano being recognized by Itunes

    I have a third generation Ipod Nano that was only used once. It takes a full charge and appears to be working fine. Problem is when I plug it into a computer it is not recognized by Itunes. The computer recognizes it but not Itunes. I have tried it o

  • Handoff not shown on iPhone

    I have an iPhone 4s with iOS 8,02 installed and when I click on General/Settings I do not see Handoff & Suggested Apps,  Is there a defect in the software/hardware.?  Thank you.

  • Problem with Adobe Audition

    I would like to ask for help. I downloaded Adobe Audition. I instaled it without problems but than, when I wanted to open the program, it gave me this: "Please sign in with your Adobe ID to use your trial of Adobe.." bud when I give "Sign in" it will

  • Properties panel crashes flash cs4  - OSX 10.5.5

    I just upgraded to cs4 and all other apps seem to work fine but flash cs4 10.0.1. heres how I can make it crash every time: 1) launch flash cs4 2) create a new action script 3 document 3) click the color pallet to change the back ground color in the

  • How Can I Rip My Music Off An AVI File

    Hi does anyone know how to rip music off a movie file. I made this fifty minute movie years ago and now I want to make it shorter but no longer have the original footage. Thing is I cant re-edit due to music in the background. Am I **** up creeks pad