Write To Measurement File, Comment
I have tried to use the Comment input on a Write To Measurement File vi and the results are not what I expected. What I want to do is place one line of text appended after a block of data to form an easily seen break between the data sets. The data is triggered in a stream prior to being sent to the Write To Measurement File. I thought that the description on the Comment would do this but I get the comment not only between the blocks but also interspersed within the data stream in a seemingly random manner. What am I missing in the behavior of the Comment input?
Dear ITElearner,
thank you so much for your post on our webforum. You are able to add a comment each time you write to the lvm file; this comment will be added to the first row you are writing. I created an example; 10 samples are generated, comment is added, this is written to file, another 10 samples are generated new comment is added and written to file.
Is this what you are trying to achieve? Else I would recommend to create a small example of your problem.
Best regards,
Martijn S
Applications Engineer
NI Netherlands
Attachments:
commentlvm.jpg 120 KB
Untitled 1.vi 112 KB
Similar Messages
-
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 -
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 ... -
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.
-
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
-
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 -
Hi,
i would like to know one thing about the write to measurement file. Can i put the proper header at each column in write to measurement file (.lvm) ? and how can i do for it ? Could you show me a way to make it ?
i am looking forward your kindly reply.
thank you so much ..
best regard,
roxyHi Mike,
Thank you very much for your help. It works .
By the way, i would like to ask you about setting time interval. In the pic, X_Value column is for time column
i would like to ask that when i use the write to measurement file, there got the x column that show time inside the excel file. In this column, i would like to set the time interval at every 210ms .The data may come in every msec but i just want to record the data at every 210ms . for example, 210ms-420ms-630ms ..etc. how can i set it ?
One more thing .. can i do it in graph as well ?
i am looking forward your kindly reply.
Thank you for your time.
Best Regard,
Roxy -
Write to measurement file timing
I am trying to make a VI that allows the user to turn on and name channels through the front panel. After the user has configured the channels, they can push a button and record voltages from the enabled channels and save them using the "Write to Measurement File".vi. I would like the user to be able to record a measurement file that is consistent in length each time they push the button...in this case, 5 seconds of data. The current VI doesn't appear to be doing this...everytime I push the record button, the data gets recorded for 0.045 seconds. Apparently I must be missing something as this isn't behaving how I expected it to. See attached VI.
Attachments:
Select Channel rev 3.vi 244 KBIt waits 5 seconds then saves the last 10 samples. Because that is the way you programmed it. The while loop returns only the data from the last iteration.
Two ways to do what you want: 1. Read 5 seconds * 200 samples/second = 1000 samples. No loop required.
2. Read 10 samples at a time and accumulate the data until you have 5 seconds of data. To avoid memory reallocations the way to do this is to Initialize an array with 1000 elements outside the loop. Wire it to a shift register. Inside the loop Read the samples and use Replace Array Subset to put the new data into the initialized array. Wire the output of the shift register to the file VI.
You generally should not put any time consuming code inside an event structure. Read the caveats in the detailed help for the event structure. Consider a Producer/Consumer architecture.
Lynn -
Quickie: Write to measurement file VI, how to create new file?
I am using the write to measurement file express VI in my code and I have wired into it a control that sets the location to save the measurement file
The only problem is the measurement file has to exist first!! I cant for example, from the front panel, click the browse directory box, navigate to a folder and type in a name for the file. It just says file not found! Its like the file directory control is opening a file to save to, rather than creating a new file in that location
How can I solve this?
Solved!
Go to Solution.Project attached
If I go in browse options what do i do? Just chose new and existing files?
Attachments:
engine.zip 119 KB -
Remove milliseconds from timestamp in write to measurement file
I'm logging data to a binary tdms file using the write to measurement file express vi. I choose my x axis to be time and see that an absolute timestamp is written with millisecond precision. I only need to-the-second precision. Is there anyway to change this default behavior?
Attachments:
remove.png 10 KB
remove.png 10 KBWhere is your data coming from. When I open the express vi to look, it looks like the time format doesn't determine that, but the
signal data cluster coming in does. So where does the data come from, and in what form?
Putnam
Certified LabVIEW Developer
Senior Test Engineer
Currently using LV 6.1-LabVIEW 2012, RT8.5
LabVIEW Champion -
Strange data saved by write to measurment file
Hi all,
I have developed a simple program that permits to visualize data from a channel, but it records data, just when the saving data button is pressed. Data are saved through write to measurment file, but unfortunately there is something wrong since the saved data is strange. In the attachment there are the VI file and the saved data.
As you can see there are several header and dates are strange (i.e. the saving date is 23/12/1916) and I get much more sample than I should have. Why do I get this?
Any suggestion is appreciated.
23/12/1916
Solved!
Go to Solution.
Attachments:
simulated_data.xlsx 1426 KB
read a channel and save data.vi 63 KBYour many headers may be because of this:
Beginner? Try LabVIEW Basics
Sharing bits of code? Try Snippets or LAVA Code Capture Tool
Have you tried Quick Drop?, Visit QD Community. -
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 -
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 -
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. -
Capturing data using write to measurement file for encoder
hello dear,
can anyone help to check with my encoder to measure data?
i have connect the write to measurement file but when i open the .txt file,
no result appear, thanks so much for your help
Solved!
Go to Solution.
Attachments:
encoder capture.vi 180 KBwell, I have never used that method to write data to a file, but if you double click on your write the write LabVIEW measurement file object and look at the configuration you have selected save to a series of files. Is that what you wanted, or did you just want one file?
Jim
Jim
LV 2013
Maybe you are looking for
-
Assign external delivery number using BAPI_DELIVERYPROCESSING_EXEC
Hi Experts, How to assign the external delivery number using "BAPI_DELIVERYPROCESSING_EXEC? For internal no, the BAPI works and I try to pass the parameters "tbl_request-EXTDELV_NO = XXX" to the BAPI , it prompt an error "Unexpected issue of error me
-
Hello, I have a problem with PCUI field ,have set 2 field attribute as Madatory 'C' but while trying to change from this screen tab to another tab a client check popup appears 'Fill required fields', The only check present for this fields is on 'save
-
Converting pdf to word with XI Pro
I just downloaded a free trial of Adobe XI Pro as I'm trying to convert a PDF document to a Word doc on my Mac. I successfully downloaded the software, registered with Adobe and signed in. But when I press the tab to "convert" I'm informed there's an
-
Simple SQL Query is not using Bitmap index
Hello to All, We are having Oracle9i Database and using it for the datawarehouse purpose. I have created the bitmap index on calledinfo column and I am running the following simple query which takes serveral hours to complete: select * from ssp.ssp_2
-
How to attach a .pld file in oracle Designer
When we try to generate a form out of designer we are getting the error ilke sample.pld file is required. The Questions on it are, 1. What is a .pld file in a designer mean. 2. How to attach a .pld file in oracle designer for the generation of forms.