DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Split file by date to more parts

Hi Pavel,

 

The full data set is over 1GB as a TDM/TDX file.  Let's say we want to aim for about 10MB, which is 0.01GB.  So by volume that would be 1% of the original file.  The simplest thing to do is to load the data set into DIAdem, then reduce the row count by 99%.  Or put another way, keep the first 1% of the rows from all the channels, and delete all the other rows after the 1% point.  Then save that 1% file and post it for me.  Hopefully the first 1% will have more than one datetime region, but even if not we can make the datetime regions artificially small for the prototype script.

 

Brad Turpin

Principal Technical Support Engineer

NI

0 Kudos
Message 11 of 15
(673 Views)

Hi Brad,

 

please see the attachment file.

 

I appreciate your support.

 

Thank you

 

Pavel

 

0 Kudos
Message 12 of 15
(666 Views)

Hi Pavel,

 

Here's is a short script that sends one datetime window of values from all the channels to a new "DateTime Group".  If you can describe how those datetime windows are to be programmatically constructed, then I could send you a version that puts the datetime windows into an array and loops over all of them to create multiple "DateTime Groups".  In that case, you'd need an array of new Group names or a method to name them uniquely with some link to the datetime window each contains.

 

Set DatGroup = Data.Root.ChannelGroups(1)
Set DatChannels = DatGroup.Channels
jMax = DatChannels.Count
X1 = TTR("31.08.2019 18:25:00", "#dd.mm.yyyy hh:mm:ss")
X2 = TTR("01.09.2019 00:00:00", "#dd.mm.yyyy hh:mm:ss")
P1 = PNo(DatChannels(1), X1)
P2 = PNo(DatChannels(1), X2)
Set NewGroup = Data.Root.ChannelGroups.Add("DateTime Group")
Call NewGroup.Activate()
Set NewChannels = NewGroup.Channels
FOR j = 1 TO jMax
  Call NewChannels.Add(DatChannels(j).Name, DatChannels(j).DataType)
NEXT ' j
Call DataBlCopy(DatChannels, P1, P2-P1+1, NewChannels, 1)

 

Regards,

Brad Turpin

Principal Technical Support Engineer

NI

0 Kudos
Message 13 of 15
(652 Views)

Hi Brad,

 

highly appreciated your support!

 

It works really well. I think I'm able to upgrade it by self to version I need. However I'm beginner with diadem script despite the fact that this script look simply I would not be able make it by self. I tried to find any manual on the web side but only some base is available. It seems to be that I will need to attend a treining.

 

Maby one more point. For my evaluation I need to filter data.
For example from temperature channel. I need to filter all value below and save it to new channels:
X =<50
X >=51<100
X >=101<200
X >=201<300


It means create new channels for each temperature range. Than I will make a graph to see how many percent falls within a given temperature range.

 

Im sure that use scripts is best choice but how to start? Would it be possible help me?

 

Thank you

 

Pavel

0 Kudos
Message 14 of 15
(637 Views)

Hi Pavel,

 

Actually, I'm not convinced a home-made script is the best approach to achieve the graph you describe.  If you just want a breakdown of how many data points are within each temperature bucket, you just need to run a Histogram calculation from the Statistics palette of the ANALYSIS panel.  You can specify the temperature bins with parameters or point to the temperature bins in an external channel.

 

Brad Turpin

Principal Technical Support Engineer

NI

0 Kudos
Message 15 of 15
(629 Views)