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.
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.
02-14-2019 04:53 AM
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
02-15-2019 02:03 AM
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?
02-15-2019 08:52 AM
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
02-18-2019 04:38 AM - edited 02-18-2019 04:42 AM
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
Does this help you?
02-18-2019 07:31 AM
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
02-19-2019 12:54 PM
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
02-20-2019 07:24 AM
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
02-20-2019 01:07 PM
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
02-20-2019 01:21 PM
Hi Brad,
As expected , it worked really well.
Thank you
Nick