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: 

Event Search...but not quite!

Solved!
Go to solution

I was excited to see the Event Search function in 2015, but unless I'm missing something it's only 50% completed!

You can do a nice filtering out, but for the result, your only option is a static value??????  HUH?  Maybe I'm missing something, but that's silly and incomplete. Why can't I have it input the actual value when true from the dialog box input?

And while it looks like something like this is supported via script, I DEFINITELY don't feel I should have to write a script for something like. Do you have to write a macro every time you want to do a search/replace in your word processor????

 

Sorry, but this just got to me, as I thought this was an awesome new feature, spent my morning upgrading for it and then am horribly disappointed.

 

--Scott

0 Kudos
Message 1 of 23
(6,031 Views)
Solution
Accepted by topic author sg000

Hi Scott,

 

The intention is that you can create a new channel with 1 or 0 values or 1 or NoValue values or whatever, then use the ANALYSIS function "Multiply" in the "Basic Mathematics" palette to multiply that channel by your original channel.

 

The main use case envisioned for the ChnEvent...() functions was to identify all the row ranges of multiple features in a large data set, with just one function call.  The previous approach with ChnFind() required repeated calls in a While loop.  Each time you run either the "Event Search" or "Event Search (Free Formula)" dialogs in ANALYSIS, they automatically fill the global variable "ChnEventResultList" with a 2D array of row ranges, per the documentation in the Help.  So you immediately know how many of these features were found and can easily loop over them.

 

I like the idea of a special text like "InputValue" that you could put in one of those fields, similar to "NoValue", that would automatically use that row's original value.  Would you please post that request to the DIAdem Idea Exchange (ni.com/diademideas)?

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 2 of 23
(5,972 Views)

Thanks Brad for the further explanation of how to use it. An extra step, but I could see the "value" in that for certain situations. 🙂

 

I will post to the Idea Exchange, thanks for the support.

 

--Scott

0 Kudos
Message 3 of 23
(5,909 Views)

Is there a way to save event search parameters? I am processing data over multiple days using this feature but if I exit Diadem it forgets the values I have entered

0 Kudos
Message 4 of 23
(5,482 Views)

If you are writing this as a script you can simply save the script which should have your parameters in it.

Miles G.
National Instruments
Staff Applications Engineering Specialist
0 Kudos
Message 5 of 23
(5,452 Views)

I have little experiance with scripting, I tried using the record script function and using the event search from Analysis but the only line of code it generates is

 

Call ChnNameChk(8,"EventStatus")

 

Which has no effect when I try to rerun it.

 

What I want to do is find where in the 8th Group, Channel "Pressure" falls within any of 7 windows (2.75-2.77, 3.44-3.46,4.13-4.15,4.81-4.83,5.50-5.52,6.19-6.21,6.88-6.90)

0 Kudos
Message 6 of 23
(5,424 Views)

Hi pfriesen,

 

What do you want to do with the results of those different windows?  I agree with the previous comment that your best bet is to make a VBScript, and once we set our minds to that, we can have the VBScript automatically apply all of your windows, one after the other.  So what should happen with the result of each window?

 

Could you perhaps post a data set for me to gain a better idea of what you're working with?  I should be able to write a VBScript for you to do much of what you need.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 7 of 23
(5,382 Views)

Hi Brad,

 

Thanks in advance for the assistance.

 

Currently what I am doing after loading my CSV files is using my Corr Torque script to correct torque values and the Diadem Concatention Script to append the channels I require. I then generate a time channel based on the length of the concatened files and use Channel Event search to find the pressures I need. My Points script  multiplies the Channel Event results against my desired channels, and removes the unwanted values, as well as generating efficiency calculations

0 Kudos
Message 8 of 23
(5,368 Views)

Hi pfriesen,

 

OK, here's a shorter VBScript that is more efficient and does everything but the Event finding and Points calculations.  I can add those in also once I understand what should happen there.  This script re-uses the first data group and renames it as the ConcatGroup, then deletes the other data groups.

 

OPTION EXPLICIT
Dim i, j, iMax, jMax, Offsets, Groups, Channel, ConcatGroup, Size, Delta
ConcatGroup = "ConcatResult"
Offsets = Array("", 0.04, 0.06, 0.07, 0.09, 0.10, 0.11, 0.12)
Set Groups = Data.Root.ChannelGroups
Size = ChnLength(Groups(1).Channels(1))
Delta = (CMax(Groups(1).Channels(1)) - CMin(Groups(1).Channels(1)))/(Size-1)
IF NOT Data.Root.ChannelGroups.Exists(ConcatGroup) THEN
  iMax = UBound(Offsets)
  jMax = Groups(1).Channels.Count
  FOR i = 1 TO iMax
    IF NOT Groups(i).Channels.Exists("Torque C") THEN Call Groups(i).Channels.Add("Torque C", DataTypeChnFloat64)
    Call ChnLinScale(Groups(i).Channels("Torque 1"), Groups(i).Channels("Torque C"), 1, -Offsets(i))
    IF i > 1 THEN
      FOR j = 1 TO jMax
        Call ChnConcat(Groups(i).Channels(j), Groups(1).Channels(j))
      NEXT ' j
    END IF
  NEXT ' i
  Groups(1).Name = ConcatGroup
  Size = ChnLength(Groups(1).Channels(2))
  IF iMax > 1 THEN Call ChnLinGen(Groups(1).Channels(1), 0, Delta*(Size-1), Size)
  FOR i = iMax TO 2 Step -1
    Call Data.Root.ChannelGroups.Remove(i)
  NEXT
END IF

You still haven't said what you want to do with the results.  I'm assuming you'll want a separate "Points" group for each one of those Pressure ranges, but then what?  Will you graph the results?  Will you run histograms or other statistical calculations?  The direct approach here is to take your ConcatGroup's channels and sort them by Pressure, then carve off all the rows that have the Pressure between your desired range values to the channels of that range's "Points" group.  Is there any reason to run the Event finding, actually?  If you think that approach will work, I can add that on to the end of this script and make it all-in-one, with configurable offsets and target ranges.  If you think that won't work, please describe what you want to do with the results from each Pressure range.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 9 of 23
(5,363 Views)

Hi Brad,

 

Thanks for the assistance, what I'm looking to do with those pressure windows is to create an average value for the pressure and the other channels within those windows, and then map the pressure curves against speed for  Flow, Torque, Power and Efficiencies similar to the attached image

 

Peter

Mech Eff.JPG

0 Kudos
Message 10 of 23
(5,278 Views)