Writing time and voltage to a file

I am using labview 7 Express with Windows XP. I have a PCI-MIO-16XE-10 DAQ card. I want my program to update 5 times a second. It is doing this with a while loop. However, I only want to write the date to a file once every 10 seconds. I want to write the time, and two voltage values to the file. Now it writes the voltages to a file every time it updates, and only the voltages,not the time. I am using the write to spreadsheet file.vi. I was unable to attach the labview file to this question, hope I can still get some help. Thanks.

If you're using the Write to Spreadsheet File VI, then you're closing the file after each write -- then it should be easy.
To time when the time should be written, you can either count the number of times your loop has run, divide that by 50 using the Quotient and Remainder VI (5 times a second times 10 seconds), and take the Remainder and any time it is 0, write the time...
Or you can check the current time every loop, and when the difference from when the last time the time was written is greater than 10 seconds, write the time again...
Anyway, get the current time string, concatenate a tab after it, and wire that to the Write Characters to File VI, using the same filename that your Write to Spreadsheet VI is using. This will put the current
time into your spreadsheet file and add a tab, so that your spreadsheet file is still in the right format. (The "spreadsheet" file is just a tab-delimited text file, where the text is your data.)
Mark

Similar Messages

  • How can I do to acquire and save date in the same time and in the same file when I run continual my VI without interrupti​on.

    I've attached a VI that I am using to acquire amplitude from Spectrum analyzerse. I tried to connect amplitude ouput to the VI Write Characters To File.vi and Write to Spreadsheet File.vi. Unfortunately when I run continual this VI without interruption, labview ask me many time to enter a new file name to save a new value.
    So, How can I do to aquire and save date in the same time and in the same file when I run continual my VI for example during 10 min.
    Thank you in advance.
    Regards,
    Attachments:
    HP8563E_Query_Amplitude.vi ‏37 KB

    Hi,
    Your VI does work perfectly. Unfortunately this not what I want to do. I've made error in my last comment. I am so sorry for this.
    So I explain to you again what I want to do exactly. I want to acquire amplitude along road by my vehicle. I want to use wheel signal coming from vehicle to measure distance along road. Then I acquire 1 amplitude each 60 inches from spectrum analyzer.
    I acquire from PC parallel port a coded wheel signal coming from vehicle (each period of the signal corresponds to 12 Inches). Figure attached shows the numeric signal coming from vehicle, and the corresponding values “120” and “88” that I can read from In Port vi.
    So I want to acquire 1 time amplitude from spectrum analyser each 5
    period of the signal that I am acquiring from parallel port.
    So fist I have to find how can I count the number of period from reading the values “120” and “88” that I am acquiring from In Port (I don’t know the way to count a number of period from reading values “120” and “88”).
    Here is a new algorithm.
    1) i=0 (counter: number of period)
    2) I read value from In Port
    3) If I acquire a period
    i= i+1 (another period)
    4) If i is multiple of 5 (If I read 5 period)
    acquire 1 time amplitude and write to the same
    file this amplitude and the corresponding distance
    Distance = 12*i). Remember each period of signal
    Corresponds to 12 Inches).i has to take these
    values: 5,10,15,20,25,35,40,45,50,55,60............
    5) Back to 2 if not stop.
    Thank you very much for helping me.
    Regards,
    Attachments:
    Acquire_Amplitude_00.vi ‏59 KB
    Figure_Algorithm.doc ‏26 KB

  • Sending time and voltage samples as input to matlab script block

    Hello,
    I am planning to use Matlab script in labview and the matlab scritp block needs inputs of time and voltage values of sampled signal to post process.
    Can someone explain me of how to send the sampled values of time and volatge after every  'x' interval of time to the matlab scritp block I mean if the sampling rate is 100Hz then 100samples will be collected in 1 sec but I want to send both time and votlage values collected after every 10 seconds to the matlab scritp block.
    Thanks.

    Hi,
    I am using DAQUnit 6016 that samples an analog signal of sensor.The vi I tried is attached below.
    Attachments:
    Labview&Matlab.vi ‏55 KB

  • Write time stamp and Voltage to text file

    I am a novice 2011 LabVIEW user and am trying to build a program that will write TIME in one column and VOLTAGE in another to a text file for later interpretation with MATLAB. I started to add elements to an existing code, which I downloaded from the examples forum, because it works well for my purposes of sending a finite square signal. The code that I started modifying is attached to this thread. If somebody wants to take the time to provide me with an example of how I can do this with my existing code, it would be greatly appreciated. I learn better from example.
    Regards,
    Sean. 
    Attachments:
    Voltage - Generate and Write.vi ‏99 KB

    This is a pretty simple set of code that every 5 seconds writes to a csv file that is stored in the location shown in the code. In order to apply something similar to your code simply run the data that you wish to store into the concatenate strings in the form of a string and it should be fine. 
    Although after looking over your code a second time you should probably take a look at the convert "Array to Spreadsheet string" function, all you would have to feed it is an array of times and measurements at the completion of your program and feed it into a file and it should do everything for you.
    Attachments:
    Write to File.vi ‏20 KB

  • Write x y position and voltage to same file

    Hi,
    I've been writing a program to perform a 2D scan with stepper motors.  There are actually 3 in the program but only 2 perform the scan.  I have used a subvi to take 10 voltage measurements at each position in the scan.  What I'd like to do is record the X and Y position for each set of 10 voltage measurements.  I'm fairly sure I can record the position with the 'GetPosition' function for the motors, but am a little lost on how to get them to write to the same file, and whether or not those positions would correspond to the voltages taken there.  I have included my vi and the subvi used for reference.  If anyone has any suggestions on this problem I'd greatly appreciate it.
    Cheers
    RJ
    Attachments:
    xyz scan 015.vi ‏116 KB
    Keithley 2000 Read Multiple.vi ‏44 KB

    rjwilliams wrote:
    ... I'm fairly sure I can record the position with the 'GetPosition' function for the motors, but am a little lost
    on how to get them to write to the same file, and whether or not those positions would correspond to the
    voltages taken there.
    Well, this is a bit too diffuse. You seem to be writing to a file, but the code is nearly incomprehesible from a dataflow point of view.
    If you are not sure if the file contais the correct values, just run the program, proble the wires, and look at the file later. You should be
    able to tell if the are correct or not. Why should they be different? What values do you expect? What values do you get?
    I agree with Ray that you NEED to cleaup the code in order to troubleshoot. Your code is just a bewildering jumble of code fragments,
    trapped deep inside stacks of while loops and event structures, all tied together with confusing logic.  All you need is a simple state
    machine with one while loop containing one event structure.
    Message Edited by altenbach on 07-07-2008 07:48 AM
    LabVIEW Champion . Do more with less code and in less time .

  • How do i add time and date to target file

    hello,
    1. When do we generally go for FCC?
    2. Is it possible to assign field seperator without FCC on the reciever side file adapter?
    3. how do I add timestamp as well as DATE to the target file?
    thnks
    venkat

    Hi venkat
    1. When do we generally go for FCC?
        we can do the FCC at sender side as well as at the receiver side.
        Sender side: we do the FCC at the sender side only if we are getting a flat file   from the sender, and so that it can be understand by the XI,because XI can understand only the XML.
         Receiver side:we do the FCC at the receiver side only if the receiver requires the flat file.
    2. Is it possible to assign field seperator without FCC on the reciever side file adapter?
    no, it is not possible.
    3. how do I add timestamp as well as DATE to the target file?
    if you want to add date and time in the target file for this you have to select the parameter
      File Construction Mode* : AddTimeStamp
    in the processing parameters of the file adapter(Receiver).
    Thanks
    Rinku

  • Memory timming and voltage

    okay i have 2 512 sticks of golden dragon ddr 3200
    what do you guys recommend for the voltage and timming it is currenlty 2.60 and all eles is auto i dont quite understand timming very well yet so speaking in lamens turms would be much appreicated.
    oh and if any one was wondering im still have problems with crashing w/ the high pitch squeal replace power supplie twice now.

    The voltage you mention (2.60V) should be fine.  If for whatever reason you find that the RAM is making the system unstable, you can try increasing it to 2.65V or (at most) 2.70V.  If you want to specify the other timings, you'll have to disable the "Auto" setting (doing so should bring up a number of new configuration options).  In the new fields that show up, there should be one called either "CAS Latency" or "Column Address Strobe", and you'll want to set that to 2.5 to start out with.  There should be three other fields where you can specify numberic values.  For two of them, the lowest possible value will be '2'.  Enter '3' for both of these fields, and then in the remaining one, enter a '6'.  If you find that your system is stable at these settings (and it should be, it's what your RAM is rated for), you can come back and try specifying lower numbers to see if you can get any extra performance (though in my experience, there doesn't seem to be any measurable performance difference in going from CAS2-2-2-5 to CAS2.5-3-3-6.  Note that if you're overclocking, you will likely need to enter higher values here in order to keep things stable.
    As far as crashing with the high-pitched noise goes, do you have a second HDD you can try in the system?  If so, take your current one(s) out and install the new one and run the system for awhile and see if the problem goes away...my guess is that it might be your HDD letting you know that it's about to fail.

  • Writing to and Opening a Text File from an Apex Application

    Hi there
    I would like to open a text document from apex.
    I have a screen with various parameters. Based on what the user selects, the result must open a text document with the parameters and other text.
    Does anyone know a good way to do this?
    Thanks
    Norah

    Hi there
    I would like to open a text document from apex.
    I have a screen with various parameters. Based on
    what the user selects, the result must open a text
    document with the parameters and other text.
    Does anyone know a good way to do this?
    Thanks
    NorahUnless you start a Java widget, I do not believe you can modify a file on the local users machine through the browser. Now if the file is on the server you are running from, this can be done.
    Thank you,
    Tony Miller
    UTMB/EHN

  • Identify modified date/time and name of SOURCE file

    I can't seem to find a way to store/retrieve the last-modified date/time of the SOURCE file (as well as filename) used to create a PDF. I looked into the default metadata, but it seems to store only the last-modified date of the PDF.

    I'm sorry, maybe I'm a little slow, but I would need more detailed specs on how to solve the problem. Is this something you have implemented yourself? If so, how?

  • How can I take the photo by capture the photo, plot the graph(control chart) in the same times and export to Excel File

    I want to do my sample of the project  following these steps.

     1. Create the template for compare other objects.
     2. Save the template and ready for compare realtime with other objects  
    II 
    1. Use the CCTV video camera Sony capture the picture of the object (lego toys).
    2. Calculate the size of the objects and change to mm.
    3. Compare with the template and plot graph(Control chart) by length
    4.  Export the data to Excel Files
    Solved!
    Go to Solution.

    Nice project !
    I sincerely hope you are not expecting us to do your homework.
    What is your experience with LabVIEW ? 
    May be you should try to start to code something and then come back later with some more specific question ?
    Message Edité par chilly charly le 01-02-2009 08:40 AM
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • Time stamp data write to file problem

    Hello!
    I'm just learning LabView, and have arrived at the stage of writing time-stamped data to text files.
    This seems clear enough, however when I examine the file written to disk, I find 4 unexpected characters: 3 spaces and one seemingly random number or punctuation mark, preceding every line!
    An example is:
       .2005-07-15 10:55:40.0 the value is 0.0000 cm
       .2005-07-15 10:55:40.5 the value is 1.0000 cm
    The four characters "   ." are those whose origin I can't understand. I can't seem to get rid of them.
    They seem to change with the input string, but not in a manner I can predict or understand.
    Any hints or explanations would be greatly appreciated, as I'm at wit's end after 1/2 day of puzzling over this little problem!
    Alex
    Attachments:
    time stamp data write VIs.zip ‏24 KB

    Alex,
    You found one of the subtle little things that can be frustrating to old-timers and newcomers alike. I did not recognize it until I read the help file (and I have been using LV since version 1.2).
    First, the three characters before the commas are nulls (\00).
    The reason they are there is in the help file for the Write File.vi. By wiring an array to the data input, you caused the VI to write a header telling what data format was used.
    I modified your VI to simply concatenate the strings and then write a simple string to the file. I think this may be what you were after.
    Lynn
    Attachments:
    write timestamp text line to file v3.vi ‏47 KB

  • Quick time error 2048 - cant open file

    I just downloaded quick time and cant open some files. They are designed for quick time but when I try and open them I get the 2048 error message. I have deleted and re-installed the quck time and am still getting the message.
    Any ideas ?

    Error -2048 implies MPEG-2 file format which QuickTime Player doesn't play without additional software:
    http://www.apple.com/quicktime/mpeg2/

  • When downloading iTunes, I got a message about error writing to file and it told the file. Then it said to verify that you have access to that directory. I have no idea how to fix it. I could really use some help, please.

    I was trying to download iTunes on my computer, and while doing so, I got this message: Error writing to file: C:/Program Files (x86)/Common Files/Apple/Apple Application Support/Apple Versions.dll. Verify that you have access to that directory. I have downloaded iTunes numerous times and I have never had this problem. If anyone knows what's going on, I would really appreciate the help.

    Well, there's definitely a mac and a Windows version. And you're at the right page. I think the problem is that someone forgot (or decided not to) to update the text at teh bottom of the page to have Mac and Windows.
    Just push the button, you'll get the Mac update no problem.
    Regards,
    Bentley Wolfe
    Senior Support Engineer, Flash/Flash Player/Digital Editions
    Adobe

  • Writing time to a file along with data

    Hello,
    I have a vi which I'm using to collect voltages.  From the data collector vi, all 8 channels are output as an array of waveforms which I then split off.  I'm splitting the channels so that I can convert the readings from volts to engineering units (inches, lbs, etc), then merging the signals back as shown in the attached jpg.  My problem is I need to have a time column on the left but I cannot figure out how to do this.  I've tried many different methods, yet as I'm still a novice, I'm sure there is something I have not tried.  I need to be able to get times in milliseconds (relative to the beginning of recording) and possibly 0.000 1 second intervals.
    Thank you in advance,
    Robbie
    Attachments:
    HSS.jpg ‏15 KB

    The time column in the LVM file is more of a convenience to spreadsheet users than anything else.  You can recreate it from the t0,dt of the waveforms the LVM read returns.  You can either use a FOR loop with the t0, dt as inputs or the ramp generation VI.  Add the result to the beginning of the array of waveforms the LVM read returns, and then save.
    If you want to be more efficient and not kill your RAM as bad, try the following method using the LVM data directly;
    Open your new file and write your header
    Open the LVM file as a normal file
    Read the LVM file and toss the data until you get to the end of the header "***End_of_Header***".
    Copy the data from the LVM file to your file directly
    The specification for the LVM file can be found here, if you want to dive into it a bit deeper.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • I want to use my Time Capsule as a central 'hub/hard-drive' in order to keep all my working files in one place. I then plan to use my laptops/desktops as peripheral devices for editing and creation of these files. Is it possible? Create a personal cloud?

    I want to use my Time Capsule as a central 'hub/hard-drive' in order to keep all my working files in one place. I then plan to use my laptops/desktops as peripheral devices for editing and creation of these files. Is it possible? To create a personal cloud?
    Can someone advise as to whether i can do the following:
                                Future Internet connection -------------------TIME CAPSULE (containing all files) -------------- Backed up on the WD 2T Hard-drive I have
                                      (not connected yet)                                         I                                                          (*connected to timecapsule physically)
                                                                                                            I
                    I                                         I                                                I                                                              I                                                I
          Macbook Pro                             iMac                                       HP (PC)                                             OLD Macbook Pro                         iPhone
    (used for remote working)       (Used for home working)     (used for heavy CAD and rendering)    (not being used for anything at the moment)        (& iPods)
    I am looking to have all my files in one place as i am hopelessly disorganised. I know the online clouds are a good solution (used Dropbox at work and uni for 3 years) however i am wanting to create my own 'dropbox/icloud' at home. So whenever i get back home with my laptop, any work i have been working on whilst out that day is updated to the timecapsule, and then ultimately as i turn on the other devices, they update to those newer versions of the files. Please tell me that the 3TB time capsule i have can do this, otherwise it feels rather overpriced as a wireless storage device?
    Another note (to those in the know) If i am to be working on large files (REVIT/SOLIDWORKS/KEYSHOT/CREO/AUTOCAD) - is the timecapsule connection good enough to support editing and updating these files?
    I know i may be asking a question that many have before, but as a bit of a technical novice I wanted a clear-cut answer to my specific circumstances. Your help is greatly appreciated.
    (*can i use this WD hard-drive that is connected to the Time Capsule as a back up? so that the time machine back-ups/any back ups are also backed up onto this one? can the WD be a backup for the TC?)
    Kind Regards
    Joe

    The diagram was supposed to look more like this......
    Internet ---------TIME CAPSULE(containing all files) --------WD 2T Harddrive
                                                I
         I                           I                          I                            I                                   I
    Macbook Pro         iMac                 HP (PC)            OLD Macbook Pro           iPhone
    Sorry!
    Regards
    Joe

Maybe you are looking for

  • No free Memory available in Class PERM

    Hi    when the user is incresed, Am getting error msg on Dev_W0. "Memory allocation failed" But my production not affected. If any one faced this kind of problem kindly share with me to avoid this issue. Thanks Jibin.

  • DVD Player crashes after drive change

    Hi everyone, For the last 6 months or so, I've had my ThinkPad T23's Combo drive installed in my Pismo. It's a Matshita UJDA720 DVD/CD-RW that came with the ThinkPad originally, but has recently failed. I took the drive out and reinstalled the Pismo'

  • BC4J (9.0.3.10.62) on IAS (10.1.2.0.2) is this compatible?

    hi we have an application that runs with the BC4J components (9.0.3.10.62) on an IAS9 without problems but if we try to migrate this app to an IAS10 (10.1.2.0.2) the application goes in an infinite loop while trying to connect to a database and ends

  • How to Find Cost Centre

    I find out Profit centre from Material Master By entering T.code mm03. But how I have to find out cost centre. I can not find out cost centre directly, but by entering the transaction code OBK9 it could be find out manually / or checking individual c

  • How do you save an image from Adobe Flash Scene7 (without printscreen)?

    Here is an example of what I am looking to do. I want to figure out how to locate and save the original (LARGE) image shown here in the zoom box. http://walmart.scene7.com/walmart/flash_zoom.jsp?company=WalMart&sku=15571806&config=WalMa rt/zoom_confi