"Write to measurement file" express VI (TDMS foormat) keeps file opened
Hello!
I am trying to use "Write to measurement file" express VI to write TDMS data obtained from DAQmx in LV2011. Each run of the same write function creates new file.
It seems that last written file remains to be opened until program stops or next file written. It has 0 size and it is not possible to access it from other programs.
Is it possible to save file immediately and close it?
Solved!
Go to Solution.
It seems, that wiring "DAQmx task" (for AI task) to "Write to measurement file" express VI does not works in my case (only in exe).
The error is the same as file not found (error code 7), but file is created. Something gets wrong inside express VI. I am unable to debug exe, so I have just disconnected DAQmx task from express VI (really don't specially need it anyway).
For sure, the same LabVIEW version and drivers are installed on target and VI is working in it as well as at dev machine.
Debug error which I had encounter is already published in the forums elsewhere. It seems that the problem is in VI without block diagram inside hierarchy. Maybe with Express VI.
PS test app writing tdms files the same way is working like a charm (without DAQmx task wired).
So, thank you for yor advices, the problem seems to be solved. Maybe I will have a look in more details about the reason of such error, but can't do it now.
Similar Messages
-
How do I set File Sharing in iTunes to keep files up-to-date?
How do I set File Sharing in iTunes to keep files up-to-date? i tried iTunes File Sharing, but the updates to the files never transferred across the USB during sync. Tried to use Documents to Go, but the Apple behavior keeps them from syncing via USB, so when I am home and have no wifi/internet there is no way to transfer the files. The other apps I have looked at also use wifi/internet to get around the problematic Apple behavior, so there is no way to connect via USB that I have found other than the iTunes. Have not been able to locate any helpful information to configure the File Sharing to hotsync the files between pod and computer.
I am trying to USB sync Word, Excel, and PDF files between the ipod and the PC.
Pretty sure icloud has to have the internet to work, but I can try to see what USB options there are there when time permits.
Pretty sure dropbox has to have the internet to work, but I can try to see what USB options there are there when time permits. -
Write to measurement file Express VI - TDMS file has separate "channels" for each data point
Im trying to write a VI to measure and record thermocouple data from an Advantech T/C DAQ. Using the "DAQNavi" express VI provided by them, connected to the Write to Measurement File express VI, I have managed to read in the data and create a TDMS file. However, when I open the TDMS file, each time step of temperature data is entered as a separate channel, instead of all of the channel data going into one tab. Obviously this is a huge problem as it creates hundreds of tabs after just a few seconds. Any thoughts as to what causes this?
Hi glibby,
How did you configure the Write to Measurement Express VI? Please select "one header only".
If you have your own timestamps to write, please merge your timestamp channel and measurement channels with "Merge Signals" before passing them to the Write to Measurement.
Best Regards,
Mavis -
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 -
I NEVER name files with extra "." s in the name. I realize that all OS's (even Windows) will recognize it, but I haven't gotten out the old mindset of 8.3 filenaming... Although I do use longer names. So... I was surprised to see that when I was renaming files as per a clients naming preference to add a period within the name, the file extension is removed.
For example:
original file - 2014_10_31_1643.CR2 when batch renaming to "2014.31" + sequence, drops the "CR2" extension.
but.... if I change it to "2014_31" + sequence, the ".CR2" remains
Since adding multiple "." is a legitimate naming convention, shouldn't the file extension remain? Or, possibly this could be made more flexible by adding a check box "Keep file extension"
just a thought.Refer to this stackexchange article:
http://apple.stackexchange.com/questions/47319/how-can-i-make-os-x-recognize-new -file-extensions
The finder will only select the filename only for "known" file types. -
Dear all,
I want to use Labview to process a data.
Now I have a array in a text file.
this array is very very big. which is at least row*col = 6 * 100000;
the column size always 6,
but the row size is ramdom, some times is very big, like bigger than 65535,
when I use "read from measurement file express.vi" to read this file, the array I could get always 6*5339, I don't know why. the column size is always 5339.
and then I delete the 1st row of the array and then write into a txt file via "write measurement file express. vi", it takes a very long time. almost computer has no response. after a while, no file was creat to record the data.
is there an efficient way to process such big data file and store the processed file into a new file
thank you very much
Jack
Message Edited by weichengatech on 03-09-2006 12:00 AMHello,
There’s no real efficient way to read the file if you don’t
know exactly how many rows of data you have.
Your going to just have to read a row at a time and add the results to
the end of an array (granted for the clever programmers there are some more
efficient ways to do this than just with ‘build array’). I would start by asking you how much
information you know about the file and what the exact structure of it is (i.e.
is it a binary file, a tab delimited file, or a LVM file)? Could you provide a screenshot of the code
you are running? If you provide a little more information on the file structure
we might be able to contribute some additional information.
Look forward to hearing back from you-
Travis M
LabVIEW R&D
National Instruments -
Write to measurement file loses timestamp data in tdms format
Hello all, I'm using the Write to Measurement File expressVI and I have created a loop in order to be able to individually label the column headers for each data signal that I'm writing. However, while the loop is successful in doing this the resulting TDMS file that the expressVI creates ends up losing the timestamp data that is used to record the time for each row and just writes a '0' instead. The timestamp data is present before the loop that adds column headers, which I have verified by adding an expressVI just before the loop. Please see the attached code for clarification.
How do I regain the timestamp info after the for loop executes and adds column header info? Thank you.
Attachments:
Write to measurement file specify column name.vi 106 KBThe problem with Express VIs and with the Dynamic Data wire is that they (almost) complete obscure what is being done "under the covers". They manipulate data in ways that are unseen and often unexpected. While they allow beginners to do extremely simple tasks quickly, they can easily lead to situations such as you are discovering.
If what you want to do is to write a TDMS data file, you should probably investigate the TDMS functions on the File I/O palette. I've not used TDMS myself, but I know there are examples and documentation in the LabVIEW Help. I suspect that if you do go with straight TDMS, you will probably save yourself further problems by not bundling your four inputs into a Dynamic Wire, but making them a 1D Array (or possibly a Cluster).
Bob Schor -
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 Express VI: file name prompt
I am using the Write to Measurement File express VI to write some data.
Even though I have not selected "ask user to choose file" and have set a default filename, the vi still prompts me to choose a file. I tried restarting my pc and it used the default filename the first time and then went back to prompting me. I have set the default to overwrite my existing file each time, so I don't understand why I keep being prompted. If you look in the express VI the "ask only once" radio button is selected and greyed out, but I don't know why; I didn't select it.
(I have the express VI in a while loop and want it to write a line of data to the file each time the loop executes, so it's not convenient to be prompted for the filename each time)
I'm sure this is my own silly fault but would appreciate some advice
Thanks, klara
Attachments:
2PDCal_USB1v3.01.vi 441 KBI'd suggest changing the mechanical action of your stop button from "Switch When Pressed" to "Latch When Released". This might be the only problem. If you didn't manually change your stop button back to false before running again, your loop would run once and stop, and you'd immediately see the file dialog from the Format Into File function. Changing the mechanical action would prevent you from needing to manually change it back to false before the next run.
Message Edited by Jeff B on 02-07-2008 08:48 AM -
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 -
Bug within Write to Measurement Express vi
I think I have found a Bug within the Write to Measurement express VI. I have attached an example VI to help reproduce the error.
Here is a bit of history.. I have a data monitoring system which runs continuously. I have the write to measurement setup to create a new file every 12 hours. What I noticed is that even though a new file has been created, I still cannot access the old files until I stop the VI that has the Write to Measurement VI in it. I am trying to access the files via Diadem.
For this application, it is not practical to stop the Data Monitoring Main VI every time I need to look at the data. The alternative that I found was to not use the Write to measurement express VI and use open/write/close TDMS vi's. This is not an acceptable solution as the features programmed into the Write to measurement Express VI are need for my application.
Can someone please fix this or help me fix it?
Thank you
Mike
Attachments:
example code.vi 77 KBHello Mic,
Please understand that I can suggest a workaround, and I've tested it in your scenario and it seems to work OK, but I cannot guarantee this workaround for all possible use cases of this Express VI. It is for this reason that we generally don't like to recommend one-off modifications to VIs that ship with LabVIEW - they do not get tested with as wide a set of use cases as we do on VIs when we ship them. As such, I'm not going to just hand you a VI to replace in vi.lib, but I will show you a few edits you can make to work around this issue.
Open this VI: "[LabVIEW Install Dir]\vi.lib\express\express shared\ex_TDMS\ex_createorOpenTDMS.vi"
Open its diagram. Near the left there's a section that looks like this:
The current known bug is with the "Not A Number/Path/Refnum?" function on TDMS files, so you'll see the following changes in the below diagram, which hopefully you can make and try out in your use case. I would highly recommend making a backup copy of this VI before saving any changes!
Delete the "Not A Number/Path/Refnum?" function.
Connect the "new file?" input to a "Not" function, and wire the output of the "Not" to the case structure selector where "Not A Number/Path/Refnum?" was previously being used.
Delete the wire connecting the error out of the first inner case structure to the second inner case structure, and re-route the error wire around the first case structure.
Hopefully with these three instructions and comparing the shipping and workaround images you can successfully get up and running.
Message Edited by Jeff B on 03-01-2007 08:12 AM
Attachments:
shipping.gif 5 KB
workaround.gif 6 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 -
Read from Measurement File Express VI - Time information
I need some assistance with a small problem with building reports of collected data. I don't see it very relevant, but I'm collecting data from several modules on a 9074 cRIO. I'm not using the cRIO the way it is intended, but it is perfect for my needs. Anyway, I'm collecting the different types of data in RT, then using the express VI "Write to Measurement File" with TDMS option selected and one time column only selected. Also one header, etc. Nothing fancy.
In another VI I want to use this collection of .tdms files to create an Excel report. Everything is working good however I need a time column for reporting my data. When I view the .tdms file using Excel Importer, the time column is there and perfect, with the next column a relative time (or iteration) and then columns with the signal names at top and all the data below. Perfect.
I'm similarly using the "Read from Measurement File" Express VI to get the data back the same way it went in. I have everything in it's correct place on building the Excel Report, but I haven't been able to find any way to include the first time column in my import. I can use "Get Attributes" Express VI to get the signal names from the read, but that's not going to help with the time data. How is it possible that Labview allows to put the time data there, but not retrieve it? I'm aware of the warnings that Timestamps aren't supported by TDMS file format vs LVM, but there MUST be a way to retrieve that time information if "Excel Importer" can do it.
If that time column in the TDMS file is somehow computed using the start timestamp and dt, can someone explain how to compute that for my report?
Unfortunately, I can't use the LVM format because I need to allow the users of these VI's the backup of using Excel Importer to see this data if my report generation VI is not functional.
I'll attach one of the TDMS files for illustration. The first column of the second worksheet is exactly the data I need for my report.
Attachments:
TDMS Imported.xls 28 KBDylanC,
Your solution works as needed. Thank You.
I think I found a better solution though. Apparently if you convert a signal from the Express VI "Read from Measurement File" into a waveform the time data required is included, then you can convert to a string with a for loop and insert it as a row header into a table. The result gives me what I need. I attached a screenshot if someone is interested.
AWyers
Attachments:
TableFromTDMS.JPG 61 KB -
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.
Maybe you are looking for
-
Understanding of -- "/1BCDWB/LSF00000017F01" include
Hello Friends, How to edit these kind of includes "/1BCDWB/LSF00000017F01". I know this is auto generated one and how will I come to know this include is belongs to which program or area? Is it possible to edit this include? Please help me to underst
-
Plug in for Adobe X Pro How to straighten Text Lines
I know I've asked this question before, but I've seemed to have misplaced the answer. I have to scan a lot of over used documents. As most of you know the text starts curving after a paper gets copied too many times. I am looking for a plug in for ad
-
How can I change the font in html-file
Hello, if I create a new html-file in KM-Content - Folder - New - Html-File, I always get the font Times New Roman. In the editor I have Arial oder something similar - but not in the view. Does anybody know how to change this font to Arial? Where do
-
Reports region only shows 15 rows
I have a strange problem with a reports region. The region runs a simple SQL select against a table. My table has 18 rows but the report region only displays 15 rows. I ran the SQL directly against the database and all 18 rows are returned, so it's n
-
Download to excel through ESS/MSS
Hi All. I'm using the function GUI_DOWNLOAD to download an internal table to excel, and it works fine when the program is ran from SAPGui, but when ran from the browser (ESS/MSS), the file generated doesn't come with the TAB delimiter, so excel can n