Add time stamp array into first column of text file

I am writing daq output to a file by using array to spreadsheet string vi then write that to a file but I would like to add a time stamp array into the first column of the text file. How do I do this?

When you use a DAQmx Read, you have the option of returning a waveform data type. This includes time data. If you were to use this and either Export Waveforms to Spreadsheet File or Write Measurement File, this would included. To stick with the regular Write to Spreadsheet File, you would have to create an array of timestamps yourself based on a start time and the sample rate of the DAQ. Then you would convert this and the data array to strings and use the string array type of Write to Spreadsheet instead of the DBL type.
Message Edited by Dennis Knutson on 09-25-2007 01:12 PM
Attachments:
Write to Spreadsheet - Strings.PNG ‏1 KB

Similar Messages

  • HOW DO I ACHIEVE A TIME STAMP, IN THE FIRST COLUMN OF MY SPREADSHEET IN EXCEL,SHOWING THE TIME INTERVAL, INCREASED BY THE SCAN RATE ?

    FROM AI START VI TO FORMAT AND APPEND VI TO CONCATENATE STRINGS,SECOND INPUT IS TAB,THEN EVEY OTHER ONE IS TAB. THIRD AND FIFTH INPUT IS ATTACHED TO GET DATE/ TIME VI, THEN END OF LINE, THEN CHANNEL 0; TAB; CHANNEL 1;TAB, AND SO ON THROUGH CHANNEL 7. THEN THE LAST INPUT IS END OF LINE. ON THE SPREADSHEET I RECIEVE THE SCAN RATE, THEN THE DATE ,THEN THE TIME; ALL ON THE FIRST ROW. THE NEXT ROW HAS THE COLUMN LABLES, AND DATA GOES TO THE CORRECT COLUMN. BUT NO TIME STAMP COLUMN. I WOULD LIKE IT TO BE IN COLUMN "A" EVEN WITH THE FIRST ROW OF DATA. EX." 10:01:01 200 300 400
    10:01:03 200 300 400
    THANK YOU
    FOR YOUR HELP, JOE BOB CRAIN

    I think the best way is to generate an array of time values to send to your spreadsheet BEFORE channel 0 data.
    To generate the array you can use Ramp Pattern.vi from 0 to 'Actual Scan Rate' (from AI Start) * number of scans performed.
    That way in your spreadsheet you will have the first line same as now, next the columns with time(secs), channel 0, channel 1... channel 7.
    If you need the time column with date and time string, you can use Get Date/Time in Seconds.vi when you begin acquisition, then sum the seconds obtained to the array calculated as above and next use Format Date/Time String.vi to obtain the time stamp you need, next build array of time stamps and sent to your spreadsheet.
    Hope this helps
    Roberto
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • How can we read a column from text file

    hai,
    the Text file contains :
    m1 m2 m4 89
    m1 m2 m4 89
    m0 m4 m2 90
    I need one array for each column
    m[0]= m1,m1,m0 (first column from text file)
    m[1]= m2,m2,m2 (second column from text file)
    m[2]= 89,89,90 (third column from text file)
    andvance thanks

    If a 2D array is OK (instead of 4 separate arrays), try something like this
    import java.io.*;
    import java.util.ArrayList;
    class FileReadColumns
      public static void main(String args[]) throws IOException, FileNotFoundException
        String line;
        ArrayList lines = new ArrayList();
        BufferedReader in = new BufferedReader(new FileReader("data.txt"));
        while ((line = in.readLine()) != null) lines.add(line);
        String bits[];
        bits = lines.get(0).toString().split(" ");
        String grid[][] = new String[bits.length][];
        for(int i=0;i<grid.length;i++)grid[i] = new String[lines.size()];
        for(int i = 0; i < lines.size(); i++)
          bits = lines.get(i).toString().split(" ");
          for(int ii = 0; ii < bits.length; ii++) grid[ii] = bits[ii];
    for(int i = 0; i < grid.length; i++)
    for(int ii=0;ii<grid[i].length;ii++)System.out.print(grid[i][ii]+" ");
    System.out.println();
    System.exit(0);

  • File adapter- Add time stamp

    Dear All,
    Scenario:-
    File to Proxy and Acknowledgement SAP to File.
    Once the file is received by SAP and first ack is send as recepit of file to Legacy system, after that the process goes ahead and do other validation and the same outbound proxy is triggered and send the respeonce.
    Now in Ack i am using the same strucutre to send the file receipt and the other response and in file adapter I am differentiatiing the file with Add time stamp option.
    Problem:-
    My Ack Response from R3 is coming very immidiately. For example Reciept time stamp and other response time stamp is same.
    Hence my legacy system is not able to differentiate which is the first flow. Ideally after receipt the other file will be seen by Legacy.
    How can I resolve the problem in case when the time stamp for both the flow is same.
    I can see Add time stamp option has yyyyMMdd-HHmmss-SSS wat is SSS stands for?
    Chirag.

    Hi,
    My Ack Response from R3 is coming very immidiately. For example Reciept time stamp and other response time stamp is same.
    Request / response timestamp can't be same, even if it happens at real time.
    I can see Add time stamp option has yyyyMMdd-HHmmss-SSS wat is SSS stands for?
    SSS is milliseconds having values between 000-999.
    Regards,
    Neetesh

  • Appending and add time stamp at a time........

    Hi all,
    i am working on a scenario...
    it is file based..no mapping and bpm can be used.
    I need to pick up file through xi and append it and put in the target with time stamp to it.
    we can achieve this if mapping or bpm is allowed.....
    But,in file processing we can use only one option at a time.....
    I found a way:
    scenario one: files will be appened and kept in a temparory folder
    using another scenario we will pick up the appeneded file and add time stamp and keep in target structure...
    but i dont think this is advisable...
    please suggest me any other ways to achieve this...(can run operating system command be helpfull??)
    thanks in advance..
    Regards,
    Kiran.

    HI,
    Yes you are right, Appending and adding Time Stamp will not be possible simultaneously.
    Refer - this could help you
    Dynamic Filename with TimeStamp  
    Dynamic Filename with TimeStamp
    /people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
    But some how you have to use mapping for it. Then if its allowed to use the mapping then as you have suggested, should have to go for two scenarios. No alternative,
    Probably also you can try with Customized Adapter Module for this.
    Thanks
    swarup

  • Receiver FTP processing parameters should not add time stamp

    Hi Gurus,
               I want to write the file at receiver end with the same name as in source directory.. (I dont want the time stamp to be added to my file at receiver side)
             For that i have configured processing parameters as
                1) File Construction mode --- create
                2) checked Overwrite existing file
                3) Put File -
    use temporary file
                4) Temporary File Name Scheme --- rec_*.tmp
                5) File type -
    binary
    But the files are not written in target directory..
    How to troubleshoot it...
    Thanks and Regards,
    govada.

    Hi,
    open RWB - coomponent monitoring
    and then - adapter monitoring or communication channel monitoring
    (depending on SP of your XI)
    then find your channel and you will see the error - if there is any
    BTW
    if you don't want the timestamp just don't use:
    Add Time Stamp property in the file adapter
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Add time Stamp format in File Adapter

    Is it possible to change Add Time Stamp format ??
    If so please let me know the procedure to chnage it..
    It is scenario with no mapping so i cant go either Dynamic configuration or Variable substitotion.
    Thanks & Regards,
    Polas

    Hi,
    I think you need to assign it dynamically as you cannot change the format for Add TimeStamp
      See the below links:
    File Adapter: Dynamic file name
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/EN/e3/94007075cae04f930cc4c034e411e1/content.htm
    Thanks,
    Tiny

  • How do I add time stamp to photo in photoshop?

    How do I add time stamp to photo in photoshop? I have saved photos from a camera phone to the computer. They still have the META data on them (aka the date and time from when the picture was taken). How do I put them on there?

    The following is old but may still be valid with Yosemite (it addresses how to remove the name but indirectly also how to display it): http://osxdaily.com/2012/01/10/remove-user-name-from-menu-bar-os-x/

  • [ADF Faces] set cursor position to the first column input text in ADF table

    How do i set the cursor position to the first column input text when i Insert a blank row?
    My idea is to implement using javascript. document.setfocus() but how do i do it from the backing bean code? or how do i install custom js to call document.setfocus()?
    any ideas?
    Message was edited by:
    user450391

    Did you try by iterating the selected row?
    Bind the table with the managed bean and then try with below code:
    RichTable empTable;
    RowKeySet selectedEmps = getEmpTable().getSelectedRowKeys();   
    Iterator selectedEmpIter = selectedEmps.iterator();
    DCBindingContainer bindings = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding empIter = bindings.findIteratorBinding("EmpView1Iterator");
    RowSetIterator empRSIter = empIter.getRowSetIterator();
    while(selectedEmpIter.hasNext()){
       Key key = (Key)((List)selectedEmpIter.next()).get(0);
       Row currentRow = empRSIter.getRow(key);
       System.out.println(currentRow.getAttribute("Ename"));

  • When I import IE8 bookmarks into Firefox Portable, the text files or downloaded Google searches or other downloaded websites that I saved and added to my various Favorites folders do not appear ... and (2) if I can get them to appear, will I continue to b

    When I import IE8 bookmarks into Firefox Portable, the text files or downloaded Google searches or other downloaded websites that I saved and added to my various IE8 Favorites folders do not appear ... and (2) if I can get them to appear, will I still be able to add text files to the Firefox Favorites folders ... and how.
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)

    http://portableapps.com/forums/support/firefox_portable

  • How to adjust splitted lines into one line in Text file?

    Hi Guys,
    I have a text file with 3 fields(comma separated): GLCode (Number), Desc1 (Char), Desc2(Char) and need to load it into BW.
    My Text file looks like:
    1011.00,"Mejor PC Infrastructure","This line is ok."
    1012.00,"Telephone Equipment $","This line ends in next line.   
    1)Need to change the equipment immediately.
    2)Take immediate action"
    1013.00,"V1 Computer Server Infrastructure # Equip","For purchases
    of components that make up the company's network, such as servers, hubs, routers etc."
    1014.00,"Flash Drive","Need to provide all IT Developer"
    This is how file looks like. Now I need the followings:
    1. Need to remove the space and need to adjust the splitted line into one. Say here
    line/record 2 is splitted into 3 lines and need to adjust in 1 line.
    2. In Line 5 (Record 3) data splitted into 2 lines and need to make 1 line.
    3. Need to remove bad characters.
    Could someone help me please how to proceed ?
    Regards,

    Not quite correct by my testing.  Try:
    $i=0
    Get-Content .\test.txt | ForEach {
    If ($i%2){
    ("$Keep $($_)").Trim()
    }Else{
    $keep=$_
    }$i++
    Good catch!
    Boe Prox
    Blog |
    Twitter
    PoshWSUS |
    PoshPAIG | PoshChat |
    PoshEventUI
    PowerShell Deep Dives Book

  • Saving the data into the tab limited text file

    Dear Friends ,
    please help me at the earliest possible , i want to store the data into an text file which is tab limited ,previously i was able to the same into the excel sheet using the jakarta HSSF POI , an open source library to store the data into the EXCEL sheet , now friends please tell me whether is there any other open source to store the data into the tab limited text file what i mean by tablimited is the data is to be saved as
    Name        Email-id        phone          streeet          city
    sri            @some.com     9434           jahdui          hye
    asdf         @.com           3455           sdgsdf         retlike this so please suggest me
    thank you in advance,
    bye
    sriharsha

    Consult the docs for BufferedWriter and from there.
    regards
    Christian
    import java.io.*;
    public class Test
         public static void main(String[] args)
              BufferedWriter writer;
              String[][] s = { {"Name","Email-id","phone","streeet","city"},
                        {"sri","@some.com","9434","jahdui","hye"},
                        {"asdf","@.com","3455","sdgsdf","ret"}};
              try {
                   writer = new BufferedWriter(new FileWriter("out.txt"));
                   for (int j=0; j< s.length; j++) {
                        for (int i = 0; i < s[j].length; ++i) {
                             writer.write(s[j]+"\t");
                        writer.newLine();
                   writer.close();
              } catch (IOException e) {
                   e.printStackTrace();

  • Add time stamp in Final Cut?

    In Final Cut is there any way to add a time stamp, like what you get on a consumer camcorder? The customer wants the date and time to show on the final video. The time and date was not recorded when I recorded the event.

    In the mean time, to get this project done, it looks like I'm editing 60 tiny titles for my one hour video.
    I'm not expert in Motion, but if you already have it, give yourself 5-10 minutes to try and publish the Time Date generator. The basic steps are (I'm doing this from memory so the names of things might be wrong):
    1. Sart up Motion and choose a new FCPX Generator template project. Set the project settings that match your own project settings in FCPX.
    2. Drag the Time Date Generator into the project.
    3. Publish all the parameters you might want to change in FCPXby right clicking on them and selecting publish parameter.
    4. Save the project. this will ask you for a name and category, which once saved, automatically appear in FCPX.
    5. Drag that one new generator to your project, change the duration to fill your whole timeline, and set the parameters to your starting date/time.

  • Time stamp & array passed in a cluster through DLL are not accepted by Teststand

    I am trying to pass  Timestamp & array data [string array]   in a cluster  from DLL  is not  getting recognized by testsand.
    The action module (DLL)  Output (cluster)  generates   error "System Level Exception.[Error Code: -17502] "
    the png file shows the cluster
    I spoke to NI support & they  suppose that its time stamp that generates error
    but some fields (numeric, string) i am able to read
    Attachments:
    clustererror.PNG ‏41 KB

    Hello aparab,
    here is a link to another forum, which solves your issue:
    time stamp, data type for dll:
    http://forums.ni.com/t5/LabVIEW/time-stamp-data-type-for-dll/td-p/1085375
    to summarize:
    there are two possibilities to pass a cluster with a timestamp from LV to TS:
    1. use a string for the timestamp, although a numeric double might be easier to work with in TestStand
    2. use packed library

  • How to enter two different arrays into two columns of a multi column listbox

    Hi All,
    I have two different arrays of values suppose 1 array A(1,2,3,4,5) and another array B(3,4,5,6,7). I want to write these to arrays into a multicolumn listbox such that 1st column would be array A and 2nd column would be array B.
    Thnx in advance
    Solved!
    Go to Solution.

    I still couldnt understand how to do it...
    I am posting here my VI. here the 1, 2, 3, 4 are some controls. If i enter any value, the calculated Voltage and current are continously pushed in the array. Now i have display these arrays in the multi column listbox as 1st column be the voltage and second column being the current.
    Attachments:
    manual_graph.vi ‏643 KB

Maybe you are looking for

  • How to obtain current location with in a flow

    Hi, This might be very basic level query, but i cant figure it out. I want to extract the location with in a flow. ie in my proxy service i have multiple stages and with in each stage i am using some log actions to print some statements. I can see th

  • Cannot get rid of trial version on desktop, whereas it works perfectly on laptop.

    I have a problem getting rid of the "Your trial has expired." error. On my desktop, I've already ran out the trial version, when I've been on the year-long subscription to CC for about 3 months now. On my laptop, I have no problems with any sort of t

  • Use Itunes to restore

    I have followed all the steps; I connect to restore; itunes tries to restore, then itunes says it has been restored to factory settings, press ok. I press ok and it loops and tells me that I must restore. I have done this process a dozen times with n

  • Setting SpamAssassin Kill Level

    I'm having a bit of trouble getting SpamAssassin to kill junk mail. This afternoon, I edited the /etc/amavisd.conf file to reflect the settings below; however, junk mail with a score of 7.0 or higher is still being passed to the end users. Am I doing

  • Quicktime upgrade leopard

    I am having a hard time upgrading my installed QT7, to the QT pro so I can edit mpegs.  I'm using mplayer to view them now, but QT needed to be updraded in order to do this editing.  I get an error when I try to reinstall saying that QT X is already