From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

diadem script

Hi all,
is it possible to access the number of channels of a lvm file from Diadem Script without loading the whole file into the data portal?
Regards,
David
 
0 Kudos
Message 1 of 3
(3,362 Views)

Hi David,

If you have DIAdem 10.1, then you can use the new DataFileHeader object to interrogate a data file without having to load it:

DataFilePath = ProgramDrv & "Demo\Dat\Example.LVM"
Set DataFileHeader = DataFileHeaderAccess(DataFilePath, "LVM", TRUE)
MsgBox DataFileHeader.GroupChnCount(1)

Alternatively, if you have DIAdem 10.0 and the LVM file happens to be in a search area, you could programmatically query the file and return the Group level and count the number of return rows in the Search Results Table.

Ask if you need more information,
Brad Turpin
DIAdem Product Support Engineer
National Instruments

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

Hi Brad,

thanks for your response.

unfortunately, I don't have Diadem 10.1, but 10.0 installed. Therefore I can't use the DataFileHeaderAccess function. The way to work around it I found is:

'get number of channels in file
Call DATAFILELOAD(filename,"","Register")
chns = GroupChnCount(GroupIndexGet("LabVIEW_Data"))
Call DATADELALL

Not loading but registering the data works a lot faster!

David

0 Kudos
Message 3 of 3
(3,311 Views)