DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

MF4 Files Properties

Hello community,

 

I am writing a script, which loads .mf4 files from a folder, reads them and writes a report.

As part of the report are the properties of the files such as "Comment" and "Date of recording".

 

I am reading them as follows:

for i=1 to Data.Root.ChannelGroups.Count

 

Set oCalcGroup=Data.Root.ChannelGroups.Item(i)

if oCalcGroup.Root.Properties.Exists("Kommentar") then

...

 

Now to the problem:

I can only access the Properties of the file when I read them with (oCalcGroup.Root.Properties). This means I am only accessing the Properties of the folder and consequently I have the same Properties for all the files I am trying to read. They are usually those of the first file in the folder.

When I try reading without root(as it should be I think:oCalcGroup.Properties ), there are only a few properties, which aren't the ones I need and arent the ones I see in CANape for example.

Thanks in advance!

 

0 Kudos
Message 1 of 3
(2,705 Views)

Try the following simple example that iterates over file/root and channel group properties.

 

Dim oProp, oGrp, oChn
Call LogFileWrite("File / Root Properties:")
For Each oProp In Data.Root.Properties
  Call LogFileWrite(vbTab & oProp.Name & vbTab & oProp.Value)
  If Data.Root.Properties.Exists("MyGrpPropName") Then
    'Do something with the file/root property
  End If
Next
Call LogFileWrite(vbTab)
For Each oGrp In Data.Root.ChannelGroups
  Call LogFileWrite("Properties for channel group '" & oGrp.Name & "':")
  For Each oProp In oGrp.Properties
    Call LogFileWrite(vbTab & oProp.Name & vbTab & oProp.Value)
  Next
  If oGrp.Properties.Exists("MyGrpPropName") Then
    'Do something with the group property
  End If
Next

 

The properties available are dependent upon the DataPlugin.  Make sure you have the latest DataPlugin. http://www.ni.com/example/54290/en/

 

If you need another .mf4 file to try, try the sample file in this link:

 

https://www.asam.net/index.php?eID=dumpFile&t=f&f=2132&token=1672c6611f14141ae705140149a9401141821de...

 

Post one of your .mf4 files for more help.

 

 

 

 

0 Kudos
Message 2 of 3
(2,617 Views)

Hi htdrv,

 

It sounds like you're trying to retrieve the file properties from multiple files that you've already loaded into the DIAdem Data Portal.  The DIAdem Data Portal by default only loads the file properties of the first file loaded into it.  By default the file properties from the subsequent files loaded into the Data Portal are not loaded at all.

 

If you are requesting the file property from elements in the NAVIGATOR panel browse tree view or Search Results list, then you have full access to all file properties, but again this is BEFORE you load the files into the Data Portal.

 

It is also possible to set the loading behavior to have File properties "trickle down" to the Group level, so that they do load into the Data Portal, just not at the File level.

 

The problem here is that the Data Portal only has 1 memory space for File properties.

 

Brad Turpin

Senior Technical Support Engineer

National Instruments

0 Kudos
Message 3 of 3
(2,598 Views)