Time with 'Write to measurement file'
Hello,
I am making an acquisition waveform. The integration time is 1s divided in 128 samples. When I execute the software, the datas are stored in a text file with 'Write to measurement file'. This text file is a continuous list of 128 numbers-packs in rows.
I want to add the time column (date+hour+minutes+secondes+1/10sec+1/100sec) in front of each number acquired. (And not only in front of the first number of the 128 package)
I have don t know how to add this.
Can you help me?
Thanks a lot.
(See file attached)
Attachments:
test3.vi 148 KB
Also, in the setup dialog for the Write Measurement File, there's an option to include an "X Column Value" that normally holds a timestamp.
Enable one of these options and any included timestamp in your waveform will go into this column. If you don't have a waveform, you can build an extra column in your array of data points with the needed timestamp and it will work the same.
Ed
Message Edited by Ed Dickens on 02-20-2007 03:37 PM
Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Attachments:
WLVMF Time Column.gif 9 KB
Similar Messages
-
I'm using the Express Write to LabVIEW Measurement File in LV7.1.
I have it set to "Save to one file" and have tried both "Overwrite file" and "Using next available file name" for the "If a file already exists" conditions.
The path/filename is passed into the function.
It works fine the first time around. If the file is deleted before the function is called again, an error occurs since LV is unable to find the file.
I have had to stop and re-run my program in order to write to use the function again.
Since I am able to delete the file I assume it was closed but it seems like LV expects it to be there, even though the function was supposed to create/open/close the file... Is there any way to reset this without stopping/restarting the program?
Since my application creates several files (only one using the Express VI) I am checking for the filenames and requiring that they be deleted (or a new filename be used) before acquiring data. Everything has worked great, except for the Express VI.
Thank you,
DavidOk, I've edited the VI you posted to reproduce my error (this time with 8.0).
I added a "master stop" and "start log" button. To demonstrate my problem:
1. Run the VI
2. Click "START LOGGING" - c:\test.txt is created
3. Click "STOP" - c:\test.txt is closed
4. Delete the file c:\test.txt with Windows shell or explorer
5. Click "START LGGING" - a new c:\test.txt file should be created but instead an error is raised in the Write LabVIEW Measurement File function.
Any ideas?
Thanks,
Dave
Attachments:
Write LV Meas File 2.vi 96 KB -
Hi am trying to save Data into a write to measurement file vi using a NI PXI 1042Q and DAQ NI PXI-6229 with a real time mode but it is not working but when i run it without uploading it into the PXI it save in to the file please find attached my vi
Attachments:
PWMs.vi 130 KBother problem is that the channel DAQmx only works at real time mode not on stand alone vi using Labview 8.2 and Real time 8.2
-
Help with saving time stamps to "write to measurement file" excel format.
I am having problems saving the timestamps from my data to the write to measurement express vi for excel. My incoming data is converted from dynamic data to a 1d array for processing, which I understand you lose the time stamp data. I added a new array for time stamps but this array then cannot be converted back to the dynamic data that is requested to go into the write to measurement file express vi. I would prefer to leave the data in an array to be saved rather than converting it to a waveform so is there any way to add the time stamps from my 1d array back into the write to measurement file?
I set it up to build a waveform now but I am still having issues with it saving the correct timestamp. The time just incriments for every second (as it did before converting the dynamic data to the waveform). I attached a screenshot.
Attachments:
waveform.png 36 KB -
Formatting the time stamp in "Write LabVIEW Measurement File"
When I use the "Write LabVIEW Measurement File" vi to write data
the files first column contains the number of seconds since the staart of the file
How can I get the computer date and time or at least the time HH:MMS???
Tom
PS, And how can I put some sensible label on each columns in the file?Tom,
The vi I'm attaching demonstrates how to use the computer system time for the timestamp on your LVM file. It takes a reading from the DAQ Assistant and applies a system time stamp. It's in version 7.1, but let me know if you need it in version 7.0.
As for inserting meaningful column headers, you won't be able to do that with the express vi, but you could use the regular file i/o vis to create a file like that is similar to a LVM file, but is a little more customizeable and can be formatted however you like. The express vi is meant to be a quick solution, but does not offer all the versatility of the vis on the palette. I hope this helps you out. Have a good one, Tom!
Tyler S
Attachments:
LVM_timestamp_7_1[1].vi 265 KB -
Include time stamp in Write to Measurement file
Dear Experts,
I would like to include the time stamp in the data sheet I saved using a Write to Measurement file. Currently only 1 column of data was saved without the time stamp. Is there anyway I can save the data together with its time stamp in a single file (side by side column)?
Thank you.
Regards,
CYTeohDid you configure the Express VI to create a time channel:
Christian -
Write to Measurement File time column wrong starting value
I am using Write tp Measurement File express VI. I select to write one time column. The values writtent in the time column start from a value that does not seem to correspond to anything in the program -- sometimes as much as 2-3 days before the saving begins.
Can I force the starting value of time to something, or get it to write the time since we started saving, or something predictable?Include code whenever available. Asking somebody to troubleshoot your software without any code is like asking your mechanic to fix your car without taking your car to him.
Source
I don't recommend using the Write Express VI. I recommend using the File I/O primatives because they allow for much more control over what gets written and how. Still I would expect the Express VI to be able to write time properly so I'd assume there is some kind of bug with the data being given to the function. Post some code so we can see what is going on.
Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously. -
"Write to measurement file" in labview doesnt show time instants of the waveform
Hi
I am trying to write my data into a file. I am using the "write to measurement file" for this purpose. But, the file shows only the magnitudes of the input waveform and not the time instants.
Can someone help me with this.
Thanks
Vijay Chand GantiHi
Thanks for ur reply. I tried using the "unbundle by name", but thats only helpful for a cluster of elements.What i need is to
get the time instants of an analog signal (to verify its sampling rate).
I am using the example under NI example finder-->Analog Input R series.
Mine is an FPGA application and so im using the R series. I am anyways attatching the VI which i modified for my use.
Attachments:
Analog Input (Host)2.vi 375 KB -
Samples number is not properly set with VI Express Write To Measurement File
Hello,
I have a strange problem with the VI Express Write To Measurement File.
When I generate the .lvm file the samples number for each channel is equal to 1
instead of 34 !
So when I use the VI Express / Input / Generate an arbitrary signal and I want to import
the generated signal... only one point (the first one) is imported...
I can manualy fix it by changing samples number in the lvm file using a text editor but that's a (very) dirty hack !
Here is an example of the generated LVM file
LabVIEW Measurement
Writer_Version 0.92
Reader_Version 1
Separator Tab
Multi_Headings No
X_Columns One
Time_Pref Absolute
Operator scls
Date 2008/04/12
Time 10:35:58,322057
***End_of_Header***
Channels 2
Samples 1 1
Date 2008/04/12 2008/04/12
Time 10:35:58,323057 10:35:58,323057
X_Dimension Time Time
X0 0.0000000000000000E+0 0.0000000000000000E+0
Delta_X 1.000000 1.000000
***End_of_Header***
X_Value Untitled Untitled 1 Comment
0.000000 0.000000 20.000000
0.082000 10.000000 20.000000
0.182000 10.000000 25.000000
0.282000 20.000000 25.000000
0.382000 20.000000 30.000000
0.482000 30.000000 30.000000
0.582000 30.000000 35.000000
0.682000 40.000000 35.000000
0.782000 40.000000 40.000000
0.882000 50.000000 40.000000
0.982000 50.000000 45.000000
1.082000 60.000000 45.000000
1.182000 60.000000 50.000000
1.282000 70.000000 50.000000
1.382000 70.000000 55.000000
1.482000 80.000000 55.000000
1.582000 80.000000 60.000000
1.682000 90.000000 60.000000
1.782000 90.000000 65.000000
1.882000 100.000000 65.000000
1.982000 100.000000 70.000000
2.082000 110.000000 70.000000
2.182000 110.000000 75.000000
2.282000 120.000000 75.000000
2.382000 120.000000 80.000000
2.482000 130.000000 80.000000
2.582000 130.000000 85.000000
2.682000 140.000000 85.000000
2.782000 140.000000 90.000000
2.882000 150.000000 90.000000
2.982000 150.000000 95.000000
3.082000 160.000000 95.000000
3.182000 160.000000 100.000000
3.282000 170.000000 100.000000
PS : I also post my problem at
http://forums.lavag.org/Strange-behaviour-of-VI-Express-Write-LVM-t10570.html&gopid=44101#entry44101
Attachments:
generate_step_lvm.vi 119 KBIf I use the "one header per segment" option I get the following LVM file (see below)
But the problem is same !
I can't import this file in VI Express / Input / Generate Abitrary Signal (I only get one row... the first one)
I see three solutions :
- VI Express Write LVM has a bug ?
- I don't know how to use this VI Express correctly !
- VI Express / Input / Generate Abitrary Signal has a bug ?
LabVIEW Measurement
Writer_Version 0.92
Reader_Version 1
Separator Tab
Multi_Headings Yes
X_Columns One
Time_Pref Absolute
Operator scls
Date 2008/04/12
Time 16:38:37,578
***End_of_Header***
Channels 2
Samples 1 1
Date 2008/04/12 2008/04/12
Time 16:38:37,592999 16:38:37,592999
X_Dimension Time Time
X0 0.0000000000000000E+0 0.0000000000000000E+0
Delta_X 1.000000 1.000000
***End_of_Header***
X_Value Untitled Untitled 1 Comment
0.000000 0.000000 20.000000
Channels 2
Samples 1 1
Date 2008/04/12 2008/04/12
Time 16:38:37,717 16:38:37,717
X_Dimension Time Time
X0 1.3899993896484375E-1 1.3899993896484375E-1
Delta_X 1.000000 1.000000
***End_of_Header***
X_Value Untitled Untitled 1 Comment
0.139000 10.000000 20.000000
Channels 2
Samples 1 1
Date 2008/04/12 2008/04/12
Time 16:38:37,739999 16:38:37,739999
X_Dimension Time Time
X0 1.6199970245361328E-1 1.6199970245361328E-1
Delta_X 1.000000 1.000000
***End_of_Header***
X_Value Untitled Untitled 1 Comment
0.162000 10.000000 25.000000
and so one ... -
Time format in 'Write To Measurement File' express vi
Hi,
I'm using the 'Write To Measurement File' express vi to save data acquired using a PCI-6221 board and the DAQmx vi s. The acquisition is continuous.
When I set the 'number of samples per channel' property of the DAQmx Read.vi to -1 (ie, read all available samples), the time is saved in relative format. When I set any other value (ie a certain quantity of samples), the time is saved in absolute format.
Do you know why the vi does this, and if there's any way of controlling the time format ?
Thanks,
ps : I use Labview 8.0Hi Scalpas,
I look into what I believe you are doing , but I didn't see the same results. Can you explain what datatype you are transferring to the Write to Measurement file VI? Or provide a sample of code that demonstrates the issue.
I think it might have to do with the DataType conversions when writing that file.
Sappster -
Write to measurement file - Create or replace with confirmation
I'm using the "Write to measurement file.vi" and I want it to ask for confirmation if I try to save with a filename that already exists and then allow me to choose another file name or overwrite the old one. How can I do this?
Solved!
Go to Solution.smercurio_fc wrote:
Ben wrote:
smercurio_fc wrote:
That Express VI does not have the capability you are seeking. ...
Help us Obe Wan, you're our only hope.
Ben
Did I misunderstand the question again?
No.
Spoiler (Highlight to read)
Your wording reminded me of the scene from Star Wars when Ben Kanobe di dthe force thing on the strorm troopers telling them "These are not the droid you seek."
Your wording reminded me of the scene from Star Wars when Ben Kanobe di dthe force thing on the strorm troopers telling them "These are not the droid you seek."
Its just Friday.
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction -
Write to Measurement File: Time has minutes and seconds. Where are the hours?
Hi,
I have dynamic data acquired by Express VI: DAQ Assistant from a CompactDAQ and wired to Express VI: Write to Measurement File. In the resulting text file in the header the Date is recorded correctly in DD/MM/YYYY format. The Time field should be formatted HH:MMS.XXX but all I see is MMS.XXX. Is there a setting I should change to see the hours?
Regards,
Andrew.Found the answer, sorry. Excel formatting issue. Not LabView after all.
Please delete this thread.
Cheers,
Andrew. -
The .lvm file generated by the Write to Measurement File Express VI includes column heading titles for the y values, but they are a default value of "untitled". See attached example of a sample file when opened in Excel, the values in question are highlighted. Is there a way to specify the column titles when the file is written?
This is a similar question to this posting, which received a work around response to use the Write to Spreadsheet File.vi, rather than a solution when using this VI.
Message Edited by Hightop Raven on 05-02-2007 03:37 PM
Attachments:
column_titles.gif 13 KBSorry for the late reply. I was out of the office Friday.
You can do it, but the code can get rather ugly. Under the hood, the dynamic data type (the dark blue wire) is an array of waveforms. In your case, the scalar values you convert to a dynamic data type are being converted to an array of waveforms, each waveform having one element. You have two options.
Explicitly convert your scalars to one-element waveforms (t0=0, dt=1) and add the title before conversion to a dynamic data type.
Convert your dynamic data type to an array of waveforms and loop through them to add the column labels. The conversion blocks are in the Signal Manipulation Express palette.
I would recommend 2, since it is the easiest to add. It is also the easiest to run only on the first iteration. Just put a case selector around the loop, wire the selection to the While loop iterator, and set the case containing the label code to 0. The default case simply passes through the dynamic data.
My apologies for not including a screen shot. I am in the process of upgrading my machine and can't run LabVIEW. If you need one, let me know and I can post one tomorrow.
This account is no longer active. Contact ShadesOfGray for current posts and information. -
Write to measurement file at every n iterations
Hi guys,
I would like some help with saving data in labview 2010 SP1 (base development system). I am using a "Write to measurement fil express VI" inside a while loop and the data out from the DAQmn Read is wired to the signal in of the "Write to measurement fil express VI".
The way I have wired it is the VI saves the data as a text file after it has recorded 100 samples (the nuber of samples to read in this case was set to 100). I would like to know if there is a way to control the rate at which the express VI saves the data. As in, I want the express VI to save the data at specified time interval or at every nth iteration. I have attached the main VI and its 2 sub-VIs for reference. Please let know if anyone can help me resolve this issue. Thank you for your time and inputs in this regard.
RajRobert,
First, you must understand that the above code resides inside a loop. The blue square i terminal is known as the iteration terminal. It provides the current loop iteration count, starting from zero.
The first input (x) to the Quotient & Remainder Function comes from this iteration count (i) terminal of the loop.
The second input (y) to the Quotient & Remainder Function comes from the control N.
We wish to write to the measurement file every N iterations of the loop. If we take our current iteration count (i) and divide by our desired N, every Nth iteration of the loop, the remainder will be zero. For all other iterations, the remainder will be non-zero.
That being said, we check the remainder and compare it to zero. If it is zero, we will send a True value to the Enable terminal on the Write To Measurement File Express VI. Any time a True value is sent, we will write to file. Anytime a False value is sent, nothing will be written to the file.
The green new_file input on the Write To Measurement File Express VI is used when the "Save to series of files (multiple files)" radio button is selected in the Configure dialog box of this Express VI. When "Save to one file" is selected, this option does not apply, and so it is not included in the input list, which is why you are not seeing this.
This new_file input is used to tell the Write To Measurement File Express VI when to start writing to a new file.
-
Labview 9.0: Error 1 occurred at Write To Measurement File
Hi
Our University recently got the latest version of Labview (9.0 32-bit) which I installed today.The labview file I am using (my6008v6.vi) used to work fine with the older version (8.5 i think). My write-to-file VI is enabled at certain time intervals in order to log data. As soon as it is enabled for the second time I get the following error:
Error 1 occurred at Write To Measurement File->Copy of murray6008v6.vi
Possible reason(s):
LabVIEW: An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.
=========================
NI-488: Command requires GPIB Controller to be Controller-In-Charge.
I made a simple file (simplew2f.vi) to test this, with a button which I can press to enable/disable the writing of data. I am able to start writing data and then stop writing data but as soon as I try resume the writing the same error occurs.
This confuses me greatly since this wasn't a problem using the old version and my Labview knowledge is minimal. Any help would be appreciated.
Attachments:
my6008v6.vi 214 KB
simplew2f.vi 64 KBSo, which VI are you having problems with? Sounds like both...
Okay... - sigh - where to start....
Well.. Let's start with a few comments.
1. Try to stay away from the Express VI. I know the Marketing guys at NI will not like me for saying so, but I am saying so. They are a nice marketing feature that Grumpy Old Men like myself do not like. They make it easy to write quick code.. And I will limit my comments to that. (It's not your fault.. )
2. The wiring on your diagram is not clear or easy to read. Yes, with additional time and double-clicking each wire I can tell where they are going. However, a rule of thumb, alway wire from Left to Right. Never right to left. And do not run the wires under objects, even the ones you are wiring to.
3. simplew2f.vi: You should put a small delay in the While Loop. I ran it three times and it wrote to the files without error. And yes, I used LV2009.
4. my6008v6.vi: Avoid wiring from the top of the While Loop. At frist, it looked like the data was coming out of the While Loop because the wires went to the left side of all the index node of the Index Array function.
You should set your Browse Option for the file path to "Files or Folders" and "New or existing". I did that and I was not getting the error message you described.
R
Message Edited by Ray.R on 03-03-2010 08:33 AM
Attachments:
pathProperty.PNG 13 KB
Maybe you are looking for
-
HT1451 Getting a -54 error while iTunes is adding content.
Getting a -54 error while iTunes is adding content. Any ideas on how to recify error. I am trying to rebuild the database without much luck. My media content is kept on a seperate drive than the system. Thanks Jim
-
Can I have cable modem connected to iMac but shared with Airport Express?
I have my internet access to my iMac through a cable modem wired to the Mac. I use the Airport Express to play music from the Mac wirelessly to my stereo. Can I then share the internet access I have on the iMac through the AX without actually connect
-
MacBook Pro i7 to Epson C88 fail
Here's the error message, even after new drivers dated 6/30/2010... /System/Library/Printers/Libraries/PrintJobMgr/Contents/MacOS/PrintJobMgr failed What to do???
-
How do I do this... rollover effect.
Hi, I have been doing some layout in Photoshop for a basic website. I have one .jpg which will be my background. I have created some thumbnails (filmstrip area), and I want them to highlight as the mouse goes over them. At the same time I want the
-
Swing Applet in JSP: problem with fetching data from database
i am facing a problem while fetching data from database using Swing Applet plugged in a JSP page. // necessary import statements public class NewJApplet extends javax.swing.JApplet { private JLabel jlblNewTitle; private Vector vec; public static void