DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Impossible to save properties changed in portal

Hi,
 
I would like to change properties in a tdms registered file (not loaded due to file size) in the portal and then save it (right clic in the portal and "save as" with the same name).
 
Modification to the properties work fine but I get the following error :
 
File system error : The "myFile.tdms" file is read only.
 
If I check the file in the window explorer, it is not read only...
 
Could anyone help me to save modifications made to tdms file properties (400 files to modifiy...).
 
Thanks in advance.
0 Kudos
Message 1 of 5
(3,897 Views)

Hi bull balls,

The file is not read-only in the Windows directory, but the "Register Data" action in DIAdem always opens a read-only connection to the file.  Data registration uses the existing data file in-place as DIAdem-managed virtual memory, avoiding the time consuming alternative of asking the operating system to copy the file to a temp directory in order to create Windows-managed virtual memory.  This also has the benefit of enabling you to transcend the 2-GByte-per-application limit imposed by 32 operating systems for super large data files.

The good news is that the TDMS file is able to append a new property assignment to the end of the TDMS file without rewriting the existing file, either for a newly created property or to change the value of an existing property, and the TDMS VIs in LabVIEW can do this very easily.  The bad news is that DIAdem can only accomplish the same thing by rewriting the entire file.  Do you have LabVIEW to work with on your computer, or only DIAdem?

Even if you don't have LabVIEW on your computer, I can write a LabVIEW VI for you and send it to you and you can call it efficiently from DIAdem.  But for that I would need to know what version of DIAdem you have.  The VI would scan through all the current properties in the Data Portal for all the File and Group properties, compare their current states to the possibly edited state in the Data Portal, then programmatically adjust those properties states in the TDMS file.  It appears that when you register a data file the channel properties can not be edited in the Data Portal, while the File and Group properties can be.

Let me know what DIAdem version you have,
Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 2 of 5
(3,885 Views)
Hi bull balls,

you can use the "DataFileHeaderAccess" object to manipulate TDM and TDMS files programatically without loading them into the DIAdem Dataportal.
See example code below:

Dim oMyDataFileHeader
Set oMyDataFileHeader = DataFileHeaderAccess("myFile.tdms","TDMS",False)
Call oMyDataFileHeader.RootPropValSet("Description","Test")
Call oMyDataFileHeader.close(True)

Cheers
Stefan
0 Kudos
Message 3 of 5
(3,875 Views)
Hi everybody, thanks for your replies,
 
Brad, I use DIAdem 11.0 from friday Smiley Very Happy and I have Labview installed on the same computer, so if you can send me your VIs, it could be very usefull...
Does this VIs work for File / Group / Channel ?
 
Stefan, script sounds good, but I won't try it first.
 
Thanks again.
0 Kudos
Message 4 of 5
(3,856 Views)
Hi bull balls,
 
Actually, I had first attempted the same approach as Stefan but made 2 errors in my test code and incorrectly concluded that the DataFileHeaderAccess() object was not able to edit a TDMS file.  I fixed those errors and verified today that in DIAdem 11 you CAN edit the values of TDMS properties (File/Group/Channel) and even create brand new properties in the TDMS file, without loading the file, using this object.  So that would be my recommendation for the easiest way to edit the TDMS property set from a DIAdem VBScript.  Note that if you have the TDMS file register-loaded in the Data Portal that the DataFileHeaderAccess() object can not edit the TDMS properties.  In this case you need to then re-index the TDMS file for the updated properties to show up in the DataFinder.
 
If, on the other hand, you are actually interested in programmatically editing the property values of the TDMS file, without loading it, using LabVIEW-- with no interaction with DIAdem or the Data Portal, then you can use the attached VI as an example of how this would work.  In this case you need to delete the existing TDMS_Index file and re-index the data file for the property changes to show up in the DataFinder.  The TDMS file can not be register-loaded in DIAdem when you delete the TDMS_Index file.
 
Brad Turpin
DIAdem Product Support Engineer
National Instruments
0 Kudos
Message 5 of 5
(3,838 Views)