Write measurement to file slows data presentation

I am sampling a light sensor at 1000Hz, and displaying the value using a waveform chart, and outputing to a file (using Write measurement to file), using a boolean.  Whenever i activate the write to file module, the acquistion rate slows down (i.e. I see the waveform propogate much slower). Has anyone else had this problem? Any solutions?

Hi:
     Yes. We refer to low level vis as in programming languages. As higher the level, more "luxury" we give to the user, everything is done in a few steps, in a single step if possible. Low level ones do single tasks at a time: Open file, read file size, read some bytes of data (not the entire file), close the file, etc. etc. These instructions, even more troublesome for many people, gives you more control over the process. I'm attaching 2 files, one is a vi with some of LV menu vis which perform these smaller tasks (sorry it's in LV5, but any later version of LV you have, you would be able to open them), the other file is just a picture of the screen with the menus where those vis are (sorry again it's LV5, but you must be able to locate the corresponding menus in your version of LV).
     Good Luck.
Attachments:
Saving.vi ‏30 KB
Saving.jpg ‏167 KB

Similar Messages

  • Using Write measurement to file There is a huge lag

    I have written a code where it simulates faults i.e the primary i/p the square wave would have a high duty cycle <thats not the problem>
    The problem is i have to store all the data and i'm using Write measurement to file .... but after some time there is a lag between real time and the time it has processed
    require urgent help
    Attachments:
    Air_dryer_read_8.vi ‏659 KB

    Such Kind of TimeOut to editing the first post but...
    "real time and the time it has processed"  
    That's correct.  
    The main reason of that is the Lack of Architecture in our code and overusing of Variables/Inner Loops/Bunch of Writing Files/Express VIs and one Fantastic DLL call... Everything in same Loop.
    Its an heavy computional intensive to process everything without correct using of dataflow concept (Especially in ur Case). I'm still frightened...  Anyway.
    Here some tips:
    Avoid Variables: They can lead Race Conditions in our code and made some copies of data in memory. 
    Avoid Stack Sequence Structures: Use DataFlow Concept to put everything in sequence
    Decouple Processes: Create one Loop to UI actions, one to Data Acquisition/Generation, one to Log Raw Data, one to Create Report and Perform some analysis.Create some mechanism with Queues/Notifier to inter process communication (See Queue Message Handler Architecture).
    Avoid Express VI: They are Inneficient,bad codded (Except File Dialog when there's one VI...) and put bunch of dependencies in your project. 
    Create SubVIs: Provide Modularity and code reuse.
    Stop Button needs to STOP:  Self Explanatory
    Here some links about good pratices:
    http://www.ni.com/white-paper/7117/en
    http://www.ni.com/white-paper/5560/en/
    https://decibel.ni.com/content/docs/DOC-22047
    http://lavag.org/old_files/post-705-1100237457.pdf  <--- (That's good one)
    "In theory, theory and practice are the same. In practice, they’re not."

  • Write to excel file slows down reading voltage channels

    Hi all,
    I read in input voltage data using PCI 6143 throught finite sampling. This VI is supposed to, for example, after acquiring 240 samples, I write all collected voltages to an excel file. Before I write the data into excel, I need to re-arrange the data array. This re-arranging task takes up quite a significant amount of time (about ~30ms). Hence, the 2nd batch of 240 samples collected is only done after arranging data and writing to file.
    Hence the process will be like, 0.9milli sec of data, wait 30milli sec, 0.9milli sec of data, wait 30milli sec and so on.
    So is it possible to pass this huge chunk of data to another VI, specifically doing the data manipulation and writing to file while the main VI continue collecting the voltage data without data losses?
    Does anyone have any suggestion by which mean am I able to do this?
    I saw a nice example in LV 7.1 example finder-> optimizing applications synchronizing tasks->Pass Data with Notifiers.vi
    Is this notifier method the solution to my problem or is there some other means to achieve the results?
    Thanks everybody!
    Best regards,
    Dick

    Hi Dick,
    I have some question you set the Sample Mode to Finite samples, why. If you do this you will miss samples!
    You start and stop the tasks every iteration, this will cause great wait times
    You can move the constat vi's outside the while loops.
    If you use continious samples you have to wire up the samples per channel to the ai read vi.
    If i profile the VI I see that voltage data-constants takes 3.6 ms of time (average).
    Also you should open the file outside the while loop and use the array to to spreadsheet string vi and write to text file to write the data. Successfully close the file after the while loop.
    In general opening/starting/closing/ending should not be done inside a repetative loop.
    It looks to me that 'voltage data constants.vi' generates an spreadsheet string from the data with a time column added.:
    this can be done like this:
    EDIT:Also you'r vi will 'remember' all the previous string and adds these together. If you don't want this initialize the shift register with an empty string, i missed the 'firstrun' case, but it is still better to initialize the shift register correctly, or you can connect the iteration number straight to the switch case
    Ton
    Message Edited by TonP on 09-28-2006 11:34 AM
    Message Edited by TonP on 09-28-2006 11:45 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:
    Example_BD.png ‏2 KB

  • Maxl Script will not write to error file for data laod.

    Sorry Glenn here is the new thread. I re ran without the semi colon after data 3 and the same error came up without anything being written to the error file.
    I purposely removed a member from the orginal outline that is included in the data loaded but yet the error file is not written to. I tried doing the load manually but executing it in the background, error file is to be created on my local HD but it does not write it there. Checked the output and it is written to a directory located on the server. Although i think this is normal.
    Could it be that it will not write to a local drive? I am going to try specifying a spot on the server to see if it runs there.
    thanks
    Original post below.
    Hello,
    I am also having this issue.
    I will include my script below but will state some details before
    We are on Essbase 11.1.1.3
    I am running Admin Console from my client PC that connects to the server in the script and I read that in this set up the error file will not get written to. This documentation was for v 9.1.3
    Here is my script (i changed some of the names)
    login 'user' 'password' on server';
    create application 'Money1' as 'Money2';
    spool stderr on to 'errorfile';
    import database 'Money1'.'Main' data
    from local text data_file 'Money1_Data.txt'
    using server rules_file 'Data3'
    on error append to 'dataload.err';
    execute calculation 'CALC ALL;' on 'Money1'.'Main';
    logout;
    spool off;
    exit;
    here is the error output i get:
    code line: on error append to 'dataload.err';
    Statement executed with warnings.
    (3) Syntax error near ['$']
    I don't see a dollar sign anywhere in my code and the error file does not get produced.
    Also do error files get written too if the actins are executed in the background?
    Thanks!
    Alex

    This works for me in a MaxL script run through essmsh.exe:
    import database appname.dbname data from local text data_file "d:\\datafilename.txt" using server rules_file "rulename"
         on error write to "d:\\errorfilename.err" ;Sometimes EAS (I think you are running it through that) does weird things to MaxL. I eschew MaxL in EAS as much as possible (like 100% of the time).
    NB -- the datafilename and errorfilename and their drive letters are local to wherever you're running this process through the MaxL shell. I don't know how that works when you're running EAS -- are drives local to your session, local to the EAS server? Dunno. Leave EAS behind, buy TextPad (no I am not the author of that fine product) and download the MaxL syntax library, and be happy. :)
    Regards,
    Cameron Lackpour
    Edited by: CL on Oct 7, 2010 7:12 AM
    Put the MaxL into a code block to get it to display correctly.

  • How to combine both DAQ AI signal, write and read file in single VI

    Hi
     I am the new user of LabVIEW version 7.1 for testing automation application. I have to measure 33 signals ( mostly analog like temp, pressure, etc...) from NI USB 6210 DAQ system and write in master file for future verfication.From real data or from master file back up have to write  one more file if only the signal reaches steady state , which will used for analysis and same signals to be read from this file parallely & make a waveform and/or table display format.
    Pl. help me to shortout this problem 
    note: I have plan to ugrade labVIEW version 2011 shortly, so let me know doing parrel acquistion write and read file for data analysis in same VI in version 7.1...... 

    Parallel operations in LabVIEW are very simple.  Just code it in parallel and it will work.
    Try taking a look at some of the examples in the NI Example Finder (Help > Find Examples).  There you will find example for writing to and reading from files, as well as data acquistion in parallel with other operations.
    You might need a producer/consumer architecture is you are acquiring data very quickly.
    Chris
    Certified LabVIEW Architect
    Certified TestStand Architect

  • From PLSQL - Need to write a text file

    Hello
    I need to write a text file from data retrieved from many tables in PLSQL to the UNIX box.
    Thanks
    Paul
    null

    You can use package UTL_FILE to write out to a file. Your DBA has to make initialization changes to support this. They might already have it setup. Run this query:
    SELECT value
    FROM v$parameter
    WHERE name = 'utl_file_dir';
    To see whether it has been configured properly. The value is the directory where you can create and write files.
    null

  • Configuration "use next available filename" in "write measurement file" function

    My project recording signal and saving using "Write to Measurement File" function. I want to perform record multiple segments signals should have configured option "use next available filename". For example, if the original file is data.tdms then it will save the file into: data_1.tdms, data_2.tdms, data_3.tdms, ...
    To do that I use a button control enable and disable write functionality.
    In the past I have done normally. Now, I can not make it anymore, now every write new data were add into one file created without the next new file as desired, it has almost become a option "Append to file".
    I use LabVIEW 2013
    Solved!
    Go to Solution.
    Attachments:
    write measurement file.vi ‏54 KB

    Hello ducta9,
    It looks like you currently have the Write to Measurement File Express VI configured to "save to one file" - this means that all data from a given session will be saved to the same file.  The file number will only be incremented once the application is restarted or the Reset Boolean input is set to True.  If you want to save to a series of files, select the "save to a series of files" option and configure the Express VI as needed to generate new files at intervals. 
    If you want to write variable-size chunks of data to a new file every time the user clicks the Enable button, you might be able to get away with just wiring a True constant to the Reset.  I would still recommend taking a look at the options available in the save to a series of files settings.
    Best Regards,
    Tom L.

  • Write to spreadsheet file.vi is storing data in one row only.

    The 8 points of data is going into one column in the spreadsheet. In the "Write to spreadsheet file string.vi" how do I write the 8 points to one row for each cycle?
    I got this VI from NI's web a couple of years ago and forgot how to modify this part. I usume it is within the write file.vi.
    Thank you in advance
    Skip

    I just reread your original post and the way the "Write to Spreadsheet File.vi" that ships with LV works by default is to put 1D arrays into rows. I read your post backwards and told you how to put the data in a column. Sorry.
    In any case, perhaps you need to make sure the Transpose input ISN'T true, and that the delimiter IS a tab.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • "Bad data format" when reading txt file from the presentation server

    Hello,
    I have a piece of code which reads a txt file from the presentation server to an internal table like below:
    DATA : lv_filename type string.
    lv_filename = 'C:\abap\Test.txt'. "I created a folder called abap under C:\
    CALL method CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    EXPORTING
       FILENAME              = lv_filename
    CHANGING
       DATA_TAB            = lt_tsd. " lt_tab has the exact same fields as the Test.txt's. Test.txt has only one line, tab delimited.
    When running this code, exception BAD_DATA_FORMAT is issued.
    Is it because of the file encoding or delimiter or other reason?
    Thanks,
    Yang

    Hello,
    If its tab delimited then use the has_field_seperator parameter and check
    DATA : lv_filename type string.
    lv_filename = 'C:\abap\Test.txt'. "I created a folder called abap under C:\
    CALL method CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
    EXPORTING
       FILENAME                = lv_filename
       FILETYPE                 = 'ASC'
       HAS_FIELD_SEPARATOR          = u2018Xu2019
    CHANGING
       DATA_TAB            = lt_tsd.
    Vikranth

  • Trying to write to a file that uses the current date as a portion of the path

    I would like to write to a data file that changes the path when the date changes. I am using the build path VI with the get date/time VI with the "/"'s removed from the string. I've tried using .txt in the pattern input and adding it in with the concatenate string VI. Either way I receive Error 7 File not found. Ifanyone has any thoughts on hoew to accomplish this I'd appreciate it. Thanks

    You have to check if the VI that create the file is setted to "create" or to "append" caracters on the file. I receive this error message when i am trying to use the "Write caracters to file.vi" and it was setted to append. You should use an converter to change the name of the file from String to Path. And you have to use a loop structure to check the date and append caracters on the file everytime is needed.
    Regards,
    Carlos

  • Data format problem with Write to Spreedsheet File

    I have a problem with the data format with Write to spredsheet file.
    I have an N*3 array, where the 3 elements in each row should has different length. When I used Write to spreedsheet file,
    it can only save the three data in one format. How can I save them in the format of "%0.8f %0.3f %0.2f"?
    Thanks for your help.

    Hi powerplay,
    another solution may be to convert column-wise using "number to fractional string", then interleaving resulting arrays and again using "array to spreadsheet string" (with "space" as separator).
    Many ways lead to Rome
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • Eventhough data present in the D Drive (Database files), E Drive (.Pag) files, we can see data is coming as zero in Excel retrival.

    Eventhough data present in the D Drive (Database files), E Drive (.Pag) files, we can see data is coming as zero in Excel retrival. Can anyone help me to figureout this issue.
    Thanks,
    SRI

    Hi
    Verify the below details:
    1. Whether your app/db started successfully.
    2. Check the database properties :
    Storage tab - .ind and .pag  exits.
    Statistics tab -  whether any number exists in "number of existing blocks" and "existing level 0 blocks"
    3. If all the above properties in esbase are fine then check your excel add-ins options settings while retrieval.
    Thanks

  • Write to XML File crashes when multiple Timed Loops present

    Hello All,
    It took me forever to track this bug down.
    In this project we can edit operating parameters on the Host and send them down to an RT program in a cRIO-9025. The data is converted to XML and stored on the cRIO's disk.
    Occasionally, the RT program would lock up and had to be rebooted.
    It turns out that if you use Timed Loops , then a Write to XML File (or presumably any file write) will not return.
    Attached is an example. This has 5 loops to make it crash faster, but it will eventually crash with only 2.
    Paul J
    Attachments:
    XML Write test.vi ‏93 KB

    Hello Chris,
    I know that Write to XML File fails because I put in debug code in my actual program, a flat sequence which updated an indicator, and after the crash, the indicator had not updated.
    Yes, I know that it replaces the file. It's a configuration file, not data gathering. This is just an example of the bug.
    FYI,
    I increased the period for the loop with the file save to 500msecs and it still crashed.
    I then decreased it to 50 msecs, and replaced all of the other Timed loops with While loops and it does not crash, even though the file save takes much longer than 50 msecs, average ~150msecs.
    I replaced the loop with the file save with a While loop while leaving the others as Timed loops and it does not crash.
    So the bug is systemic and related to a file save in a Timed Loop when there are other Timed Loops.
    I'm not looking for a solution, I'm only reporting a bug in Labview. The solution is not to use Timed Loops, especially, as you point out, when there is file saving. It cost me several days of dicking around to figure it out. Maybe someone can save some time if they find this.
    Paul J

  • How to write control file below data

    Hi,
    Here is my table
    create table sample1 (name varchar2(5), num number(2));
    sample.txt(Datafile)
    vikram12
    sharma13
    sonu 14
    Here is my control file
    load data
    infile 'C:\sample.txt'
    into table sample1
    fields terminated by "," optionally enclosed by '"'          
    ( name char(5), num char(2) )
    But it rejecting all the records. Just let me know where i went wrong.
    Thanks in advance

    fields terminated by "," optionally enclosed by
    '"'          As per your control file, the fields have to be seperated by commas but in your datafile it is seperated by space. Either change the delimiter in your control file or in your datafile
    Using Comma Seperated file,
    sample.txt(Datafile)
    vikram,12
    sharma,13
    sonu, 14
    load data
    infile 'C:\sample.txt'
    into table sample1
    fields terminated by ","
    optionally enclosed by '"'
    ( name char(5),
    num char(2)
    )Note:
    1. You have to increase the length of name column as your datafile has values greater than 5 characters. First and second records will be rejected with NAME VARCHAR2(5)

  • How can i write a XML file with oracle data ?

    How can i write a XML file using PL/SQL.
    Can i do as follows.
    1.Open a file using UTL_FILE.FOPEN(LC_DIR_LOC,'abc.xml','W')     ;
    2.write all the required tag and value using UTL.put_line
    that is enough. Is not, please guide me to write.
    gk

    Having Oracle 9i.
    One more doubt. In the speck, some constand values are there, When i write the same into file, How can i write ?.
    1. l_str := ' "E27" '
    or
    2. l_str := ' E27 '
    UTL_FILE.PUT_LINE(L_FILE_POI,l_str,TRUE);          
    1 case : in XML file : "E27"
    In 2 case : E27
    When we write a XML file through editors , we have to define the constant within quote . is it?      
    Which one can i use ? Or any other way is there ..
    Thanks and Regards
    gopi

Maybe you are looking for

  • J2ME game timer

    Hi, I am developing a J2ME game. At the moment i have code which will terminate the game if the game is reaches the time set. Now i want to be able to display the count down on the actual game. I want to display it anywhere on the screen but im not s

  • T60 hard disc problem

    Dear Lenovo, My T60 about four days ago has been ruined by a virus (spyware?) from xxxxxx.com, and since then I can not acces the hard disc. I can't boot the laptop and I have been used tools software such as chkdsk but still not working. Please tell

  • How to use CDHDR and CDPOS tables

    Hello Gurus, How can the data be extracted from CDHDR and CDPOS tables ? For example, I want to find the changes for the material master, what is the object need to be given in the OBJECT value etc.. I tried to use restricting the transaction MM02 an

  • Folder image

    hi, when trying to replace the boring folder icon with a .jpeg image, sometimes you get the image, but most of the time you get the file name displayed any ideas how i can get round this ? thanks

  • How to wrap the text in JTextPane

    hi all, I have a problem with JTextPane. I have a JPanel which have 4 JButtons, one Details button and one JTextPane. I have set JTextPane to JScrollPane. Thing is when i press the Details button the JTextPane must be visible. Window size is changing