06-04-2015 03:36 PM
Hello!
So I am working on a project where I have data files that are written on 12 channels to a .nrf file. Since NRF seems to be a fairly unique file format I have not come up with better software than DIAdem to open the data. I am looking for a way to programmatically take the data from each of the channels and grab the values every x number of data points. I am using Visual Studio, writing in C#, using the DIAdem COM library.
I have written a very basic program at this point which uses CmdExecuteSync ( "DataFileImport('"+ file.FillName + "')" ); to import the .nrf file in to DIAdem but from there I am lost. I have tried exporting the data using the DataFileSaveSel function, but unfortunately the output CSV ends up being nearly a gigabyte in size, which is too large for my needs. I am hoping there is a way to perform the operation I need within DIAdem and if so someone might help get me pointed in the right direction.
Thank you very much in advance for any and all help.
Solved! Go to Solution.
06-05-2015 03:33 AM
Have a look on DIAdems "Reduce Classification" functionallity.
Maybe that is what you are looking for.
It can be found in
ANALYSIS->Statistics->Reduce Classification
06-05-2015 09:27 AM
Hi Kub,
I recommend you use the reduced loading capability of DIAdem, like this:
n = 10
SectionBegin = 1 SectionEnd = 1000 Call DataDelAll Call DataFileLoadRed(FileDlgName, "", "", "IntervalWidth", N, 1, SectionBegin, SectionEnd)
This will load every nth value from value 1 to value 1000,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
06-05-2015 11:02 AM
Exactly what I was looking for. Thanks to both of you!
06-19-2015 05:24 PM
I hate to bother you again but I have one quick follow-up question to ask about this. Is there a way to tell it to run to the end of the file instead of a value where SectionEnd is specified? I have run into an issue where I cannot be sure how long the data is, nor where to stop for sure.
That you very much!
06-22-2015 01:37 PM
I pulled up the Function Help for DataFileLoadRed and see that if SectionBegin and SectionEnd both have the value 0, DIAdem loads the complete channel. Hope that's helpful!
06-22-2015 03:53 PM
Hi Kub,
Some file formats store a property that details how long a given channel is, but most file formats do not. DIAdem DataPlugins will expose that property if it exists, but in its absence the DataPlugin will simply read to the end of the file when running DataFileLoad(). Sometimes you can derive an upper limit for the channel size based on the number of channels and bytes in the file, but with complicated file formats this also is not possible with any accuracy. What you can always do, though, is set the upper limit equal to the number of bytes of the file. The DataFileLoadRed() command will automatically load as many values as it finds within the amount you specify, so this should work for you:
SectionEnd = FileSize(DataFilePath)
Brad Turpin
DIAdem Product Support Engineer
National Instruments