DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a PeakX Value as a filter

Solved!
Go to solution

My issue:

I have a channel(TTDC) that contains numbers between 8600 - 99999.  I have a Sample count channel that tells me how many times a certain number in TTDC channel hits.  I then do the PeakX and PeakY calculation to determine the top 10 hitters of TTDC.  

I want to be able to take those top 10 and filter 7 more channels associated with one of the top 10.

End goal is to have made 7 new channels with the filter data from the top 10 hitters.

 

I don't even know where to start.  All channels are numeric.  I have tried doing a geraric filter/sort using the peak value but it won't work.  any ideas?

0 Kudos
Message 1 of 16
(6,498 Views)

Hi Jcheese,

 

I'm having trouble understanding this statement of yours, "I want to be able to take those top 10 and filter 7 more channels associated with one of the top 10".  What do you mean by "filter"?  Surely you don't want to run a digital low pass or high pass filter on 10 peak values.  Do you mean you have 7 other channels like the TTDC channel?  If so, why do you call it filtering when you're doing a classification/histogram calculation?

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

 

0 Kudos
Message 2 of 16
(6,481 Views)

Sorrry for being confusing..... I attached a sample of the excel sheet I am working with.  

The TTDC channel has a numbers that can range from 0-99999.  They may show logged 1 time or 100 times during the test period.  The following channels after that are associated data to the TTDC number.  So what I am trying to do is generate the top 10 TTDC's that log the most, and collect the associated data with those TTDC numbers.

So this would be starting data below and I then want to take for example each row that has TTDC(02371), create a Seperate group of infromation with only the data from the top 10 TTDC's.

 

 

TTDC

Date Sensor1(volts) Sensor2(volts) Sensor3(volts) Sensor4(volts) Sensor5(volts) Sensor6(volts)
02371 09/30/2013 0.0 0.0 0.0 0.0 0.0 0.0
02851 09/30/2013 0.0 0.0 0.0 0.0 0.0 0.0
02363 09/30/2013 0.0 0.0 0.0 0.0 0.0 0.0
02374 09/30/2013 0.0 0.0 0.0 0.0 0.1 1.1
02371 09/30/2013 0.0 0.0 0.0 0.0 0.0 0.0
24104 09/30/2013 0.3 2.4 2.9 62.0 0.8 0.8
02374 09/30/2013 0.0 0.0 0.0 0.0 0.1 0.0
02363 09/28/2013 0.0 0.0 0.0 0.0 0.1 0.0
02851 09/28/2013 0.0 0.0 0.0 0.0 0.1 1.1
02851 09/28/2013 0.0 0.0 0.0 0.0 0.2 1.0

 

Does that help or still confusing?

 

0 Kudos
Message 3 of 16
(6,479 Views)

Hi Jcheese,

 

That's wonderfully clear now, thanks.  I'll get to this pretty soon, but not today.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 4 of 16
(6,461 Views)

Hi Jcheese,

 

I wrote a DataPlugin (Jcheese_XLSX) to read your Excel file.  The second column is formatted in Excel as a string column instead of a datetime column, so I had the script load it as a string channel in DIAdem and then convert the string channel to a datetime channel.  You'll need to register the DataPlugin by double-clicking on the "Jcheese_XLSX.uri" file in Windows Explorer.  Then run the "Test Jcheese_XLSX.VBS" in DIAdem SCRIPT, after changing the file path in line 4.  The "Test Jcheese_XLSX.VBS" script will automatically call the other VBScript as long as it is in the same folder.  You can change the number of TTDC groups to keep by passing a number other than 10 in parameter of the "SortGroupsBySize()" subroutine when you call it.

 

I included the sorted data in the ZIP file as a TDM/TDX file,

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 5 of 16
(6,441 Views)

It does exactly what I am looking for minus one question.  Say I wanted to sort the groups(TTDC) from from above 8600?  how could I do that now?

 

0 Kudos
Message 6 of 16
(6,415 Views)

And only select the groups above 8600 and then use the top 10 from that?

0 Kudos
Message 7 of 16
(6,414 Views)

Hi Jcheese,

 

All this required was to delete the Groups you don't want before sorting them by size.  Here is what I changed in the script:

 

  FOR Each Group In ChannelGroups
    IF Cdbl(Group.Name) < MinTTDC THEN Call ChannelGroups.Remove(Group.Name)
  NEXT ' Group

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 8 of 16
(6,399 Views)

This is FANTASTIC!  I never knew it was so powerful!  Ok so this gets my mind going here....a couple more questions and I hope this is all.

--- When I run the scripts to completion it deletes my original data group. Where in your scripts can I change that?

--- The when it creates a new group for the top ten can the loop include the TTDC as well even though the group name is the TTDC? it would make some of my other calculations easier.

--- Also, will this function correctly if the Sensor_Request_Readout.xlsx file is not the first group in the the portal.  I have two files that load and the Sensor readout is loaded second and therefore is the sensor group in the portal.  Does that make sense.

 

WOOW I am just blown away this is awsome.  You ROCK!  Thanks Brad..

 

0 Kudos
Message 9 of 16
(6,395 Views)
Solution
Accepted by topic author Jcheese

Hi Jcheese,

 

I believe this latest version addressess all 3 of your latest requests.

 

Brad Turpin

DIadem Product Support Engineer

National Instruments

0 Kudos
Message 10 of 16
(6,387 Views)