10-07-2013 02:00 PM
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?
Solved! Go to Solution.
10-08-2013 11:00 AM
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
10-08-2013 11:52 AM
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?
10-09-2013 03:49 PM
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
10-11-2013 03:31 PM - edited 10-11-2013 03:33 PM
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
10-15-2013 10:26 AM
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?
10-15-2013 10:26 AM
And only select the groups above 8600 and then use the top 10 from that?
10-16-2013 09:55 AM
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
10-16-2013 10:56 AM
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..
10-16-2013 01:50 PM
Hi Jcheese,
I believe this latest version addressess all 3 of your latest requests.
Brad Turpin
DIadem Product Support Engineer
National Instruments