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: 

ChnPatternFind question

Hello,

 

I'm experimenting with ChnPatternfind  and using the example in the help file to apply a signal pattern from a channel of values and applying it to overall dataset and it works really well.

 

I have attached a picture showing the result.

 

When I apply the principles of this to my own data and own data and signal pattern the result is less accurate.  I basically get a lot of results that seems to be matching to very low level noise in the data rather than the overall pattern.  

 

The 3rd attachment shows my signal on the top and pattern i would like to look for.

 

I suspect the problem is with parameters but i'm not understanding how to set them.

 

Any help is really appreciated.

Regards

Nick

 

0 Kudos
Message 1 of 9
(2,811 Views)

Hello Nick,

Is your question about the Pattern find dialog box or the function ChnEventPatternFind?
If it is the latter; had you seen this: Command: ChnEventPatternFind - DIAdem 2017 Help?


Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0
CLADMSD
0 Kudos
Message 2 of 9
(2,778 Views)

Hello ikaiser,

 

It is the ChnEventPatternFind,     I has since found this function in the analysis section of diadem and tinkered about with it to produce what I need, athough I have no idea what each of the parameters mean though.

 

eg Call ChnEventPatternFind("[1]/Time",oSignalChn, oPatternChn,0,1,0.62,"/Ign-Fault-1-Occurence")

the 0,1,0.62 parameters 

 

Thanks for your help

Nick

0 Kudos
Message 3 of 9
(2,768 Views)

Hello Nick,

had you seen the help page on the function? It's built-in into DIAdem, but also available online, e.g. here: Command: ChnEventPatternFind - DIAdem 2017 Help. I found this help entry helpful to understand the function.

 

In your case

  • "[1]/Time" is the x data (Note: In case your Signal Channel contains a waveform, this data is not needed),
  • oSignalChn is the y data of signal you are looking for,
  • oPatternChn is the pattern you are looking for
  • 0 is the maximum offset in x direction. Play around with different values here to understand how it changes the search result in your case! (Note: This is not a 0..1 range. You can use the full range of the channel x data.)
  • 1 defines if DIAdem is allowed to use a y-offset (0/1).
  • 0.62 is the maximum deviation, I assume in y direction. Not a range of 0..1, but 0..big number. Do some testing with your signal here as well so you get a feeling for the number you need.
  • "/Ign-Fault-1-Occurence" is the channel DIAdem copies result waveforms to, in case you specify a channel here. This for sure helps to understand where DIAdem found a hit.

Does this help you?


Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0
CLADMSD
0 Kudos
Message 4 of 9
(2,758 Views)

Hi There,

 

Very helpful,  thank you.

 

Since posting this is have used the patternfind function in the analysis section,  this allows me to adjust each setting interactively to get what I am looking for  This somehow  creates a channel and adds it to the data portal,  but when I record it and run it from a script I don't get the channel.  Any suggestion how to return the found channels via a script?

 

regards

Nick

0 Kudos
Message 5 of 9
(2,752 Views)

Hi Nick,

 

The ChnEventPatternFind() function in DIAdem works just like all the other ChnEvent...() functions.  It returns a 2D array of information about the N Events determined.  You can then use other commands like ChnEventCount() and ChnEventCopyValues() to process those Events, either one at a time or all at once.

 

OPTION EXPLICIT
Dim RawGroup, FoundGroup, RawXChannel, RawYChannel, Events
Dim PatternYChannel, FoundXChannel, FoundYChannel
Set RawGroup = Data.Root.ChannelGroups(1)
Set RawXChannel = RawGroup.Channels("Time")
Set RawYChannel = RawGroup.Channels("Revs")
Set PatternYChannel = RawGroup.Channels("CopyYRevs")
IF Data.Root.ChannelGroups.Exists("Pattern Search") THEN
  Call Data.Root.ChannelGroups.Remove("Pattern Search")
END IF
Set FoundGroup = Data.Root.ChannelGroups.Add("Pattern Search")
Set FoundXChannel = FoundGroup.Channels.Add("Found X", DataTypeChnFloat64)
Set FoundYChannel = FoundGroup.Channels.Add("Found Y", DataTypeChnFloat64)
Events = ChnEventPatternFind(RawXChannel, RawYChannel, PatternYChannel,0,0,2)
Call ChnEventCopyValues(RawXChannel, RawYChannel, FoundXChannel, FoundYChannel, Events, 1)
MsgBox "Exported Event 1 of " & ChnEventCount(Events) 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 6 of 9
(2,745 Views)

Thanks Brad,

 

That works really well. 

 

Also when I used the patternfind from the analysis bar it also creates a channel for occurrence and the value can be set (in my case I set it to 1) ,  this is quite useful as it puts a frame around the occurrence as well as identifying the pattern,  is there a parameter I need to set to use this from a script?

 

Thanks

Nick

0 Kudos
Message 7 of 9
(2,738 Views)

Hi Nick,

 

Again, the answer is the same for all ChnEvent...() functions, of which the pattern search is one.  You need to invoke a command to export a True/False status channel from the Events array-- in this case use the "ChnEventCreateStatusChn()" command:

 

Dim RawGroup, FoundGroup, RawXChannel, RawYChannel, Events
Dim PatternYChannel, FoundXChannel, FoundYChannel, EvtChannel
Set RawGroup = Data.Root.ChannelGroups(1)
Set RawXChannel = RawGroup.Channels("Time")
Set RawYChannel = RawGroup.Channels("Revs")
Set PatternYChannel = RawGroup.Channels("CopyYRevs")
Set EvtChannel = RawGroup.Channels.Add("Event Status", DataTypeChnFloat64)
IF Data.Root.ChannelGroups.Exists("Pattern Search") THEN
  Call Data.Root.ChannelGroups.Remove("Pattern Search")
END IF
Set FoundGroup = Data.Root.ChannelGroups.Add("Pattern Search")
Set FoundXChannel = FoundGroup.Channels.Add("Found X", DataTypeChnFloat64)
Set FoundYChannel = FoundGroup.Channels.Add("Found Y", DataTypeChnFloat64)
Events = ChnEventPatternFind(RawXChannel, RawYChannel, PatternYChannel,0,0,2)
Call ChnEventCreateStatusChn(EvtChannel, Events, RawYChannel, 0, 1)
'Call ChnEventCreateFilteredChn(RawYChannel, Events, ChnEventFalseChn, ChnEventTrueChn)
'Call ChnEventCopyValues(RawXChannel, RawYChannel, FoundXChannel, FoundYChannel, Events, 1)
MsgBox "Exported Event 1 of " & ChnEventCount(Events) 

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 8 of 9
(2,729 Views)

Hi Brad,

 

As expected , it worked really well.  

 

Thank you

Nick

0 Kudos
Message 9 of 9
(2,727 Views)